diff --git a/app/Bus/Commands/Component/AddComponentCommand.php b/app/Bus/Commands/Component/CreateComponentCommand.php similarity index 94% rename from app/Bus/Commands/Component/AddComponentCommand.php rename to app/Bus/Commands/Component/CreateComponentCommand.php index 1332fe4a..d2305fa9 100644 --- a/app/Bus/Commands/Component/AddComponentCommand.php +++ b/app/Bus/Commands/Component/CreateComponentCommand.php @@ -11,7 +11,12 @@ namespace CachetHQ\Cachet\Bus\Commands\Component; -final class AddComponentCommand +/** + * This is the create component command class. + * + * @author James Brooks + */ +final class CreateComponentCommand { /** * The component name. diff --git a/app/Bus/Commands/ComponentGroup/AddComponentGroupCommand.php b/app/Bus/Commands/ComponentGroup/CreateComponentGroupCommand.php similarity index 94% rename from app/Bus/Commands/ComponentGroup/AddComponentGroupCommand.php rename to app/Bus/Commands/ComponentGroup/CreateComponentGroupCommand.php index 2a959221..7bec1b5d 100644 --- a/app/Bus/Commands/ComponentGroup/AddComponentGroupCommand.php +++ b/app/Bus/Commands/ComponentGroup/CreateComponentGroupCommand.php @@ -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 */ -final class AddComponentGroupCommand +final class CreateComponentGroupCommand { /** * The component group name. diff --git a/app/Bus/Commands/Metric/AddMetricCommand.php b/app/Bus/Commands/Metric/CreateMetricCommand.php similarity index 94% rename from app/Bus/Commands/Metric/AddMetricCommand.php rename to app/Bus/Commands/Metric/CreateMetricCommand.php index 39000e82..dc1ed90d 100644 --- a/app/Bus/Commands/Metric/AddMetricCommand.php +++ b/app/Bus/Commands/Metric/CreateMetricCommand.php @@ -11,7 +11,13 @@ namespace CachetHQ\Cachet\Bus\Commands\Metric; -final class AddMetricCommand +/** + * This is the create metric command class. + * + * @author Joseph Cohen + * @author James Brooks + */ +final class CreateMetricCommand { /** * The metric name. diff --git a/app/Bus/Commands/Metric/AddMetricPointCommand.php b/app/Bus/Commands/Metric/CreateMetricPointCommand.php similarity index 86% rename from app/Bus/Commands/Metric/AddMetricPointCommand.php rename to app/Bus/Commands/Metric/CreateMetricPointCommand.php index 74c50b3d..a6b7e0a1 100644 --- a/app/Bus/Commands/Metric/AddMetricPointCommand.php +++ b/app/Bus/Commands/Metric/CreateMetricPointCommand.php @@ -13,7 +13,13 @@ namespace CachetHQ\Cachet\Bus\Commands\Metric; use CachetHQ\Cachet\Models\Metric; -final class AddMetricPointCommand +/** + * This is the create metric point command class. + * + * @author Joseph Cohen + * @author James Brooks + */ +final class CreateMetricPointCommand { /** * The metric to add. diff --git a/app/Bus/Commands/User/AddUserCommand.php b/app/Bus/Commands/User/CreateUserCommand.php similarity index 95% rename from app/Bus/Commands/User/AddUserCommand.php rename to app/Bus/Commands/User/CreateUserCommand.php index ef9ecdd6..fad590d3 100644 --- a/app/Bus/Commands/User/AddUserCommand.php +++ b/app/Bus/Commands/User/CreateUserCommand.php @@ -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 */ -final class AddUserCommand +final class CreateUserCommand { /** * The user username. diff --git a/app/Bus/Events/Component/ComponentWasAddedEvent.php b/app/Bus/Events/Component/ComponentWasCreatedEvent.php similarity index 87% rename from app/Bus/Events/Component/ComponentWasAddedEvent.php rename to app/Bus/Events/Component/ComponentWasCreatedEvent.php index c33f369a..29b00da5 100644 --- a/app/Bus/Events/Component/ComponentWasAddedEvent.php +++ b/app/Bus/Events/Component/ComponentWasCreatedEvent.php @@ -15,7 +15,12 @@ use CachetHQ\Cachet\Bus\Events\ActionInterface; 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 + */ +final class ComponentWasCreatedEvent implements ActionInterface, ComponentEventInterface { /** * The user who added the component. diff --git a/app/Bus/Events/ComponentGroup/ComponentGroupWasAddedEvent.php b/app/Bus/Events/ComponentGroup/ComponentGroupWasCreatedEvent.php similarity index 87% rename from app/Bus/Events/ComponentGroup/ComponentGroupWasAddedEvent.php rename to app/Bus/Events/ComponentGroup/ComponentGroupWasCreatedEvent.php index a41501b5..97ad6057 100644 --- a/app/Bus/Events/ComponentGroup/ComponentGroupWasAddedEvent.php +++ b/app/Bus/Events/ComponentGroup/ComponentGroupWasCreatedEvent.php @@ -15,7 +15,12 @@ use CachetHQ\Cachet\Bus\Events\ActionInterface; 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 + */ +final class ComponentGroupWasCreatedEvent implements ActionInterface, ComponentGroupEventInterface { /** * The user who added the component group. diff --git a/app/Bus/Events/Metric/MetricPointWasAddedEvent.php b/app/Bus/Events/Metric/MetricPointWasCreatedEvent.php similarity index 87% rename from app/Bus/Events/Metric/MetricPointWasAddedEvent.php rename to app/Bus/Events/Metric/MetricPointWasCreatedEvent.php index 02a57ae0..7137b8c1 100644 --- a/app/Bus/Events/Metric/MetricPointWasAddedEvent.php +++ b/app/Bus/Events/Metric/MetricPointWasCreatedEvent.php @@ -15,7 +15,12 @@ use CachetHQ\Cachet\Bus\Events\ActionInterface; 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 + */ +final class MetricPointWasCreatedEvent implements ActionInterface, MetricEventInterface { /** * The user who added the metric point. diff --git a/app/Bus/Events/Metric/MetricWasAddedEvent.php b/app/Bus/Events/Metric/MetricWasCreatedEvent.php similarity index 87% rename from app/Bus/Events/Metric/MetricWasAddedEvent.php rename to app/Bus/Events/Metric/MetricWasCreatedEvent.php index 9ed5c420..f3e123b8 100644 --- a/app/Bus/Events/Metric/MetricWasAddedEvent.php +++ b/app/Bus/Events/Metric/MetricWasCreatedEvent.php @@ -15,7 +15,12 @@ use CachetHQ\Cachet\Bus\Events\ActionInterface; 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 + */ +final class MetricWasCreatedEvent implements ActionInterface, MetricEventInterface { /** * The user who added the metric. diff --git a/app/Bus/Events/User/UserWasAddedEvent.php b/app/Bus/Events/User/UserWasCreatedEvent.php similarity index 85% rename from app/Bus/Events/User/UserWasAddedEvent.php rename to app/Bus/Events/User/UserWasCreatedEvent.php index fb9d218e..1dd02484 100644 --- a/app/Bus/Events/User/UserWasAddedEvent.php +++ b/app/Bus/Events/User/UserWasCreatedEvent.php @@ -14,7 +14,12 @@ namespace CachetHQ\Cachet\Bus\Events\User; 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 + */ +final class UserWasCreatedEvent implements ActionInterface, UserEventInterface { /** * The user that has been added. diff --git a/app/Bus/Handlers/Commands/Component/AddComponentCommandHandler.php b/app/Bus/Handlers/Commands/Component/CreateComponentCommandHandler.php similarity index 70% rename from app/Bus/Handlers/Commands/Component/AddComponentCommandHandler.php rename to app/Bus/Handlers/Commands/Component/CreateComponentCommandHandler.php index fd22f323..7cc941e0 100644 --- a/app/Bus/Handlers/Commands/Component/AddComponentCommandHandler.php +++ b/app/Bus/Handlers/Commands/Component/CreateComponentCommandHandler.php @@ -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 + */ +class CreateComponentCommandHandler { /** * The authentication guard instance. @@ -40,15 +45,15 @@ class AddComponentCommandHandler /** * 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; } @@ -56,11 +61,11 @@ class AddComponentCommandHandler /** * 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, diff --git a/app/Bus/Handlers/Commands/ComponentGroup/AddComponentGroupCommandHandler.php b/app/Bus/Handlers/Commands/ComponentGroup/CreateComponentGroupCommandHandler.php similarity index 65% rename from app/Bus/Handlers/Commands/ComponentGroup/AddComponentGroupCommandHandler.php rename to app/Bus/Handlers/Commands/ComponentGroup/CreateComponentGroupCommandHandler.php index 9715f4a9..2169025b 100644 --- a/app/Bus/Handlers/Commands/ComponentGroup/AddComponentGroupCommandHandler.php +++ b/app/Bus/Handlers/Commands/ComponentGroup/CreateComponentGroupCommandHandler.php @@ -11,12 +11,12 @@ namespace CachetHQ\Cachet\Bus\Handlers\Commands\ComponentGroup; -use CachetHQ\Cachet\Bus\Commands\ComponentGroup\AddComponentGroupCommand; -use CachetHQ\Cachet\Bus\Events\ComponentGroup\ComponentGroupWasAddedEvent; +use CachetHQ\Cachet\Bus\Commands\ComponentGroup\CreateComponentGroupCommand; +use CachetHQ\Cachet\Bus\Events\ComponentGroup\ComponentGroupWasCreatedEvent; use CachetHQ\Cachet\Models\ComponentGroup; use Illuminate\Contracts\Auth\Guard; -class AddComponentGroupCommandHandler +class CreateComponentGroupCommandHandler { /** * The authentication guard instance. @@ -26,7 +26,7 @@ class AddComponentGroupCommandHandler protected $auth; /** - * Create a new add component group command handler instance. + * Create a new create component group command handler instance. * * @param \Illuminate\Contracts\Auth\Guard $auth * @@ -38,13 +38,13 @@ class AddComponentGroupCommandHandler } /** - * Handle the add component group command. + * Handle the create component group command. * - * @param \CachetHQ\Cachet\Bus\Commands\ComponentGroup\AddComponentGroupCommand $command + * @param \CachetHQ\Cachet\Bus\Commands\ComponentGroup\CreateComponentGroupCommand $command * * @return \CachetHQ\Cachet\Models\ComponentGroup */ - public function handle(AddComponentGroupCommand $command) + public function handle(CreateComponentGroupCommand $command) { $group = ComponentGroup::create([ 'name' => $command->name, @@ -53,7 +53,7 @@ class AddComponentGroupCommandHandler 'visible' => $command->visible, ]); - event(new ComponentGroupWasAddedEvent($this->auth->user(), $group)); + event(new ComponentGroupWasCreatedEvent($this->auth->user(), $group)); return $group; } diff --git a/app/Bus/Handlers/Commands/Metric/AddMetricCommandHandler.php b/app/Bus/Handlers/Commands/Metric/CreateMetricCommandHandler.php similarity index 80% rename from app/Bus/Handlers/Commands/Metric/AddMetricCommandHandler.php rename to app/Bus/Handlers/Commands/Metric/CreateMetricCommandHandler.php index 1f074439..cc410ce0 100644 --- a/app/Bus/Handlers/Commands/Metric/AddMetricCommandHandler.php +++ b/app/Bus/Handlers/Commands/Metric/CreateMetricCommandHandler.php @@ -11,12 +11,12 @@ namespace CachetHQ\Cachet\Bus\Handlers\Commands\Metric; -use CachetHQ\Cachet\Bus\Commands\Metric\AddMetricCommand; -use CachetHQ\Cachet\Bus\Events\Metric\MetricWasAddedEvent; +use CachetHQ\Cachet\Bus\Commands\Metric\CreateMetricCommand; +use CachetHQ\Cachet\Bus\Events\Metric\MetricWasCreatedEvent; use CachetHQ\Cachet\Models\Metric; use Illuminate\Contracts\Auth\Guard; -class AddMetricCommandHandler +class CreateMetricCommandHandler { /** * The authentication guard instance. @@ -40,11 +40,11 @@ class AddMetricCommandHandler /** * Handle the add metric command. * - * @param \CachetHQ\Cachet\Bus\Commands\Metric\AddMetricCommand $command + * @param \CachetHQ\Cachet\Bus\Commands\Metric\CreateMetricCommand $command * * @return \CachetHQ\Cachet\Models\Metric */ - public function handle(AddMetricCommand $command) + public function handle(CreateMetricCommand $command) { $metric = Metric::create([ 'name' => $command->name, @@ -60,7 +60,7 @@ class AddMetricCommandHandler 'visible' => $command->visible, ]); - event(new MetricWasAddedEvent($this->auth->user(), $metric)); + event(new MetricWasCreatedEvent($this->auth->user(), $metric)); return $metric; } diff --git a/app/Bus/Handlers/Commands/Metric/AddMetricPointCommandHandler.php b/app/Bus/Handlers/Commands/Metric/CreateMetricPointCommandHandler.php similarity index 80% rename from app/Bus/Handlers/Commands/Metric/AddMetricPointCommandHandler.php rename to app/Bus/Handlers/Commands/Metric/CreateMetricPointCommandHandler.php index 5be8acb1..4e065de7 100644 --- a/app/Bus/Handlers/Commands/Metric/AddMetricPointCommandHandler.php +++ b/app/Bus/Handlers/Commands/Metric/CreateMetricPointCommandHandler.php @@ -11,14 +11,14 @@ namespace CachetHQ\Cachet\Bus\Handlers\Commands\Metric; -use CachetHQ\Cachet\Bus\Commands\Metric\AddMetricPointCommand; -use CachetHQ\Cachet\Bus\Events\Metric\MetricPointWasAddedEvent; +use CachetHQ\Cachet\Bus\Commands\Metric\CreateMetricPointCommand; +use CachetHQ\Cachet\Bus\Events\Metric\MetricPointWasCreatedEvent; use CachetHQ\Cachet\Models\MetricPoint; use CachetHQ\Cachet\Services\Dates\DateFactory; use Carbon\Carbon; use Illuminate\Contracts\Auth\Guard; -class AddMetricPointCommandHandler +class CreateMetricPointCommandHandler { /** * The authentication guard instance. @@ -51,11 +51,11 @@ class AddMetricPointCommandHandler /** * Handle the add metric point command. * - * @param \CachetHQ\Cachet\Bus\Commands\Metric\AddMetricPointCommand $command + * @param \CachetHQ\Cachet\Bus\Commands\Metric\CreateMetricPointCommand $command * * @return \CachetHQ\Cachet\Models\MetricPoint */ - public function handle(AddMetricPointCommand $command) + public function handle(CreateMetricPointCommand $command) { $metric = $command->metric; $createdAt = $command->created_at; @@ -65,7 +65,7 @@ class AddMetricPointCommandHandler $point->increment('counter', 1); - event(new MetricPointWasAddedEvent($this->auth->user(), $point)); + event(new MetricPointWasCreatedEvent($this->auth->user(), $point)); return $point; } @@ -73,11 +73,11 @@ class AddMetricPointCommandHandler /** * Find or create a metric point. * - * @param \CachetHQ\Cachet\Bus\Commands\Metric\AddMetricPointCommand $command + * @param \CachetHQ\Cachet\Bus\Commands\Metric\CreateMetricPointCommand $command * * @return \CachetHQ\Cachet\Models\MetricPoint */ - protected function findOrCreatePoint(AddMetricPointCommand $command) + protected function findOrCreatePoint(CreateMetricPointCommand $command) { $buffer = Carbon::now()->subMinutes($command->metric->threshold); diff --git a/app/Bus/Handlers/Commands/User/AddUserCommandHandler.php b/app/Bus/Handlers/Commands/User/CreateUserCommandHandler.php similarity index 66% rename from app/Bus/Handlers/Commands/User/AddUserCommandHandler.php rename to app/Bus/Handlers/Commands/User/CreateUserCommandHandler.php index 856e33bb..9ae22e67 100644 --- a/app/Bus/Handlers/Commands/User/AddUserCommandHandler.php +++ b/app/Bus/Handlers/Commands/User/CreateUserCommandHandler.php @@ -11,25 +11,25 @@ namespace CachetHQ\Cachet\Bus\Handlers\Commands\User; -use CachetHQ\Cachet\Bus\Commands\User\AddUserCommand; -use CachetHQ\Cachet\Bus\Events\User\UserWasAddedEvent; +use CachetHQ\Cachet\Bus\Commands\User\CreateUserCommand; +use CachetHQ\Cachet\Bus\Events\User\UserWasCreatedEvent; use CachetHQ\Cachet\Models\User; /** - * This is the add user command handler. + * This is the create user command handler. * * @author James Brooks */ -class AddUserCommandHandler +class CreateUserCommandHandler { /** * Handle the add user command. * - * @param \CachetHQ\Cachet\Bus\Commands\User\AddUserCommand $command + * @param \CachetHQ\Cachet\Bus\Commands\User\CreateUserCommand $command * * @return \CachetHQ\Cachet\Models\User */ - public function handle(AddUserCommand $command) + public function handle(CreateUserCommand $command) { $user = User::create([ 'username' => $command->username, @@ -38,7 +38,7 @@ class AddUserCommandHandler 'level' => $command->level, ]); - event(new UserWasAddedEvent($user)); + event(new UserWasCreatedEvent($user)); return $user; } diff --git a/app/Bus/Handlers/Commands/User/SignupUserCommandHandler.php b/app/Bus/Handlers/Commands/User/SignupUserCommandHandler.php index 740b8a4c..bb274a2f 100644 --- a/app/Bus/Handlers/Commands/User/SignupUserCommandHandler.php +++ b/app/Bus/Handlers/Commands/User/SignupUserCommandHandler.php @@ -12,7 +12,7 @@ namespace CachetHQ\Cachet\Bus\Handlers\Commands\User; use CachetHQ\Cachet\Bus\Commands\User\SignupUserCommand; -use CachetHQ\Cachet\Bus\Events\User\UserWasAddedEvent; +use CachetHQ\Cachet\Bus\Events\User\UserWasCreatedEvent; use CachetHQ\Cachet\Models\User; class SignupUserCommandHandler @@ -33,7 +33,7 @@ class SignupUserCommandHandler 'level' => User::LEVEL_USER, ]); - event(new UserWasAddedEvent($user)); + event(new UserWasCreatedEvent($user)); return $user; } diff --git a/app/Foundation/Providers/EventServiceProvider.php b/app/Foundation/Providers/EventServiceProvider.php index fed96eec..ac289226 100644 --- a/app/Foundation/Providers/EventServiceProvider.php +++ b/app/Foundation/Providers/EventServiceProvider.php @@ -30,7 +30,7 @@ class EventServiceProvider extends ServiceProvider 'CachetHQ\Cachet\Bus\Events\Beacon\BeaconWasSentEvent' => [ // ], - 'CachetHQ\Cachet\Bus\Events\ComponentGroup\ComponentGroupWasAddedEvent' => [ + 'CachetHQ\Cachet\Bus\Events\ComponentGroup\ComponentGroupWasCreatedEvent' => [ // ], 'CachetHQ\Cachet\Bus\Events\ComponentGroup\ComponentGroupWasRemovedEvent' => [ @@ -42,7 +42,7 @@ class EventServiceProvider extends ServiceProvider 'CachetHQ\Cachet\Bus\Events\Component\ComponentStatusWasChangedEvent' => [ 'CachetHQ\Cachet\Bus\Handlers\Events\Component\SendComponentUpdateEmailNotificationHandler', ], - 'CachetHQ\Cachet\Bus\Events\Component\ComponentWasAddedEvent' => [ + 'CachetHQ\Cachet\Bus\Events\Component\ComponentWasCreatedEvent' => [ // ], 'CachetHQ\Cachet\Bus\Events\Component\ComponentWasRemovedEvent' => [ @@ -75,7 +75,7 @@ class EventServiceProvider extends ServiceProvider 'CachetHQ\Cachet\Bus\Events\Invite\InviteWasClaimedEvent' => [ // ], - 'CachetHQ\Cachet\Bus\Events\Metric\MetricPointWasAddedEvent' => [ + 'CachetHQ\Cachet\Bus\Events\Metric\MetricPointWasCreatedEvent' => [ // ], 'CachetHQ\Cachet\Bus\Events\Metric\MetricPointWasRemovedEvent' => [ @@ -84,7 +84,7 @@ class EventServiceProvider extends ServiceProvider 'CachetHQ\Cachet\Bus\Events\Metric\MetricPointWasUpdatedEvent' => [ // ], - 'CachetHQ\Cachet\Bus\Events\Metric\MetricWasAddedEvent' => [ + 'CachetHQ\Cachet\Bus\Events\Metric\MetricWasCreatedEvent' => [ // ], 'CachetHQ\Cachet\Bus\Events\Metric\MetricWasRemovedEvent' => [ @@ -150,7 +150,7 @@ class EventServiceProvider extends ServiceProvider 'CachetHQ\Cachet\Bus\Events\User\UserRegeneratedApiTokenEvent' => [ // ], - 'CachetHQ\Cachet\Bus\Events\User\UserWasAddedEvent' => [ + 'CachetHQ\Cachet\Bus\Events\User\UserWasCreatedEvent' => [ // ], 'CachetHQ\Cachet\Bus\Events\User\UserWasInvitedEvent' => [ diff --git a/app/Http/Controllers/Api/ComponentController.php b/app/Http/Controllers/Api/ComponentController.php index cfb91730..de811f3b 100644 --- a/app/Http/Controllers/Api/ComponentController.php +++ b/app/Http/Controllers/Api/ComponentController.php @@ -11,7 +11,7 @@ namespace CachetHQ\Cachet\Http\Controllers\Api; -use CachetHQ\Cachet\Bus\Commands\Component\AddComponentCommand; +use CachetHQ\Cachet\Bus\Commands\Component\CreateComponentCommand; use CachetHQ\Cachet\Bus\Commands\Component\RemoveComponentCommand; use CachetHQ\Cachet\Bus\Commands\Component\UpdateComponentCommand; use CachetHQ\Cachet\Models\Component; @@ -70,7 +70,7 @@ class ComponentController extends AbstractApiController public function postComponents() { try { - $component = dispatch(new AddComponentCommand( + $component = dispatch(new CreateComponentCommand( Binput::get('name'), Binput::get('description'), Binput::get('status'), diff --git a/app/Http/Controllers/Api/ComponentGroupController.php b/app/Http/Controllers/Api/ComponentGroupController.php index 796eab69..38f54767 100644 --- a/app/Http/Controllers/Api/ComponentGroupController.php +++ b/app/Http/Controllers/Api/ComponentGroupController.php @@ -11,7 +11,7 @@ namespace CachetHQ\Cachet\Http\Controllers\Api; -use CachetHQ\Cachet\Bus\Commands\ComponentGroup\AddComponentGroupCommand; +use CachetHQ\Cachet\Bus\Commands\ComponentGroup\CreateComponentGroupCommand; use CachetHQ\Cachet\Bus\Commands\ComponentGroup\RemoveComponentGroupCommand; use CachetHQ\Cachet\Bus\Commands\ComponentGroup\UpdateComponentGroupCommand; use CachetHQ\Cachet\Models\ComponentGroup; @@ -92,7 +92,7 @@ class ComponentGroupController extends AbstractApiController public function postGroups() { try { - $group = dispatch(new AddComponentGroupCommand( + $group = dispatch(new CreateComponentGroupCommand( Binput::get('name'), Binput::get('order', 0), Binput::get('collapsed', 0), diff --git a/app/Http/Controllers/Api/MetricController.php b/app/Http/Controllers/Api/MetricController.php index ddb11f00..39d6fc20 100644 --- a/app/Http/Controllers/Api/MetricController.php +++ b/app/Http/Controllers/Api/MetricController.php @@ -11,7 +11,7 @@ namespace CachetHQ\Cachet\Http\Controllers\Api; -use CachetHQ\Cachet\Bus\Commands\Metric\AddMetricCommand; +use CachetHQ\Cachet\Bus\Commands\Metric\CreateMetricCommand; use CachetHQ\Cachet\Bus\Commands\Metric\RemoveMetricCommand; use CachetHQ\Cachet\Bus\Commands\Metric\UpdateMetricCommand; use CachetHQ\Cachet\Models\Metric; @@ -76,7 +76,7 @@ class MetricController extends AbstractApiController public function postMetrics() { try { - $metric = dispatch(new AddMetricCommand( + $metric = dispatch(new CreateMetricCommand( Binput::get('name'), Binput::get('suffix'), Binput::get('description'), diff --git a/app/Http/Controllers/Api/MetricPointController.php b/app/Http/Controllers/Api/MetricPointController.php index a84758d9..09ddff66 100644 --- a/app/Http/Controllers/Api/MetricPointController.php +++ b/app/Http/Controllers/Api/MetricPointController.php @@ -11,7 +11,7 @@ namespace CachetHQ\Cachet\Http\Controllers\Api; -use CachetHQ\Cachet\Bus\Commands\Metric\AddMetricPointCommand; +use CachetHQ\Cachet\Bus\Commands\Metric\CreateMetricPointCommand; use CachetHQ\Cachet\Bus\Commands\Metric\RemoveMetricPointCommand; use CachetHQ\Cachet\Bus\Commands\Metric\UpdateMetricPointCommand; use CachetHQ\Cachet\Models\Metric; @@ -45,7 +45,7 @@ class MetricPointController extends AbstractApiController public function postMetricPoints(Metric $metric) { try { - $metricPoint = dispatch(new AddMetricPointCommand( + $metricPoint = dispatch(new CreateMetricPointCommand( $metric, Binput::get('value'), Binput::get('timestamp') diff --git a/app/Http/Controllers/Dashboard/ComponentController.php b/app/Http/Controllers/Dashboard/ComponentController.php index 4aefe335..dd991db1 100644 --- a/app/Http/Controllers/Dashboard/ComponentController.php +++ b/app/Http/Controllers/Dashboard/ComponentController.php @@ -12,10 +12,10 @@ namespace CachetHQ\Cachet\Http\Controllers\Dashboard; use AltThree\Validator\ValidationException; -use CachetHQ\Cachet\Bus\Commands\Component\AddComponentCommand; +use CachetHQ\Cachet\Bus\Commands\Component\CreateComponentCommand; use CachetHQ\Cachet\Bus\Commands\Component\RemoveComponentCommand; use CachetHQ\Cachet\Bus\Commands\Component\UpdateComponentCommand; -use CachetHQ\Cachet\Bus\Commands\ComponentGroup\AddComponentGroupCommand; +use CachetHQ\Cachet\Bus\Commands\ComponentGroup\CreateComponentGroupCommand; use CachetHQ\Cachet\Bus\Commands\ComponentGroup\RemoveComponentGroupCommand; use CachetHQ\Cachet\Bus\Commands\ComponentGroup\UpdateComponentGroupCommand; use CachetHQ\Cachet\Models\Component; @@ -182,7 +182,7 @@ class ComponentController extends Controller $tags = array_pull($componentData, 'tags'); try { - $component = dispatch(new AddComponentCommand( + $component = dispatch(new CreateComponentCommand( $componentData['name'], $componentData['description'], $componentData['status'], @@ -276,7 +276,7 @@ class ComponentController extends Controller public function postAddComponentGroup() { try { - $group = dispatch(new AddComponentGroupCommand( + $group = dispatch(new CreateComponentGroupCommand( Binput::get('name'), Binput::get('order', 0), Binput::get('collapsed'), diff --git a/app/Http/Controllers/Dashboard/MetricController.php b/app/Http/Controllers/Dashboard/MetricController.php index dd3da8f7..d87fb436 100644 --- a/app/Http/Controllers/Dashboard/MetricController.php +++ b/app/Http/Controllers/Dashboard/MetricController.php @@ -12,7 +12,7 @@ namespace CachetHQ\Cachet\Http\Controllers\Dashboard; use AltThree\Validator\ValidationException; -use CachetHQ\Cachet\Bus\Commands\Metric\AddMetricCommand; +use CachetHQ\Cachet\Bus\Commands\Metric\CreateMetricCommand; use CachetHQ\Cachet\Bus\Commands\Metric\RemoveMetricCommand; use CachetHQ\Cachet\Bus\Commands\Metric\UpdateMetricCommand; use CachetHQ\Cachet\Models\Metric; @@ -70,7 +70,7 @@ class MetricController extends Controller $metricData = Binput::get('metric'); try { - dispatch(new AddMetricCommand( + dispatch(new CreateMetricCommand( $metricData['name'], $metricData['suffix'], $metricData['description'], diff --git a/app/Http/Controllers/Dashboard/TeamController.php b/app/Http/Controllers/Dashboard/TeamController.php index 152f0971..6e0d112b 100644 --- a/app/Http/Controllers/Dashboard/TeamController.php +++ b/app/Http/Controllers/Dashboard/TeamController.php @@ -12,7 +12,7 @@ namespace CachetHQ\Cachet\Http\Controllers\Dashboard; use AltThree\Validator\ValidationException; -use CachetHQ\Cachet\Bus\Commands\User\AddUserCommand; +use CachetHQ\Cachet\Bus\Commands\User\CreateUserCommand; use CachetHQ\Cachet\Bus\Commands\User\InviteUserCommand; use CachetHQ\Cachet\Bus\Commands\User\RemoveUserCommand; use CachetHQ\Cachet\Models\User; @@ -80,7 +80,7 @@ class TeamController extends Controller public function postAddUser() { try { - dispatch(new AddUserCommand( + dispatch(new CreateUserCommand( Binput::get('username'), Binput::get('password'), Binput::get('email'), diff --git a/tests/Bus/Commands/Component/AddComponentCommandTest.php b/tests/Bus/Commands/Component/CreateComponentCommandTest.php similarity index 78% rename from tests/Bus/Commands/Component/AddComponentCommandTest.php rename to tests/Bus/Commands/Component/CreateComponentCommandTest.php index 851b9688..454beeb5 100644 --- a/tests/Bus/Commands/Component/AddComponentCommandTest.php +++ b/tests/Bus/Commands/Component/CreateComponentCommandTest.php @@ -12,17 +12,17 @@ namespace CachetHQ\Tests\Cachet\Bus\Commands\Component; use AltThree\TestBench\CommandTrait; -use CachetHQ\Cachet\Bus\Commands\Component\AddComponentCommand; -use CachetHQ\Cachet\Bus\Handlers\Commands\Component\AddComponentCommandHandler; +use CachetHQ\Cachet\Bus\Commands\Component\CreateComponentCommand; +use CachetHQ\Cachet\Bus\Handlers\Commands\Component\CreateComponentCommandHandler; use CachetHQ\Tests\Cachet\AbstractTestCase; /** - * This is the add component command test class. + * This is the create component command test class. * * @author James Brooks * @author Graham Campbell */ -class AddComponentCommandTest extends AbstractTestCase +class CreateComponentCommandTest extends AbstractTestCase { use CommandTrait; @@ -38,7 +38,7 @@ class AddComponentCommandTest extends AbstractTestCase 'enabled' => true, 'meta' => null, ]; - $object = new AddComponentCommand( + $object = new CreateComponentCommand( $params['name'], $params['description'], $params['status'], @@ -59,6 +59,6 @@ class AddComponentCommandTest extends AbstractTestCase protected function getHandlerClass() { - return AddComponentCommandHandler::class; + return CreateComponentCommandHandler::class; } } diff --git a/tests/Bus/Commands/ComponentGroup/AddComponentGroupCommandTest.php b/tests/Bus/Commands/ComponentGroup/CreateComponentGroupCommandTest.php similarity index 73% rename from tests/Bus/Commands/ComponentGroup/AddComponentGroupCommandTest.php rename to tests/Bus/Commands/ComponentGroup/CreateComponentGroupCommandTest.php index 7bf7bcdb..5a456095 100644 --- a/tests/Bus/Commands/ComponentGroup/AddComponentGroupCommandTest.php +++ b/tests/Bus/Commands/ComponentGroup/CreateComponentGroupCommandTest.php @@ -12,18 +12,18 @@ namespace CachetHQ\Tests\Cachet\Bus\Commands\ComponentGroup; use AltThree\TestBench\CommandTrait; -use CachetHQ\Cachet\Bus\Commands\ComponentGroup\AddComponentGroupCommand; -use CachetHQ\Cachet\Bus\Handlers\Commands\ComponentGroup\AddComponentGroupCommandHandler; +use CachetHQ\Cachet\Bus\Commands\ComponentGroup\CreateComponentGroupCommand; +use CachetHQ\Cachet\Bus\Handlers\Commands\ComponentGroup\CreateComponentGroupCommandHandler; use CachetHQ\Cachet\Models\ComponentGroup; use CachetHQ\Tests\Cachet\AbstractTestCase; /** - * This is the add component group command test class. + * This is the create component group command test class. * * @author James Brooks * @author Graham Campbell */ -class AddComponentGroupCommandTest extends AbstractTestCase +class CreateComponentGroupCommandTest extends AbstractTestCase { use CommandTrait; @@ -36,7 +36,7 @@ class AddComponentGroupCommandTest extends AbstractTestCase 'visible' => ComponentGroup::VISIBLE_AUTHENTICATED, ]; - $object = new AddComponentGroupCommand( + $object = new CreateComponentGroupCommand( $params['name'], $params['order'], $params['collapsed'], @@ -53,6 +53,6 @@ class AddComponentGroupCommandTest extends AbstractTestCase protected function getHandlerClass() { - return AddComponentGroupCommandHandler::class; + return CreateComponentGroupCommandHandler::class; } } diff --git a/tests/Bus/Commands/Metric/AddMetricCommandTest.php b/tests/Bus/Commands/Metric/CreateMetricCommandTest.php similarity index 82% rename from tests/Bus/Commands/Metric/AddMetricCommandTest.php rename to tests/Bus/Commands/Metric/CreateMetricCommandTest.php index 881ba08d..7595f54b 100644 --- a/tests/Bus/Commands/Metric/AddMetricCommandTest.php +++ b/tests/Bus/Commands/Metric/CreateMetricCommandTest.php @@ -12,17 +12,17 @@ namespace CachetHQ\Tests\Cachet\Bus\Commands\Metric; use AltThree\TestBench\CommandTrait; -use CachetHQ\Cachet\Bus\Commands\Metric\AddMetricCommand; -use CachetHQ\Cachet\Bus\Handlers\Commands\Metric\AddMetricCommandHandler; +use CachetHQ\Cachet\Bus\Commands\Metric\CreateMetricCommand; +use CachetHQ\Cachet\Bus\Handlers\Commands\Metric\CreateMetricCommandHandler; use CachetHQ\Tests\Cachet\AbstractTestCase; /** - * This is the add metric command test class. + * This is the create metric command test class. * * @author James Brooks * @author Graham Campbell */ -class AddMetricCommandTest extends AbstractTestCase +class CreateMetricCommandTest extends AbstractTestCase { use CommandTrait; @@ -42,7 +42,7 @@ class AddMetricCommandTest extends AbstractTestCase 'visible' => 1, ]; - $object = new AddMetricCommand( + $object = new CreateMetricCommand( $params['name'], $params['suffix'], $params['description'], @@ -66,6 +66,6 @@ class AddMetricCommandTest extends AbstractTestCase protected function getHandlerClass() { - return AddMetricCommandHandler::class; + return CreateMetricCommandHandler::class; } } diff --git a/tests/Bus/Commands/Metric/AddMetricPointCommandTest.php b/tests/Bus/Commands/Metric/CreateMetricPointCommandTest.php similarity index 66% rename from tests/Bus/Commands/Metric/AddMetricPointCommandTest.php rename to tests/Bus/Commands/Metric/CreateMetricPointCommandTest.php index 77c08e9e..c2aa8ba7 100644 --- a/tests/Bus/Commands/Metric/AddMetricPointCommandTest.php +++ b/tests/Bus/Commands/Metric/CreateMetricPointCommandTest.php @@ -12,25 +12,25 @@ namespace CachetHQ\Tests\Cachet\Bus\Commands\Metric; use AltThree\TestBench\CommandTrait; -use CachetHQ\Cachet\Bus\Commands\Metric\AddMetricPointCommand; -use CachetHQ\Cachet\Bus\Handlers\Commands\Metric\AddMetricPointCommandHandler; +use CachetHQ\Cachet\Bus\Commands\Metric\CreateMetricPointCommand; +use CachetHQ\Cachet\Bus\Handlers\Commands\Metric\CreateMetricPointCommandHandler; use CachetHQ\Cachet\Models\Metric; use CachetHQ\Tests\Cachet\AbstractTestCase; /** - * This is the add metric point command test class. + * This is the create metric point command test class. * * @author James Brooks * @author Graham Campbell */ -class AddMetricPointCommandTest extends AbstractTestCase +class CreateMetricPointCommandTest extends AbstractTestCase { use CommandTrait; protected function getObjectAndParams() { $params = ['metric' => new Metric(), 'value' => 1, 'created_at' => '2020-12-30 12:00:00']; - $object = new AddMetricPointCommand($params['metric'], $params['value'], $params['created_at']); + $object = new CreateMetricPointCommand($params['metric'], $params['value'], $params['created_at']); return compact('params', 'object'); } @@ -42,6 +42,6 @@ class AddMetricPointCommandTest extends AbstractTestCase protected function getHandlerClass() { - return AddMetricPointCommandHandler::class; + return CreateMetricPointCommandHandler::class; } } diff --git a/tests/Bus/Commands/User/AddUserCommandTest.php b/tests/Bus/Commands/User/AddUserCommandTest.php index 83ee9e7e..336394da 100644 --- a/tests/Bus/Commands/User/AddUserCommandTest.php +++ b/tests/Bus/Commands/User/AddUserCommandTest.php @@ -12,8 +12,8 @@ namespace CachetHQ\Tests\Cachet\Bus\Commands\User; use AltThree\TestBench\CommandTrait; -use CachetHQ\Cachet\Bus\Commands\User\AddUserCommand; -use CachetHQ\Cachet\Bus\Handlers\Commands\User\AddUserCommandHandler; +use CachetHQ\Cachet\Bus\Commands\User\CreateUserCommand; +use CachetHQ\Cachet\Bus\Handlers\Commands\User\CreateUserCommandHandler; use CachetHQ\Tests\Cachet\AbstractTestCase; /** @@ -22,7 +22,7 @@ use CachetHQ\Tests\Cachet\AbstractTestCase; * @author James Brooks * @author Graham Campbell */ -class AddUserCommandTest extends AbstractTestCase +class CreateUserCommandTest extends AbstractTestCase { use CommandTrait; @@ -35,7 +35,7 @@ class AddUserCommandTest extends AbstractTestCase 'level' => 1, ]; - $object = new AddUserCommand( + $object = new CreateUserCommand( $params['username'], $params['password'], $params['email'], @@ -52,6 +52,6 @@ class AddUserCommandTest extends AbstractTestCase protected function getHandlerClass() { - return AddUserCommandHandler::class; + return CreateUserCommandHandler::class; } } diff --git a/tests/Bus/Events/Component/ComponentWasAddedEventTest.php b/tests/Bus/Events/Component/ComponentWasAddedEventTest.php index ac9c9857..532f09c2 100644 --- a/tests/Bus/Events/Component/ComponentWasAddedEventTest.php +++ b/tests/Bus/Events/Component/ComponentWasAddedEventTest.php @@ -11,11 +11,11 @@ namespace CachetHQ\Tests\Cachet\Bus\Events\Component; -use CachetHQ\Cachet\Bus\Events\Component\ComponentWasAddedEvent; +use CachetHQ\Cachet\Bus\Events\Component\ComponentWasCreatedEvent; use CachetHQ\Cachet\Models\Component; use CachetHQ\Cachet\Models\User; -class ComponentWasAddedEventTest extends AbstractComponentEventTestCase +class ComponentWasCreatedEventTest extends AbstractComponentEventTestCase { protected function objectHasHandlers() { @@ -25,7 +25,7 @@ class ComponentWasAddedEventTest extends AbstractComponentEventTestCase protected function getObjectAndParams() { $params = ['user' => new User(), 'component' => new Component()]; - $object = new ComponentWasAddedEvent($params['user'], $params['component']); + $object = new ComponentWasCreatedEvent($params['user'], $params['component']); return compact('params', 'object'); } diff --git a/tests/Bus/Events/ComponentGroup/ComponentGroupWasAddedEventTest.php b/tests/Bus/Events/ComponentGroup/ComponentGroupWasAddedEventTest.php index c8a01f89..a0bedb11 100644 --- a/tests/Bus/Events/ComponentGroup/ComponentGroupWasAddedEventTest.php +++ b/tests/Bus/Events/ComponentGroup/ComponentGroupWasAddedEventTest.php @@ -11,11 +11,11 @@ namespace CachetHQ\Tests\Cachet\Bus\Events\ComponentGroup; -use CachetHQ\Cachet\Bus\Events\ComponentGroup\ComponentGroupWasAddedEvent; +use CachetHQ\Cachet\Bus\Events\ComponentGroup\ComponentGroupWasCreatedEvent; use CachetHQ\Cachet\Models\ComponentGroup; use CachetHQ\Cachet\Models\User; -class ComponentGroupWasAddedEventTest extends AbstractComponentGroupEventTestCase +class ComponentGroupWasCreatedEventTest extends AbstractComponentGroupEventTestCase { protected function objectHasHandlers() { @@ -25,7 +25,7 @@ class ComponentGroupWasAddedEventTest extends AbstractComponentGroupEventTestCas protected function getObjectAndParams() { $params = ['user' => new User(), 'group' => new ComponentGroup()]; - $object = new ComponentGroupWasAddedEvent($params['user'], $params['group']); + $object = new ComponentGroupWasCreatedEvent($params['user'], $params['group']); return compact('params', 'object'); } diff --git a/tests/Bus/Events/Metric/MetricPointWasAddedEventTest.php b/tests/Bus/Events/Metric/MetricPointWasAddedEventTest.php index 770da8da..df7ec505 100644 --- a/tests/Bus/Events/Metric/MetricPointWasAddedEventTest.php +++ b/tests/Bus/Events/Metric/MetricPointWasAddedEventTest.php @@ -11,7 +11,7 @@ namespace CachetHQ\Tests\Cachet\Bus\Events\Metric; -use CachetHQ\Cachet\Bus\Events\Metric\MetricPointWasAddedEvent; +use CachetHQ\Cachet\Bus\Events\Metric\MetricPointWasCreatedEvent; use CachetHQ\Cachet\Models\MetricPoint; use CachetHQ\Cachet\Models\User; @@ -20,7 +20,7 @@ use CachetHQ\Cachet\Models\User; * * @author James Brooks */ -class MetricPointWasAddedEventTest extends AbstractMetricEventTestCase +class MetricPointWasCreatedEventTest extends AbstractMetricEventTestCase { protected function objectHasHandlers() { @@ -30,7 +30,7 @@ class MetricPointWasAddedEventTest extends AbstractMetricEventTestCase protected function getObjectAndParams() { $params = ['user' => new User(), 'metricPoint' => new MetricPoint()]; - $object = new MetricPointWasAddedEvent($params['user'], $params['metricPoint']); + $object = new MetricPointWasCreatedEvent($params['user'], $params['metricPoint']); return compact('params', 'object'); } diff --git a/tests/Bus/Events/Metric/MetricWasAddedEventTest.php b/tests/Bus/Events/Metric/MetricWasAddedEventTest.php index 65b18a74..2f81383f 100644 --- a/tests/Bus/Events/Metric/MetricWasAddedEventTest.php +++ b/tests/Bus/Events/Metric/MetricWasAddedEventTest.php @@ -11,11 +11,11 @@ namespace CachetHQ\Tests\Cachet\Bus\Events\Metric; -use CachetHQ\Cachet\Bus\Events\Metric\MetricWasAddedEvent; +use CachetHQ\Cachet\Bus\Events\Metric\MetricWasCreatedEvent; use CachetHQ\Cachet\Models\Metric; use CachetHQ\Cachet\Models\User; -class MetricWasAddedEventTest extends AbstractMetricEventTestCase +class MetricWasCreatedEventTest extends AbstractMetricEventTestCase { protected function objectHasHandlers() { @@ -25,7 +25,7 @@ class MetricWasAddedEventTest extends AbstractMetricEventTestCase protected function getObjectAndParams() { $params = ['user' => new User(), 'metric' => new Metric()]; - $object = new MetricWasAddedEvent($params['user'], $params['metric']); + $object = new MetricWasCreatedEvent($params['user'], $params['metric']); return compact('params', 'object'); } diff --git a/tests/Bus/Events/User/UserWasAddedEventTest.php b/tests/Bus/Events/User/UserWasAddedEventTest.php index 0a9340cb..3c231813 100644 --- a/tests/Bus/Events/User/UserWasAddedEventTest.php +++ b/tests/Bus/Events/User/UserWasAddedEventTest.php @@ -11,7 +11,7 @@ namespace CachetHQ\Tests\Cachet\Bus\Events\User; -use CachetHQ\Cachet\Bus\Events\User\UserWasAddedEvent; +use CachetHQ\Cachet\Bus\Events\User\UserWasCreatedEvent; use CachetHQ\Cachet\Models\User; /** @@ -19,7 +19,7 @@ use CachetHQ\Cachet\Models\User; * * @author Graham Campbell */ -class UserWasAddedEventTest extends AbstractUserEventTestCase +class UserWasCreatedEventTest extends AbstractUserEventTestCase { protected function objectHasHandlers() { @@ -29,7 +29,7 @@ class UserWasAddedEventTest extends AbstractUserEventTestCase protected function getObjectAndParams() { $params = ['user' => new User()]; - $object = new UserWasAddedEvent($params['user']); + $object = new UserWasCreatedEvent($params['user']); return compact('params', 'object'); }