-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2439 from CachetHQ/cleanup-event-names
Cleanup event names
- Loading branch information
Showing
51 changed files
with
235 additions
and
187 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,12 @@ | |
|
||
namespace CachetHQ\Cachet\Bus\Commands\Component; | ||
|
||
final class AddComponentCommand | ||
/** | ||
* This is the create component command class. | ||
* | ||
* @author James Brooks <[email protected]> | ||
*/ | ||
final class CreateComponentCommand | ||
{ | ||
/** | ||
* The component name. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,11 +12,11 @@ | |
namespace CachetHQ\Cachet\Bus\Commands\ComponentGroup; | ||
|
||
/** | ||
* This is the add component group command. | ||
* This is the create component group command. | ||
* | ||
* @author James Brooks <[email protected]> | ||
*/ | ||
final class AddComponentGroupCommand | ||
final class CreateComponentGroupCommand | ||
{ | ||
/** | ||
* The component group name. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,12 +12,12 @@ | |
namespace CachetHQ\Cachet\Bus\Commands\Incident; | ||
|
||
/** | ||
* This is the report incident command. | ||
* This is the create incident command. | ||
* | ||
* @author Joseph Cohen <[email protected]> | ||
* @author James Brooks <[email protected]> | ||
*/ | ||
final class ReportIncidentCommand | ||
final class CreateIncidentCommand | ||
{ | ||
/** | ||
* The incident name. | ||
|
@@ -115,7 +115,7 @@ final class ReportIncidentCommand | |
]; | ||
|
||
/** | ||
* Create a new report incident command instance. | ||
* Create a new create incident command instance. | ||
* | ||
* @param string $name | ||
* @param int $status | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,7 @@ | |
* | ||
* @author James Brooks <[email protected]> | ||
*/ | ||
final class ReportIncidentUpdateCommand | ||
final class CreateIncidentUpdateCommand | ||
{ | ||
/** | ||
* The incident. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,13 @@ | |
|
||
namespace CachetHQ\Cachet\Bus\Commands\Metric; | ||
|
||
final class AddMetricCommand | ||
/** | ||
* This is the create metric command class. | ||
* | ||
* @author Joseph Cohen <[email protected]> | ||
* @author James Brooks <[email protected]> | ||
*/ | ||
final class CreateMetricCommand | ||
{ | ||
/** | ||
* The metric name. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,13 @@ | |
|
||
use CachetHQ\Cachet\Models\Metric; | ||
|
||
final class AddMetricPointCommand | ||
/** | ||
* This is the create metric point command class. | ||
* | ||
* @author Joseph Cohen <[email protected]> | ||
* @author James Brooks <[email protected]> | ||
*/ | ||
final class CreateMetricPointCommand | ||
{ | ||
/** | ||
* The metric to add. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,11 +12,11 @@ | |
namespace CachetHQ\Cachet\Bus\Commands\User; | ||
|
||
/** | ||
* This is the add user command. | ||
* This is the create user command. | ||
* | ||
* @author James Brooks <[email protected]> | ||
*/ | ||
final class AddUserCommand | ||
final class CreateUserCommand | ||
{ | ||
/** | ||
* The user username. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,21 +16,21 @@ | |
use CachetHQ\Cachet\Models\User; | ||
|
||
/** | ||
* This is the component status was updated event. | ||
* This is the component status was changed event. | ||
* | ||
* @author James Brooks <[email protected]> | ||
*/ | ||
final class ComponentStatusWasUpdatedEvent implements ActionInterface, ComponentEventInterface | ||
final class ComponentStatusWasChangedEvent implements ActionInterface, ComponentEventInterface | ||
{ | ||
/** | ||
* The user who updated the component. | ||
* The user who changed the component. | ||
* | ||
* @var \CachetHQ\Cachet\Models\User | ||
*/ | ||
public $user; | ||
|
||
/** | ||
* The component that was updated. | ||
* The component that was changed. | ||
* | ||
* @var \CachetHQ\Cachet\Models\Component | ||
*/ | ||
|
@@ -84,7 +84,7 @@ public function __construct(User $user, Component $component, $original_status, | |
*/ | ||
public function __toString() | ||
{ | ||
return 'Component status was updated.'; | ||
return 'Component status was changed.'; | ||
} | ||
|
||
/** | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,12 @@ | |
use CachetHQ\Cachet\Models\Component; | ||
use CachetHQ\Cachet\Models\User; | ||
|
||
final class ComponentWasAddedEvent implements ActionInterface, ComponentEventInterface | ||
/** | ||
* This is the component was created event class. | ||
* | ||
* @author James Brooks <[email protected]> | ||
*/ | ||
final class ComponentWasCreatedEvent implements ActionInterface, ComponentEventInterface | ||
{ | ||
/** | ||
* The user who added the component. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,12 @@ | |
use CachetHQ\Cachet\Models\ComponentGroup; | ||
use CachetHQ\Cachet\Models\User; | ||
|
||
final class ComponentGroupWasAddedEvent implements ActionInterface, ComponentGroupEventInterface | ||
/** | ||
* This is the component group was created event class. | ||
* | ||
* @author James Brooks <[email protected]> | ||
*/ | ||
final class ComponentGroupWasCreatedEvent implements ActionInterface, ComponentGroupEventInterface | ||
{ | ||
/** | ||
* The user who added the component group. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,12 @@ | |
use CachetHQ\Cachet\Models\MetricPoint; | ||
use CachetHQ\Cachet\Models\User; | ||
|
||
final class MetricPointWasAddedEvent implements ActionInterface, MetricEventInterface | ||
/** | ||
* This is the metric point was created event class. | ||
* | ||
* @author James Brooks <[email protected]> | ||
*/ | ||
final class MetricPointWasCreatedEvent implements ActionInterface, MetricEventInterface | ||
{ | ||
/** | ||
* The user who added the metric point. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,12 @@ | |
use CachetHQ\Cachet\Models\Metric; | ||
use CachetHQ\Cachet\Models\User; | ||
|
||
final class MetricWasAddedEvent implements ActionInterface, MetricEventInterface | ||
/** | ||
* This is the metric was created event class. | ||
* | ||
* @author James Brooks <[email protected]> | ||
*/ | ||
final class MetricWasCreatedEvent implements ActionInterface, MetricEventInterface | ||
{ | ||
/** | ||
* The user who added the metric. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,12 @@ | |
use CachetHQ\Cachet\Bus\Events\ActionInterface; | ||
use CachetHQ\Cachet\Models\User; | ||
|
||
final class UserWasAddedEvent implements ActionInterface, UserEventInterface | ||
/** | ||
* This is the user was created event class. | ||
* | ||
* @author James Brooks <[email protected]> | ||
*/ | ||
final class UserWasCreatedEvent implements ActionInterface, UserEventInterface | ||
{ | ||
/** | ||
* The user that has been added. | ||
|
@@ -42,7 +47,7 @@ public function __construct(User $user) | |
*/ | ||
public function __toString() | ||
{ | ||
return 'User was added.'; | ||
return 'User was created.'; | ||
} | ||
|
||
/** | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,12 +11,17 @@ | |
|
||
namespace CachetHQ\Cachet\Bus\Handlers\Commands\Component; | ||
|
||
use CachetHQ\Cachet\Bus\Commands\Component\AddComponentCommand; | ||
use CachetHQ\Cachet\Bus\Events\Component\ComponentWasAddedEvent; | ||
use CachetHQ\Cachet\Bus\Commands\Component\CreateComponentCommand; | ||
use CachetHQ\Cachet\Bus\Events\Component\ComponentWasCreatedEvent; | ||
use CachetHQ\Cachet\Models\Component; | ||
use Illuminate\Contracts\Auth\Guard; | ||
|
||
class AddComponentCommandHandler | ||
/** | ||
* This is the add component command handler class. | ||
* | ||
* @author James Brooks <[email protected]> | ||
*/ | ||
class CreateComponentCommandHandler | ||
{ | ||
/** | ||
* The authentication guard instance. | ||
|
@@ -40,27 +45,27 @@ public function __construct(Guard $auth) | |
/** | ||
* Handle the add component command. | ||
* | ||
* @param \CachetHQ\Cachet\Bus\Commands\Component\AddComponentCommand $command | ||
* @param \CachetHQ\Cachet\Bus\Commands\Component\CreateComponentCommand $command | ||
* | ||
* @return \CachetHQ\Cachet\Models\Component | ||
*/ | ||
public function handle(AddComponentCommand $command) | ||
public function handle(CreateComponentCommand $command) | ||
{ | ||
$component = Component::create($this->filter($command)); | ||
|
||
event(new ComponentWasAddedEvent($this->auth->user(), $component)); | ||
event(new ComponentWasCreatedEvent($this->auth->user(), $component)); | ||
|
||
return $component; | ||
} | ||
|
||
/** | ||
* Filter the command data. | ||
* | ||
* @param \CachetHQ\Cachet\Bus\Commands\Incident\AddComponentCommand $command | ||
* @param \CachetHQ\Cachet\Bus\Commands\Incident\CreateComponentCommand $command | ||
* | ||
* @return array | ||
*/ | ||
protected function filter(AddComponentCommand $command) | ||
protected function filter(CreateComponentCommand $command) | ||
{ | ||
$params = [ | ||
'name' => $command->name, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.