Merge pull request #2439 from CachetHQ/cleanup-event-names
Cleanup event names
This commit is contained in:
@@ -11,7 +11,12 @@
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Commands\Component;
|
||||
|
||||
final class AddComponentCommand
|
||||
/**
|
||||
* This is the create component command class.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
final class CreateComponentCommand
|
||||
{
|
||||
/**
|
||||
* The component name.
|
||||
@@ -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 <james@alt-three.com>
|
||||
*/
|
||||
final class AddComponentGroupCommand
|
||||
final class CreateComponentGroupCommand
|
||||
{
|
||||
/**
|
||||
* The component group name.
|
||||
@@ -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 <joe@alt-three.com>
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
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
|
||||
@@ -19,7 +19,7 @@ use CachetHQ\Cachet\Models\User;
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
final class ReportIncidentUpdateCommand
|
||||
final class CreateIncidentUpdateCommand
|
||||
{
|
||||
/**
|
||||
* The incident.
|
||||
@@ -11,7 +11,13 @@
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Commands\Metric;
|
||||
|
||||
final class AddMetricCommand
|
||||
/**
|
||||
* This is the create metric command class.
|
||||
*
|
||||
* @author Joseph Cohen <joe@alt-three.com>
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
final class CreateMetricCommand
|
||||
{
|
||||
/**
|
||||
* The metric name.
|
||||
@@ -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 <joe@alt-three.com>
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
final class CreateMetricPointCommand
|
||||
{
|
||||
/**
|
||||
* The metric to add.
|
||||
@@ -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 <james@alt-three.com>
|
||||
*/
|
||||
final class AddUserCommand
|
||||
final class CreateUserCommand
|
||||
{
|
||||
/**
|
||||
* The user username.
|
||||
@@ -16,21 +16,21 @@ use CachetHQ\Cachet\Models\Component;
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
|
||||
/**
|
||||
* This is the component status was updated event.
|
||||
* This is the component status was changed event.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
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 @@ final class ComponentStatusWasUpdatedEvent implements ActionInterface, Component
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return 'Component status was updated.';
|
||||
return 'Component status was changed.';
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -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 <james@alt-three.com>
|
||||
*/
|
||||
final class ComponentWasCreatedEvent implements ActionInterface, ComponentEventInterface
|
||||
{
|
||||
/**
|
||||
* The user who added the component.
|
||||
@@ -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 <james@alt-three.com>
|
||||
*/
|
||||
final class ComponentGroupWasCreatedEvent implements ActionInterface, ComponentGroupEventInterface
|
||||
{
|
||||
/**
|
||||
* The user who added the component group.
|
||||
@@ -15,7 +15,7 @@ use CachetHQ\Cachet\Bus\Events\ActionInterface;
|
||||
use CachetHQ\Cachet\Models\Incident;
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
|
||||
final class IncidentWasReportedEvent implements ActionInterface, IncidentEventInterface
|
||||
final class IncidentWasCreatedEvent implements ActionInterface, IncidentEventInterface
|
||||
{
|
||||
/**
|
||||
* The user who reported the event.
|
||||
@@ -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 <james@alt-three.com>
|
||||
*/
|
||||
final class MetricPointWasCreatedEvent implements ActionInterface, MetricEventInterface
|
||||
{
|
||||
/**
|
||||
* The user who added the metric point.
|
||||
@@ -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 <james@alt-three.com>
|
||||
*/
|
||||
final class MetricWasCreatedEvent implements ActionInterface, MetricEventInterface
|
||||
{
|
||||
/**
|
||||
* The user who added the metric.
|
||||
@@ -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 <james@alt-three.com>
|
||||
*/
|
||||
final class UserWasCreatedEvent implements ActionInterface, UserEventInterface
|
||||
{
|
||||
/**
|
||||
* The user that has been added.
|
||||
@@ -42,7 +47,7 @@ final class UserWasAddedEvent implements ActionInterface, UserEventInterface
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return 'User was added.';
|
||||
return 'User was created.';
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -23,7 +23,7 @@ use CachetHQ\Cachet\Models\Invite;
|
||||
final class UserWasInvitedEvent implements UserEventInterface
|
||||
{
|
||||
/**
|
||||
* The invite that has been added.
|
||||
* The invite that has been created.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\Invite
|
||||
*/
|
||||
|
||||
@@ -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 <james@alt-three.com>
|
||||
*/
|
||||
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,
|
||||
@@ -12,7 +12,7 @@
|
||||
namespace CachetHQ\Cachet\Bus\Handlers\Commands\Component;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Commands\Component\UpdateComponentCommand;
|
||||
use CachetHQ\Cachet\Bus\Events\Component\ComponentStatusWasUpdatedEvent;
|
||||
use CachetHQ\Cachet\Bus\Events\Component\ComponentStatusWasChangedEvent;
|
||||
use CachetHQ\Cachet\Bus\Events\Component\ComponentWasUpdatedEvent;
|
||||
use CachetHQ\Cachet\Models\Component;
|
||||
use Illuminate\Contracts\Auth\Guard;
|
||||
@@ -50,7 +50,7 @@ class UpdateComponentCommandHandler
|
||||
$component = $command->component;
|
||||
$originalStatus = $component->status;
|
||||
|
||||
event(new ComponentStatusWasUpdatedEvent($this->auth->user(), $component, $originalStatus, $command->status, $command->silent));
|
||||
event(new ComponentStatusWasChangedEvent($this->auth->user(), $component, $originalStatus, $command->status, $command->silent));
|
||||
|
||||
$component->update($this->filter($command));
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
@@ -12,8 +12,8 @@
|
||||
namespace CachetHQ\Cachet\Bus\Handlers\Commands\Incident;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Commands\Component\UpdateComponentCommand;
|
||||
use CachetHQ\Cachet\Bus\Commands\Incident\ReportIncidentCommand;
|
||||
use CachetHQ\Cachet\Bus\Events\Incident\IncidentWasReportedEvent;
|
||||
use CachetHQ\Cachet\Bus\Commands\Incident\CreateIncidentCommand;
|
||||
use CachetHQ\Cachet\Bus\Events\Incident\IncidentWasCreatedEvent;
|
||||
use CachetHQ\Cachet\Bus\Exceptions\Incident\InvalidIncidentTimestampException;
|
||||
use CachetHQ\Cachet\Models\Component;
|
||||
use CachetHQ\Cachet\Models\Incident;
|
||||
@@ -25,11 +25,11 @@ use Twig_Environment;
|
||||
use Twig_Loader_Array;
|
||||
|
||||
/**
|
||||
* This is the report incident command handler.
|
||||
* This is the create incident command handler.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
class ReportIncidentCommandHandler
|
||||
class CreateIncidentCommandHandler
|
||||
{
|
||||
/**
|
||||
* The authentication guard instance.
|
||||
@@ -46,7 +46,7 @@ class ReportIncidentCommandHandler
|
||||
protected $dates;
|
||||
|
||||
/**
|
||||
* Create a new report incident command handler instance.
|
||||
* Create a new create incident command handler instance.
|
||||
*
|
||||
* @param \Illuminate\Contracts\Auth\Guard $auth
|
||||
* @param \CachetHQ\Cachet\Services\Dates\DateFactory $dates
|
||||
@@ -60,13 +60,13 @@ class ReportIncidentCommandHandler
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle the report incident command.
|
||||
* Handle the create incident command.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Bus\Commands\Incident\ReportIncidentCommand $command
|
||||
* @param \CachetHQ\Cachet\Bus\Commands\Incident\CreateIncidentCommand $command
|
||||
*
|
||||
* @return \CachetHQ\Cachet\Models\Incident
|
||||
*/
|
||||
public function handle(ReportIncidentCommand $command)
|
||||
public function handle(CreateIncidentCommand $command)
|
||||
{
|
||||
$data = [
|
||||
'name' => $command->name,
|
||||
@@ -116,7 +116,7 @@ class ReportIncidentCommandHandler
|
||||
));
|
||||
}
|
||||
|
||||
event(new IncidentWasReportedEvent($this->auth->user(), $incident, (bool) $command->notify));
|
||||
event(new IncidentWasCreatedEvent($this->auth->user(), $incident, (bool) $command->notify));
|
||||
|
||||
return $incident;
|
||||
}
|
||||
@@ -125,11 +125,11 @@ class ReportIncidentCommandHandler
|
||||
* Compiles an incident template into an incident message.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\IncidentTemplate $template
|
||||
* @param \CachetHQ\Cachet\Bus\Commands\Incident\ReportIncidentCommand $command
|
||||
* @param \CachetHQ\Cachet\Bus\Commands\Incident\CreateIncidentCommand $command
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function parseTemplate(IncidentTemplate $template, ReportIncidentCommand $command)
|
||||
protected function parseTemplate(IncidentTemplate $template, CreateIncidentCommand $command)
|
||||
{
|
||||
$env = new Twig_Environment(new Twig_Loader_Array([]));
|
||||
$template = $env->createTemplate($template->template);
|
||||
@@ -12,7 +12,7 @@
|
||||
namespace CachetHQ\Cachet\Bus\Handlers\Commands\IncidentUpdate;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Commands\Incident\UpdateIncidentCommand;
|
||||
use CachetHQ\Cachet\Bus\Commands\IncidentUpdate\ReportIncidentUpdateCommand;
|
||||
use CachetHQ\Cachet\Bus\Commands\IncidentUpdate\CreateIncidentUpdateCommand;
|
||||
use CachetHQ\Cachet\Bus\Events\IncidentUpdate\IncidentUpdateWasReportedEvent;
|
||||
use CachetHQ\Cachet\Models\IncidentUpdate;
|
||||
use Illuminate\Contracts\Auth\Guard;
|
||||
@@ -22,7 +22,7 @@ use Illuminate\Contracts\Auth\Guard;
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
class ReportIncidentUpdateCommandHandler
|
||||
class CreateIncidentUpdateCommandHandler
|
||||
{
|
||||
/**
|
||||
* The authentication guard instance.
|
||||
@@ -46,11 +46,11 @@ class ReportIncidentUpdateCommandHandler
|
||||
/**
|
||||
* Handle the report incident command.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Bus\Commands\IncidentUpdate\ReportIncidentUpdateCommand $command
|
||||
* @param \CachetHQ\Cachet\Bus\Commands\IncidentUpdate\CreateIncidentUpdateCommand $command
|
||||
*
|
||||
* @return \CachetHQ\Cachet\Models\IncidentUpdate
|
||||
*/
|
||||
public function handle(ReportIncidentUpdateCommand $command)
|
||||
public function handle(CreateIncidentUpdateCommand $command)
|
||||
{
|
||||
$data = [
|
||||
'incident_id' => $command->incident->id,
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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);
|
||||
|
||||
@@ -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 <james@alt-three.com>
|
||||
*/
|
||||
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;
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Handlers\Events\Component;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\Component\ComponentStatusWasUpdatedEvent;
|
||||
use CachetHQ\Cachet\Bus\Events\Component\ComponentStatusWasChangedEvent;
|
||||
use CachetHQ\Cachet\Models\Component;
|
||||
use CachetHQ\Cachet\Models\Subscriber;
|
||||
use CachetHQ\Cachet\Notifications\Component\ComponentStatusChangedNotification;
|
||||
@@ -40,11 +40,11 @@ class SendComponentUpdateEmailNotificationHandler
|
||||
/**
|
||||
* Handle the event.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Bus\Events\Component\ComponentStatusWasUpdatedEvent $event
|
||||
* @param \CachetHQ\Cachet\Bus\Events\Component\ComponentStatusWasChangedEvent $event
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function handle(ComponentStatusWasUpdatedEvent $event)
|
||||
public function handle(ComponentStatusWasChangedEvent $event)
|
||||
{
|
||||
$component = $event->component;
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Handlers\Events\Incident;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\Incident\IncidentWasReportedEvent;
|
||||
use CachetHQ\Cachet\Bus\Events\Incident\IncidentWasCreatedEvent;
|
||||
use CachetHQ\Cachet\Models\Subscriber;
|
||||
use CachetHQ\Cachet\Notifications\Incident\NewIncidentNotification;
|
||||
|
||||
@@ -39,11 +39,11 @@ class SendIncidentEmailNotificationHandler
|
||||
/**
|
||||
* Handle the event.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Bus\Events\Incident\IncidentWasReportedEvent $event
|
||||
* @param \CachetHQ\Cachet\Bus\Events\Incident\IncidentWasCreatedEvent $event
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function handle(IncidentWasReportedEvent $event)
|
||||
public function handle(IncidentWasCreatedEvent $event)
|
||||
{
|
||||
$incident = $event->incident;
|
||||
|
||||
|
||||
@@ -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' => [
|
||||
@@ -39,10 +39,10 @@ class EventServiceProvider extends ServiceProvider
|
||||
'CachetHQ\Cachet\Bus\Events\ComponentGroup\ComponentGroupWasUpdatedEvent' => [
|
||||
//
|
||||
],
|
||||
'CachetHQ\Cachet\Bus\Events\Component\ComponentStatusWasUpdatedEvent' => [
|
||||
'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' => [
|
||||
@@ -60,12 +60,12 @@ class EventServiceProvider extends ServiceProvider
|
||||
'CachetHQ\Cachet\Bus\Events\IncidentUpdate\IncidentUpdateWasUpdatedEvent' => [
|
||||
//
|
||||
],
|
||||
'CachetHQ\Cachet\Bus\Events\Incident\IncidentWasCreatedEvent' => [
|
||||
'CachetHQ\Cachet\Bus\Handlers\Events\Incident\SendIncidentEmailNotificationHandler',
|
||||
],
|
||||
'CachetHQ\Cachet\Bus\Events\Incident\IncidentWasRemovedEvent' => [
|
||||
//
|
||||
],
|
||||
'CachetHQ\Cachet\Bus\Events\Incident\IncidentWasReportedEvent' => [
|
||||
'CachetHQ\Cachet\Bus\Handlers\Events\Incident\SendIncidentEmailNotificationHandler',
|
||||
],
|
||||
'CachetHQ\Cachet\Bus\Events\Incident\IncidentWasUpdatedEvent' => [
|
||||
//
|
||||
],
|
||||
@@ -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' => [
|
||||
|
||||
@@ -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'),
|
||||
|
||||
@@ -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),
|
||||
|
||||
@@ -11,8 +11,8 @@
|
||||
|
||||
namespace CachetHQ\Cachet\Http\Controllers\Api;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Commands\Incident\CreateIncidentCommand;
|
||||
use CachetHQ\Cachet\Bus\Commands\Incident\RemoveIncidentCommand;
|
||||
use CachetHQ\Cachet\Bus\Commands\Incident\ReportIncidentCommand;
|
||||
use CachetHQ\Cachet\Bus\Commands\Incident\UpdateIncidentCommand;
|
||||
use CachetHQ\Cachet\Models\Incident;
|
||||
use GrahamCampbell\Binput\Facades\Binput;
|
||||
@@ -67,7 +67,7 @@ class IncidentController extends AbstractApiController
|
||||
public function postIncidents()
|
||||
{
|
||||
try {
|
||||
$incident = dispatch(new ReportIncidentCommand(
|
||||
$incident = dispatch(new CreateIncidentCommand(
|
||||
Binput::get('name'),
|
||||
Binput::get('status'),
|
||||
Binput::get('message', null, false, false),
|
||||
|
||||
@@ -11,8 +11,8 @@
|
||||
|
||||
namespace CachetHQ\Cachet\Http\Controllers\Api;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Commands\IncidentUpdate\CreateIncidentUpdateCommand;
|
||||
use CachetHQ\Cachet\Bus\Commands\IncidentUpdate\RemoveIncidentUpdateCommand;
|
||||
use CachetHQ\Cachet\Bus\Commands\IncidentUpdate\ReportIncidentUpdateCommand;
|
||||
use CachetHQ\Cachet\Bus\Commands\IncidentUpdate\UpdateIncidentUpdateCommand;
|
||||
use CachetHQ\Cachet\Models\Incident;
|
||||
use CachetHQ\Cachet\Models\IncidentUpdate;
|
||||
@@ -74,7 +74,7 @@ class IncidentUpdateController extends AbstractApiController
|
||||
public function postIncidentUpdate(Incident $incident)
|
||||
{
|
||||
try {
|
||||
$update = dispatch(new ReportIncidentUpdateCommand(
|
||||
$update = dispatch(new CreateIncidentUpdateCommand(
|
||||
$incident,
|
||||
Binput::get('status'),
|
||||
Binput::get('message'),
|
||||
|
||||
@@ -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'),
|
||||
|
||||
@@ -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')
|
||||
|
||||
@@ -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'),
|
||||
|
||||
@@ -12,10 +12,10 @@
|
||||
namespace CachetHQ\Cachet\Http\Controllers\Dashboard;
|
||||
|
||||
use AltThree\Validator\ValidationException;
|
||||
use CachetHQ\Cachet\Bus\Commands\Incident\CreateIncidentCommand;
|
||||
use CachetHQ\Cachet\Bus\Commands\Incident\RemoveIncidentCommand;
|
||||
use CachetHQ\Cachet\Bus\Commands\Incident\ReportIncidentCommand;
|
||||
use CachetHQ\Cachet\Bus\Commands\Incident\UpdateIncidentCommand;
|
||||
use CachetHQ\Cachet\Bus\Commands\IncidentUpdate\ReportIncidentUpdateCommand;
|
||||
use CachetHQ\Cachet\Bus\Commands\IncidentUpdate\CreateIncidentUpdateCommand;
|
||||
use CachetHQ\Cachet\Models\Component;
|
||||
use CachetHQ\Cachet\Models\ComponentGroup;
|
||||
use CachetHQ\Cachet\Models\Incident;
|
||||
@@ -108,7 +108,7 @@ class IncidentController extends Controller
|
||||
public function createIncidentAction()
|
||||
{
|
||||
try {
|
||||
$incident = dispatch(new ReportIncidentCommand(
|
||||
$incident = dispatch(new CreateIncidentCommand(
|
||||
Binput::get('name'),
|
||||
Binput::get('status'),
|
||||
Binput::get('message', null, false, false),
|
||||
@@ -308,7 +308,7 @@ class IncidentController extends Controller
|
||||
public function createIncidentUpdateAction(Incident $incident)
|
||||
{
|
||||
try {
|
||||
$incident = dispatch(new ReportIncidentUpdateCommand(
|
||||
$incident = dispatch(new CreateIncidentUpdateCommand(
|
||||
$incident,
|
||||
Binput::get('status'),
|
||||
Binput::get('message'),
|
||||
|
||||
@@ -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'],
|
||||
|
||||
@@ -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'),
|
||||
|
||||
@@ -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 <james@alt-three.com>
|
||||
* @author Graham Campbell <graham@alt-three.com>
|
||||
*/
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -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 <james@alt-three.com>
|
||||
* @author Graham Campbell <graham@alt-three.com>
|
||||
*/
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -12,17 +12,17 @@
|
||||
namespace CachetHQ\Tests\Cachet\Bus\Commands\Incident;
|
||||
|
||||
use AltThree\TestBench\CommandTrait;
|
||||
use CachetHQ\Cachet\Bus\Commands\Incident\ReportIncidentCommand;
|
||||
use CachetHQ\Cachet\Bus\Handlers\Commands\Incident\ReportIncidentCommandHandler;
|
||||
use CachetHQ\Cachet\Bus\Commands\Incident\CreateIncidentCommand;
|
||||
use CachetHQ\Cachet\Bus\Handlers\Commands\Incident\CreateIncidentCommandHandler;
|
||||
use CachetHQ\Tests\Cachet\AbstractTestCase;
|
||||
|
||||
/**
|
||||
* This is the add incident command test class.
|
||||
* This is the create incident command test class.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
* @author Graham Campbell <graham@alt-three.com>
|
||||
*/
|
||||
class ReportIncidentCommandTest extends AbstractTestCase
|
||||
class CreateIncidentCommandTest extends AbstractTestCase
|
||||
{
|
||||
use CommandTrait;
|
||||
|
||||
@@ -42,7 +42,7 @@ class ReportIncidentCommandTest extends AbstractTestCase
|
||||
'template_vars' => [],
|
||||
];
|
||||
|
||||
$object = new ReportIncidentCommand(
|
||||
$object = new CreateIncidentCommand(
|
||||
$params['name'],
|
||||
$params['status'],
|
||||
$params['message'],
|
||||
@@ -66,6 +66,6 @@ class ReportIncidentCommandTest extends AbstractTestCase
|
||||
|
||||
protected function getHandlerClass()
|
||||
{
|
||||
return ReportIncidentCommandHandler::class;
|
||||
return CreateIncidentCommandHandler::class;
|
||||
}
|
||||
}
|
||||
@@ -12,18 +12,18 @@
|
||||
namespace CachetHQ\Tests\Cachet\Bus\Commands\IncidentUpdate;
|
||||
|
||||
use AltThree\TestBench\CommandTrait;
|
||||
use CachetHQ\Cachet\Bus\Commands\IncidentUpdate\ReportIncidentUpdateCommand;
|
||||
use CachetHQ\Cachet\Bus\Handlers\Commands\IncidentUpdate\ReportIncidentUpdateCommandHandler;
|
||||
use CachetHQ\Cachet\Bus\Commands\IncidentUpdate\CreateIncidentUpdateCommand;
|
||||
use CachetHQ\Cachet\Bus\Handlers\Commands\IncidentUpdate\CreateIncidentUpdateCommandHandler;
|
||||
use CachetHQ\Cachet\Models\Incident;
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
use CachetHQ\Tests\Cachet\AbstractTestCase;
|
||||
|
||||
/**
|
||||
* This is the report incident update command test class.
|
||||
* This is the create incident update command test class.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
class ReportIncidentUpdateCommandTest extends AbstractTestCase
|
||||
class CreateIncidentUpdateCommandTest extends AbstractTestCase
|
||||
{
|
||||
use CommandTrait;
|
||||
|
||||
@@ -35,7 +35,7 @@ class ReportIncidentUpdateCommandTest extends AbstractTestCase
|
||||
'message' => 'Foo',
|
||||
'user' => new User(),
|
||||
];
|
||||
$object = new ReportIncidentUpdateCommand($params['incident'], $params['status'], $params['message'], $params['user']);
|
||||
$object = new CreateIncidentUpdateCommand($params['incident'], $params['status'], $params['message'], $params['user']);
|
||||
|
||||
return compact('params', 'object');
|
||||
}
|
||||
@@ -47,6 +47,6 @@ class ReportIncidentUpdateCommandTest extends AbstractTestCase
|
||||
|
||||
protected function getHandlerClass()
|
||||
{
|
||||
return ReportIncidentUpdateCommandHandler::class;
|
||||
return CreateIncidentUpdateCommandHandler::class;
|
||||
}
|
||||
}
|
||||
@@ -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 <james@alt-three.com>
|
||||
* @author Graham Campbell <graham@alt-three.com>
|
||||
*/
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -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 <james@alt-three.com>
|
||||
* @author Graham Campbell <graham@alt-three.com>
|
||||
*/
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -12,17 +12,17 @@
|
||||
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;
|
||||
|
||||
/**
|
||||
* This is the add user command test class.
|
||||
* This is the create user command test class.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
* @author Graham Campbell <graham@alt-three.com>
|
||||
*/
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -11,18 +11,18 @@
|
||||
|
||||
namespace CachetHQ\Tests\Cachet\Bus\Events\Component;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\Component\ComponentStatusWasUpdatedEvent;
|
||||
use CachetHQ\Cachet\Bus\Events\Component\ComponentStatusWasChangedEvent;
|
||||
use CachetHQ\Cachet\Models\Component;
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
use Illuminate\Foundation\Testing\DatabaseMigrations;
|
||||
use MailThief\Testing\InteractsWithMail;
|
||||
|
||||
/**
|
||||
* This is the component status was updated event test.
|
||||
* This is the component status was changed event test.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
class ComponentStatusWasUpdatedEventTest extends AbstractComponentEventTestCase
|
||||
class ComponentStatusWasChangedEventTest extends AbstractComponentEventTestCase
|
||||
{
|
||||
use DatabaseMigrations, InteractsWithMail;
|
||||
|
||||
@@ -40,7 +40,7 @@ class ComponentStatusWasUpdatedEventTest extends AbstractComponentEventTestCase
|
||||
|
||||
$subscriber->subscriptions()->create(['component_id' => $component->id]);
|
||||
|
||||
$this->app['events']->fire(new ComponentStatusWasUpdatedEvent($user, $component, 1, 2, false));
|
||||
$this->app['events']->fire(new ComponentStatusWasChangedEvent($user, $component, 1, 2, false));
|
||||
|
||||
$this->seeMessageFor($subscriber->email);
|
||||
$this->seeMessageWithSubject(trans('notifications.component.status_update.mail.subject'));
|
||||
@@ -65,7 +65,7 @@ class ComponentStatusWasUpdatedEventTest extends AbstractComponentEventTestCase
|
||||
'new_status' => 2,
|
||||
'silent' => false,
|
||||
];
|
||||
$object = new ComponentStatusWasUpdatedEvent(
|
||||
$object = new ComponentStatusWasChangedEvent(
|
||||
$params['user'],
|
||||
$params['component'],
|
||||
$params['original_status'],
|
||||
@@ -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');
|
||||
}
|
||||
@@ -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');
|
||||
}
|
||||
@@ -11,16 +11,16 @@
|
||||
|
||||
namespace CachetHQ\Tests\Cachet\Bus\Events\Incident;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\Incident\IncidentWasReportedEvent;
|
||||
use CachetHQ\Cachet\Bus\Events\Incident\IncidentWasCreatedEvent;
|
||||
use CachetHQ\Cachet\Models\Incident;
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
|
||||
/**
|
||||
* This is the incident was reported event test class.
|
||||
* This is the incident was created event test class.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
class IncidentWasReportedEventTest extends AbstractIncidentEventTestCase
|
||||
class IncidentWasCreatedEventTest extends AbstractIncidentEventTestCase
|
||||
{
|
||||
protected function objectHasHandlers()
|
||||
{
|
||||
@@ -34,7 +34,7 @@ class IncidentWasReportedEventTest extends AbstractIncidentEventTestCase
|
||||
'incident' => new Incident(),
|
||||
'notify' => true,
|
||||
];
|
||||
$object = new IncidentWasReportedEvent($params['user'], $params['incident'], $params['notify']);
|
||||
$object = new IncidentWasCreatedEvent($params['user'], $params['incident'], $params['notify']);
|
||||
|
||||
return compact('params', 'object');
|
||||
}
|
||||
@@ -11,16 +11,16 @@
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
* This is the metric point was added event test class.
|
||||
* This is the metric point was created event test class.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
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');
|
||||
}
|
||||
@@ -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');
|
||||
}
|
||||
@@ -11,15 +11,16 @@
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
* This is the user was added event test class.
|
||||
* This is the user was created event test class.
|
||||
*
|
||||
* @author Graham Campbell <graham@alt-three.com>
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
class UserWasAddedEventTest extends AbstractUserEventTestCase
|
||||
class UserWasCreatedEventTest extends AbstractUserEventTestCase
|
||||
{
|
||||
protected function objectHasHandlers()
|
||||
{
|
||||
@@ -29,7 +30,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');
|
||||
}
|
||||
Reference in New Issue
Block a user