Skip to content

Commit 9bd1e3e

Browse files
authored
Merge pull request #2439 from CachetHQ/cleanup-event-names
Cleanup event names
2 parents 1529720 + c1bd3e4 commit 9bd1e3e

File tree

51 files changed

+235
-187
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+235
-187
lines changed

app/Bus/Commands/Component/AddComponentCommand.php app/Bus/Commands/Component/CreateComponentCommand.php

+6-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@
1111

1212
namespace CachetHQ\Cachet\Bus\Commands\Component;
1313

14-
final class AddComponentCommand
14+
/**
15+
* This is the create component command class.
16+
*
17+
* @author James Brooks <james@alt-three.com>
18+
*/
19+
final class CreateComponentCommand
1520
{
1621
/**
1722
* The component name.

app/Bus/Commands/ComponentGroup/AddComponentGroupCommand.php app/Bus/Commands/ComponentGroup/CreateComponentGroupCommand.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
namespace CachetHQ\Cachet\Bus\Commands\ComponentGroup;
1313

1414
/**
15-
* This is the add component group command.
15+
* This is the create component group command.
1616
*
1717
* @author James Brooks <james@alt-three.com>
1818
*/
19-
final class AddComponentGroupCommand
19+
final class CreateComponentGroupCommand
2020
{
2121
/**
2222
* The component group name.

app/Bus/Commands/Incident/ReportIncidentCommand.php app/Bus/Commands/Incident/CreateIncidentCommand.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
namespace CachetHQ\Cachet\Bus\Commands\Incident;
1313

1414
/**
15-
* This is the report incident command.
15+
* This is the create incident command.
1616
*
1717
* @author Joseph Cohen <joe@alt-three.com>
1818
* @author James Brooks <james@alt-three.com>
1919
*/
20-
final class ReportIncidentCommand
20+
final class CreateIncidentCommand
2121
{
2222
/**
2323
* The incident name.
@@ -115,7 +115,7 @@ final class ReportIncidentCommand
115115
];
116116

117117
/**
118-
* Create a new report incident command instance.
118+
* Create a new create incident command instance.
119119
*
120120
* @param string $name
121121
* @param int $status

app/Bus/Commands/IncidentUpdate/ReportIncidentUpdateCommand.php app/Bus/Commands/IncidentUpdate/CreateIncidentUpdateCommand.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
*
2020
* @author James Brooks <james@alt-three.com>
2121
*/
22-
final class ReportIncidentUpdateCommand
22+
final class CreateIncidentUpdateCommand
2323
{
2424
/**
2525
* The incident.

app/Bus/Commands/Metric/AddMetricCommand.php app/Bus/Commands/Metric/CreateMetricCommand.php

+7-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,13 @@
1111

1212
namespace CachetHQ\Cachet\Bus\Commands\Metric;
1313

14-
final class AddMetricCommand
14+
/**
15+
* This is the create metric command class.
16+
*
17+
* @author Joseph Cohen <joe@alt-three.com>
18+
* @author James Brooks <james@alt-three.com>
19+
*/
20+
final class CreateMetricCommand
1521
{
1622
/**
1723
* The metric name.

app/Bus/Commands/Metric/AddMetricPointCommand.php app/Bus/Commands/Metric/CreateMetricPointCommand.php

+7-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,13 @@
1313

1414
use CachetHQ\Cachet\Models\Metric;
1515

16-
final class AddMetricPointCommand
16+
/**
17+
* This is the create metric point command class.
18+
*
19+
* @author Joseph Cohen <joe@alt-three.com>
20+
* @author James Brooks <james@alt-three.com>
21+
*/
22+
final class CreateMetricPointCommand
1723
{
1824
/**
1925
* The metric to add.

app/Bus/Commands/User/AddUserCommand.php app/Bus/Commands/User/CreateUserCommand.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
namespace CachetHQ\Cachet\Bus\Commands\User;
1313

1414
/**
15-
* This is the add user command.
15+
* This is the create user command.
1616
*
1717
* @author James Brooks <james@alt-three.com>
1818
*/
19-
final class AddUserCommand
19+
final class CreateUserCommand
2020
{
2121
/**
2222
* The user username.

app/Bus/Events/Component/ComponentStatusWasUpdatedEvent.php app/Bus/Events/Component/ComponentStatusWasChangedEvent.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,21 @@
1616
use CachetHQ\Cachet\Models\User;
1717

1818
/**
19-
* This is the component status was updated event.
19+
* This is the component status was changed event.
2020
*
2121
* @author James Brooks <james@alt-three.com>
2222
*/
23-
final class ComponentStatusWasUpdatedEvent implements ActionInterface, ComponentEventInterface
23+
final class ComponentStatusWasChangedEvent implements ActionInterface, ComponentEventInterface
2424
{
2525
/**
26-
* The user who updated the component.
26+
* The user who changed the component.
2727
*
2828
* @var \CachetHQ\Cachet\Models\User
2929
*/
3030
public $user;
3131

3232
/**
33-
* The component that was updated.
33+
* The component that was changed.
3434
*
3535
* @var \CachetHQ\Cachet\Models\Component
3636
*/
@@ -84,7 +84,7 @@ public function __construct(User $user, Component $component, $original_status,
8484
*/
8585
public function __toString()
8686
{
87-
return 'Component status was updated.';
87+
return 'Component status was changed.';
8888
}
8989

9090
/**

app/Bus/Events/Component/ComponentWasAddedEvent.php app/Bus/Events/Component/ComponentWasCreatedEvent.php

+6-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,12 @@
1515
use CachetHQ\Cachet\Models\Component;
1616
use CachetHQ\Cachet\Models\User;
1717

18-
final class ComponentWasAddedEvent implements ActionInterface, ComponentEventInterface
18+
/**
19+
* This is the component was created event class.
20+
*
21+
* @author James Brooks <james@alt-three.com>
22+
*/
23+
final class ComponentWasCreatedEvent implements ActionInterface, ComponentEventInterface
1924
{
2025
/**
2126
* The user who added the component.

app/Bus/Events/ComponentGroup/ComponentGroupWasAddedEvent.php app/Bus/Events/ComponentGroup/ComponentGroupWasCreatedEvent.php

+6-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,12 @@
1515
use CachetHQ\Cachet\Models\ComponentGroup;
1616
use CachetHQ\Cachet\Models\User;
1717

18-
final class ComponentGroupWasAddedEvent implements ActionInterface, ComponentGroupEventInterface
18+
/**
19+
* This is the component group was created event class.
20+
*
21+
* @author James Brooks <james@alt-three.com>
22+
*/
23+
final class ComponentGroupWasCreatedEvent implements ActionInterface, ComponentGroupEventInterface
1924
{
2025
/**
2126
* The user who added the component group.

app/Bus/Events/Incident/IncidentWasReportedEvent.php app/Bus/Events/Incident/IncidentWasCreatedEvent.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
use CachetHQ\Cachet\Models\Incident;
1616
use CachetHQ\Cachet\Models\User;
1717

18-
final class IncidentWasReportedEvent implements ActionInterface, IncidentEventInterface
18+
final class IncidentWasCreatedEvent implements ActionInterface, IncidentEventInterface
1919
{
2020
/**
2121
* The user who reported the event.

app/Bus/Events/Metric/MetricPointWasAddedEvent.php app/Bus/Events/Metric/MetricPointWasCreatedEvent.php

+6-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,12 @@
1515
use CachetHQ\Cachet\Models\MetricPoint;
1616
use CachetHQ\Cachet\Models\User;
1717

18-
final class MetricPointWasAddedEvent implements ActionInterface, MetricEventInterface
18+
/**
19+
* This is the metric point was created event class.
20+
*
21+
* @author James Brooks <james@alt-three.com>
22+
*/
23+
final class MetricPointWasCreatedEvent implements ActionInterface, MetricEventInterface
1924
{
2025
/**
2126
* The user who added the metric point.

app/Bus/Events/Metric/MetricWasAddedEvent.php app/Bus/Events/Metric/MetricWasCreatedEvent.php

+6-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,12 @@
1515
use CachetHQ\Cachet\Models\Metric;
1616
use CachetHQ\Cachet\Models\User;
1717

18-
final class MetricWasAddedEvent implements ActionInterface, MetricEventInterface
18+
/**
19+
* This is the metric was created event class.
20+
*
21+
* @author James Brooks <james@alt-three.com>
22+
*/
23+
final class MetricWasCreatedEvent implements ActionInterface, MetricEventInterface
1924
{
2025
/**
2126
* The user who added the metric.

app/Bus/Events/User/UserWasAddedEvent.php app/Bus/Events/User/UserWasCreatedEvent.php

+7-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,12 @@
1414
use CachetHQ\Cachet\Bus\Events\ActionInterface;
1515
use CachetHQ\Cachet\Models\User;
1616

17-
final class UserWasAddedEvent implements ActionInterface, UserEventInterface
17+
/**
18+
* This is the user was created event class.
19+
*
20+
* @author James Brooks <james@alt-three.com>
21+
*/
22+
final class UserWasCreatedEvent implements ActionInterface, UserEventInterface
1823
{
1924
/**
2025
* The user that has been added.
@@ -42,7 +47,7 @@ public function __construct(User $user)
4247
*/
4348
public function __toString()
4449
{
45-
return 'User was added.';
50+
return 'User was created.';
4651
}
4752

4853
/**

app/Bus/Events/User/UserWasInvitedEvent.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
final class UserWasInvitedEvent implements UserEventInterface
2424
{
2525
/**
26-
* The invite that has been added.
26+
* The invite that has been created.
2727
*
2828
* @var \CachetHQ\Cachet\Models\Invite
2929
*/

app/Bus/Handlers/Commands/Component/AddComponentCommandHandler.php app/Bus/Handlers/Commands/Component/CreateComponentCommandHandler.php

+13-8
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,17 @@
1111

1212
namespace CachetHQ\Cachet\Bus\Handlers\Commands\Component;
1313

14-
use CachetHQ\Cachet\Bus\Commands\Component\AddComponentCommand;
15-
use CachetHQ\Cachet\Bus\Events\Component\ComponentWasAddedEvent;
14+
use CachetHQ\Cachet\Bus\Commands\Component\CreateComponentCommand;
15+
use CachetHQ\Cachet\Bus\Events\Component\ComponentWasCreatedEvent;
1616
use CachetHQ\Cachet\Models\Component;
1717
use Illuminate\Contracts\Auth\Guard;
1818

19-
class AddComponentCommandHandler
19+
/**
20+
* This is the add component command handler class.
21+
*
22+
* @author James Brooks <james@alt-three.com>
23+
*/
24+
class CreateComponentCommandHandler
2025
{
2126
/**
2227
* The authentication guard instance.
@@ -40,27 +45,27 @@ public function __construct(Guard $auth)
4045
/**
4146
* Handle the add component command.
4247
*
43-
* @param \CachetHQ\Cachet\Bus\Commands\Component\AddComponentCommand $command
48+
* @param \CachetHQ\Cachet\Bus\Commands\Component\CreateComponentCommand $command
4449
*
4550
* @return \CachetHQ\Cachet\Models\Component
4651
*/
47-
public function handle(AddComponentCommand $command)
52+
public function handle(CreateComponentCommand $command)
4853
{
4954
$component = Component::create($this->filter($command));
5055

51-
event(new ComponentWasAddedEvent($this->auth->user(), $component));
56+
event(new ComponentWasCreatedEvent($this->auth->user(), $component));
5257

5358
return $component;
5459
}
5560

5661
/**
5762
* Filter the command data.
5863
*
59-
* @param \CachetHQ\Cachet\Bus\Commands\Incident\AddComponentCommand $command
64+
* @param \CachetHQ\Cachet\Bus\Commands\Incident\CreateComponentCommand $command
6065
*
6166
* @return array
6267
*/
63-
protected function filter(AddComponentCommand $command)
68+
protected function filter(CreateComponentCommand $command)
6469
{
6570
$params = [
6671
'name' => $command->name,

app/Bus/Handlers/Commands/Component/UpdateComponentCommandHandler.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
namespace CachetHQ\Cachet\Bus\Handlers\Commands\Component;
1313

1414
use CachetHQ\Cachet\Bus\Commands\Component\UpdateComponentCommand;
15-
use CachetHQ\Cachet\Bus\Events\Component\ComponentStatusWasUpdatedEvent;
15+
use CachetHQ\Cachet\Bus\Events\Component\ComponentStatusWasChangedEvent;
1616
use CachetHQ\Cachet\Bus\Events\Component\ComponentWasUpdatedEvent;
1717
use CachetHQ\Cachet\Models\Component;
1818
use Illuminate\Contracts\Auth\Guard;
@@ -50,7 +50,7 @@ public function handle(UpdateComponentCommand $command)
5050
$component = $command->component;
5151
$originalStatus = $component->status;
5252

53-
event(new ComponentStatusWasUpdatedEvent($this->auth->user(), $component, $originalStatus, $command->status, $command->silent));
53+
event(new ComponentStatusWasChangedEvent($this->auth->user(), $component, $originalStatus, $command->status, $command->silent));
5454

5555
$component->update($this->filter($command));
5656

app/Bus/Handlers/Commands/ComponentGroup/AddComponentGroupCommandHandler.php app/Bus/Handlers/Commands/ComponentGroup/CreateComponentGroupCommandHandler.php

+8-8
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111

1212
namespace CachetHQ\Cachet\Bus\Handlers\Commands\ComponentGroup;
1313

14-
use CachetHQ\Cachet\Bus\Commands\ComponentGroup\AddComponentGroupCommand;
15-
use CachetHQ\Cachet\Bus\Events\ComponentGroup\ComponentGroupWasAddedEvent;
14+
use CachetHQ\Cachet\Bus\Commands\ComponentGroup\CreateComponentGroupCommand;
15+
use CachetHQ\Cachet\Bus\Events\ComponentGroup\ComponentGroupWasCreatedEvent;
1616
use CachetHQ\Cachet\Models\ComponentGroup;
1717
use Illuminate\Contracts\Auth\Guard;
1818

19-
class AddComponentGroupCommandHandler
19+
class CreateComponentGroupCommandHandler
2020
{
2121
/**
2222
* The authentication guard instance.
@@ -26,7 +26,7 @@ class AddComponentGroupCommandHandler
2626
protected $auth;
2727

2828
/**
29-
* Create a new add component group command handler instance.
29+
* Create a new create component group command handler instance.
3030
*
3131
* @param \Illuminate\Contracts\Auth\Guard $auth
3232
*
@@ -38,13 +38,13 @@ public function __construct(Guard $auth)
3838
}
3939

4040
/**
41-
* Handle the add component group command.
41+
* Handle the create component group command.
4242
*
43-
* @param \CachetHQ\Cachet\Bus\Commands\ComponentGroup\AddComponentGroupCommand $command
43+
* @param \CachetHQ\Cachet\Bus\Commands\ComponentGroup\CreateComponentGroupCommand $command
4444
*
4545
* @return \CachetHQ\Cachet\Models\ComponentGroup
4646
*/
47-
public function handle(AddComponentGroupCommand $command)
47+
public function handle(CreateComponentGroupCommand $command)
4848
{
4949
$group = ComponentGroup::create([
5050
'name' => $command->name,
@@ -53,7 +53,7 @@ public function handle(AddComponentGroupCommand $command)
5353
'visible' => $command->visible,
5454
]);
5555

56-
event(new ComponentGroupWasAddedEvent($this->auth->user(), $group));
56+
event(new ComponentGroupWasCreatedEvent($this->auth->user(), $group));
5757

5858
return $group;
5959
}

0 commit comments

Comments
 (0)