Skip to content
This repository has been archived by the owner on Feb 5, 2024. It is now read-only.

Commit

Permalink
changed namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
ulrik nielsen committed Dec 14, 2015
1 parent 777e7d2 commit 5bb44d3
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 35 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ components are added or updated.

## Install

composer require "unity/cachet-slack-integration": "1.*"
composer require "mrbase/cachet-slack-integration": "1.*"

Add provider to your config/app.php providers

'providers' => [
...
Maknz\Slack\SlackServiceProvider::class,
Unity\CachetSlackIntegration\ServiceProvider::class,
Mrbase\CachetSlackIntegration\ServiceProvider::class,
],

And to aliases:
Expand Down
5 changes: 2 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "unity/cachet-slack-integration",
"name": "mrbase/cachet-slack-integration",
"description": "Adds Slack notifications on Cachet events.",
"keywords": ["laravel", "cachet", "slack", "integration"],
"homepage": "https://github.com/mrbase/cachet-slack-integration",
Expand All @@ -18,9 +18,8 @@
},
"autoload": {
"psr-4": {
"Unity\\CachetSlackIntegration\\": "src/"
"Mrbase\\CachetSlackIntegration\\": "src/"
}
},
"minimum-stability": "dev",
"prefer-stable": true
}
21 changes: 5 additions & 16 deletions src/Handlers/Events/Component/ComponentUpdated.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@
* file that was distributed with this source code.
*/

namespace Unity\CachetSlackIntegration\Handlers\Events\Component;
namespace Mrbase\CachetSlackIntegration\Handlers\Events\Component;

use CachetHQ\Cachet\Events\Component\ComponentWasUpdatedEvent;
use Maknz\Slack\Facades\Slack;
use Unity\CachetSlackIntegration\Utils;
use Mrbase\CachetSlackIntegration\Utils;

/**
* Class ComponentUpdated
*
* @package Unity\CachetSlackIntegration
* @package Mrbase\CachetSlackIntegration
* @author Ulrik Nielsen <[email protected]>
*/
class ComponentUpdated
Expand All @@ -31,21 +31,10 @@ public function handle(ComponentWasUpdatedEvent $event)
return;
}

$changes = Utils::getChanges('component');
$newStatus = $event->component->status;
$oldStatus = isset($changes['status'])
? $changes['status']
: $newStatus;

if ($oldStatus == $newStatus) {
return;
}

$statuses = trans('cachet.components.status');
$message = trans('slack::messages.component.status_update', [
'name' => $event->component->name,
'old_status' => $statuses[$oldStatus],
'new_status' => $statuses[$newStatus],
'name' => $event->component->name,
'status' => $statuses[$event->component->status],
]);

Slack::send($message);
Expand Down
6 changes: 3 additions & 3 deletions src/Handlers/Events/Incident/IncidentReported.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@
* file that was distributed with this source code.
*/

namespace Unity\CachetSlackIntegration\Handlers\Events\Incident;
namespace Mrbase\CachetSlackIntegration\Handlers\Events\Incident;

use CachetHQ\Cachet\Events\Incident\IncidentWasReportedEvent;
use Maknz\Slack\Facades\Slack;
use Unity\CachetSlackIntegration\Utils;
use Mrbase\CachetSlackIntegration\Utils;

/**
* Class IncidentReported
*
* @package Unity\CachetSlackIntegration
* @package Mrbase\CachetSlackIntegration
* @author Ulrik Nielsen <[email protected]>
*/
class IncidentReported
Expand Down
6 changes: 3 additions & 3 deletions src/Handlers/Events/Incident/IncidentUpdated.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@
* file that was distributed with this source code.
*/

namespace Unity\CachetSlackIntegration\Handlers\Events\Incident;
namespace Mrbase\CachetSlackIntegration\Handlers\Events\Incident;

use CachetHQ\Cachet\Events\Incident\IncidentWasUpdatedEvent;
use Maknz\Slack\Facades\Slack;
use Unity\CachetSlackIntegration\Utils;
use Mrbase\CachetSlackIntegration\Utils;

/**
* Class IncidentUpdated
*
* @package Unity\CachetSlackIntegration
* @package Mrbase\CachetSlackIntegration
* @author Ulrik Nielsen <[email protected]>
*/
class IncidentUpdated
Expand Down
10 changes: 5 additions & 5 deletions src/ServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@
* file that was distributed with this source code.
*/

namespace Unity\CachetSlackIntegration;
namespace Mrbase\CachetSlackIntegration;

use CachetHQ\Cachet\Models\Component;
use CachetHQ\Cachet\Models\Incident;
use Illuminate\Foundation\Support\Providers\EventServiceProvider;
use Illuminate\Contracts\Events\Dispatcher as DispatcherContract;
use Unity\CachetSlackIntegration\Handlers\Events\Component\ComponentUpdated;
use Unity\CachetSlackIntegration\Handlers\Events\Incident\IncidentReported;
use Unity\CachetSlackIntegration\Handlers\Events\Incident\IncidentUpdated;
use Mrbase\CachetSlackIntegration\Handlers\Events\Component\ComponentUpdated;
use Mrbase\CachetSlackIntegration\Handlers\Events\Incident\IncidentReported;
use Mrbase\CachetSlackIntegration\Handlers\Events\Incident\IncidentUpdated;

/**
* Class ServiceProvider
*
* @package Unity\CachetSlackIntegration
* @package Mrbase\CachetSlackIntegration
* @author Ulrik Nielsen <[email protected]>
*/
class ServiceProvider extends EventServiceProvider
Expand Down
4 changes: 2 additions & 2 deletions src/Utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
* file that was distributed with this source code.
*/

namespace Unity\CachetSlackIntegration;
namespace Mrbase\CachetSlackIntegration;

use CachetHQ\Cachet\Models\Component;

/**
* Class Utils
*
* @package Unity\CachetSlackIntegration
* @package Mrbase\CachetSlackIntegration
* @author Ulrik Nielsen <[email protected]>
*/
class Utils
Expand Down
2 changes: 1 addition & 1 deletion src/resources/lang/en/messages.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

return [
'component' => [
'status_update' => 'Component *:name* changed status from *:old_status* to *:new_status*.'
'status_update' => 'Component *:name* changed status to *:status*.'
],

'incident' => [
Expand Down

0 comments on commit 5bb44d3

Please sign in to comment.