nixilla/hipchat-bundle

Provides simple hipchat notification service - requires Buzz

0.1.1 2017-03-30 12:08 UTC

This package is auto-updated.

Last update: 2024-12-19 00:44:30 UTC


README

Very basic and simple Hipchat integration. Currently it only provides notification to single room. But if you would like to extend it please feel free to send pull request.

Build Status Coverage Status

Installation

Install with composer:

composer require nixilla/hipchat-bundle

Add budle to AppKernel:

<?php

// app/AppKernel.php

class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = [
            // other bundles here,
            new Nixilla\HipchatBundle\NixillaHipchatBundle()
        ];
        
        return $bundles;
    }
}

Configure parameters.yml:

hipchat.token: tbc
hipchat.room: tbc
hipchat.domain: tbc

Usage

Inject hipchat service in to your service:

your.service:
    class: \YourClass
    arguments: [ "@hipchat.notifier" ]

Use in your class:

<?php

class YourClass
{
    private $hipchat; // inject it via constructor
    
    public function yourMethod()
    {
        $this->hipchat->notify($colour = 'red', $message = 'Hello', $format = 'text', $notify = false);        
    }
}