Add event action storage. Closes #2344
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events;
|
||||
|
||||
/**
|
||||
* This is the action interface.
|
||||
*
|
||||
* @author Graham Campbell <graham@alt-three.com>
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
interface ActionInterface
|
||||
{
|
||||
/**
|
||||
* Get the event action.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAction();
|
||||
}
|
||||
@@ -13,6 +13,12 @@ namespace CachetHQ\Cachet\Bus\Events\Component;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\EventInterface;
|
||||
|
||||
/**
|
||||
* This is the component event interface.
|
||||
*
|
||||
* @author Graham Campbell <graham@alt-three.com>
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
interface ComponentEventInterface extends EventInterface
|
||||
{
|
||||
//
|
||||
|
||||
@@ -11,15 +11,24 @@
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\Component;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\ActionInterface;
|
||||
use CachetHQ\Cachet\Models\Component;
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
|
||||
/**
|
||||
* This is the component status was updated event.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
final class ComponentStatusWasUpdatedEvent implements ComponentEventInterface
|
||||
final class ComponentStatusWasUpdatedEvent implements ActionInterface, ComponentEventInterface
|
||||
{
|
||||
/**
|
||||
* The user who updated the component.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\User
|
||||
*/
|
||||
public $user;
|
||||
|
||||
/**
|
||||
* The component that was updated.
|
||||
*
|
||||
@@ -44,14 +53,16 @@ final class ComponentStatusWasUpdatedEvent implements ComponentEventInterface
|
||||
/**
|
||||
* Create a new component was updated event instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\User $user
|
||||
* @param \CachetHQ\Cachet\Models\Component $component
|
||||
* @param int $original_status
|
||||
* @param int $new_status
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Component $component, $original_status, $new_status)
|
||||
public function __construct(User $user, Component $component, $original_status, $new_status)
|
||||
{
|
||||
$this->user = $user;
|
||||
$this->component = $component;
|
||||
$this->original_status = $original_status;
|
||||
$this->new_status = $new_status;
|
||||
@@ -66,4 +77,17 @@ final class ComponentStatusWasUpdatedEvent implements ComponentEventInterface
|
||||
{
|
||||
return 'Component status was updated.';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event action.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAction()
|
||||
{
|
||||
return [
|
||||
'user' => $this->user,
|
||||
'description' => (string) $this,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,10 +11,19 @@
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\Component;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\ActionInterface;
|
||||
use CachetHQ\Cachet\Models\Component;
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
|
||||
final class ComponentWasAddedEvent implements ComponentEventInterface
|
||||
final class ComponentWasAddedEvent implements ActionInterface, ComponentEventInterface
|
||||
{
|
||||
/**
|
||||
* The user who added the component.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\User
|
||||
*/
|
||||
public $user;
|
||||
|
||||
/**
|
||||
* The component that was added.
|
||||
*
|
||||
@@ -25,12 +34,14 @@ final class ComponentWasAddedEvent implements ComponentEventInterface
|
||||
/**
|
||||
* Create a new component was added event instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\User $user
|
||||
* @param \CachetHQ\Cachet\Models\Component $component
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Component $component)
|
||||
public function __construct(User $user, Component $component)
|
||||
{
|
||||
$this->user = $user;
|
||||
$this->component = $component;
|
||||
}
|
||||
|
||||
@@ -43,4 +54,17 @@ final class ComponentWasAddedEvent implements ComponentEventInterface
|
||||
{
|
||||
return 'Component was added.';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event action.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAction()
|
||||
{
|
||||
return [
|
||||
'user' => $this->user,
|
||||
'description' => (string) $this,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,10 +11,24 @@
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\Component;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\ActionInterface;
|
||||
use CachetHQ\Cachet\Models\Component;
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
|
||||
final class ComponentWasRemovedEvent implements ComponentEventInterface
|
||||
/**
|
||||
* This is the component was removed event class.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
final class ComponentWasRemovedEvent implements ActionInterface, ComponentEventInterface
|
||||
{
|
||||
/**
|
||||
* The user who removed the component.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\User
|
||||
*/
|
||||
public $user;
|
||||
|
||||
/**
|
||||
* The component that was removed.
|
||||
*
|
||||
@@ -25,12 +39,14 @@ final class ComponentWasRemovedEvent implements ComponentEventInterface
|
||||
/**
|
||||
* Create a new component was removed event instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\User $user
|
||||
* @param \CachetHQ\Cachet\Models\Component $component
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Component $component)
|
||||
public function __construct(User $user, Component $component)
|
||||
{
|
||||
$this->user = $user;
|
||||
$this->component = $component;
|
||||
}
|
||||
|
||||
@@ -43,4 +59,17 @@ final class ComponentWasRemovedEvent implements ComponentEventInterface
|
||||
{
|
||||
return 'Component was removed.';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event action.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAction()
|
||||
{
|
||||
return [
|
||||
'user' => $this->user,
|
||||
'description' => (string) $this,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,9 @@
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\Component;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\ActionInterface;
|
||||
use CachetHQ\Cachet\Models\Component;
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
|
||||
/**
|
||||
* This is the component was updated event class.
|
||||
@@ -19,8 +21,15 @@ use CachetHQ\Cachet\Models\Component;
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
* @author Graham Campbell <graham@alt-three.com>
|
||||
*/
|
||||
final class ComponentWasUpdatedEvent implements ComponentEventInterface
|
||||
final class ComponentWasUpdatedEvent implements ActionInterface, ComponentEventInterface
|
||||
{
|
||||
/**
|
||||
* The user who updated the component.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\User
|
||||
*/
|
||||
public $user;
|
||||
|
||||
/**
|
||||
* The component that was updated.
|
||||
*
|
||||
@@ -31,12 +40,14 @@ final class ComponentWasUpdatedEvent implements ComponentEventInterface
|
||||
/**
|
||||
* Create a new component was updated event instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\User $user
|
||||
* @param \CachetHQ\Cachet\Models\Component $component
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Component $component)
|
||||
public function __construct(User $user, Component $component)
|
||||
{
|
||||
$this->user = $user;
|
||||
$this->component = $component;
|
||||
}
|
||||
|
||||
@@ -49,4 +60,17 @@ final class ComponentWasUpdatedEvent implements ComponentEventInterface
|
||||
{
|
||||
return 'Component was updated.';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event action.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAction()
|
||||
{
|
||||
return [
|
||||
'user' => $this->user,
|
||||
'description' => (string) $this,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,12 @@ namespace CachetHQ\Cachet\Bus\Events\ComponentGroup;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\EventInterface;
|
||||
|
||||
/**
|
||||
* This is the component group event interface.
|
||||
*
|
||||
* @author Graham Campbell <graham@alt-three.com>
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
interface ComponentGroupEventInterface extends EventInterface
|
||||
{
|
||||
//
|
||||
|
||||
@@ -11,10 +11,19 @@
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\ComponentGroup;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\ActionInterface;
|
||||
use CachetHQ\Cachet\Models\ComponentGroup;
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
|
||||
final class ComponentGroupWasAddedEvent implements ComponentGroupEventInterface
|
||||
final class ComponentGroupWasAddedEvent implements ActionInterface, ComponentGroupEventInterface
|
||||
{
|
||||
/**
|
||||
* The user who added the component group.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\User
|
||||
*/
|
||||
public $user;
|
||||
|
||||
/**
|
||||
* The component group that was added.
|
||||
*
|
||||
@@ -25,12 +34,14 @@ final class ComponentGroupWasAddedEvent implements ComponentGroupEventInterface
|
||||
/**
|
||||
* Create a new component group was added event instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\User $group
|
||||
* @param \CachetHQ\Cachet\Models\ComponentGroup $group
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(ComponentGroup $group)
|
||||
public function __construct(User $user, ComponentGroup $group)
|
||||
{
|
||||
$this->user = $user;
|
||||
$this->group = $group;
|
||||
}
|
||||
|
||||
@@ -43,4 +54,17 @@ final class ComponentGroupWasAddedEvent implements ComponentGroupEventInterface
|
||||
{
|
||||
return 'Component Group was added.';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event action.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAction()
|
||||
{
|
||||
return [
|
||||
'user' => $this->user,
|
||||
'description' => (string) $this,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,10 +11,19 @@
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\ComponentGroup;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\ActionInterface;
|
||||
use CachetHQ\Cachet\Models\ComponentGroup;
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
|
||||
final class ComponentGroupWasRemovedEvent implements ComponentGroupEventInterface
|
||||
final class ComponentGroupWasRemovedEvent implements ActionInterface, ComponentGroupEventInterface
|
||||
{
|
||||
/**
|
||||
* The user who removed the component group.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\User
|
||||
*/
|
||||
public $user;
|
||||
|
||||
/**
|
||||
* The component group that was removed.
|
||||
*
|
||||
@@ -25,12 +34,14 @@ final class ComponentGroupWasRemovedEvent implements ComponentGroupEventInterfac
|
||||
/**
|
||||
* Create a new component group was removed event instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\User $user
|
||||
* @param \CachetHQ\Cachet\Models\ComponentGroup $group
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(ComponentGroup $group)
|
||||
public function __construct(User $user, ComponentGroup $group)
|
||||
{
|
||||
$this->user = $user;
|
||||
$this->group = $group;
|
||||
}
|
||||
|
||||
@@ -43,4 +54,17 @@ final class ComponentGroupWasRemovedEvent implements ComponentGroupEventInterfac
|
||||
{
|
||||
return 'Component Group was removed.';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event action.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAction()
|
||||
{
|
||||
return [
|
||||
'user' => $this->user,
|
||||
'description' => (string) $this,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,10 +11,19 @@
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\ComponentGroup;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\ActionInterface;
|
||||
use CachetHQ\Cachet\Models\ComponentGroup;
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
|
||||
final class ComponentGroupWasUpdatedEvent implements ComponentGroupEventInterface
|
||||
final class ComponentGroupWasUpdatedEvent implements ActionInterface, ComponentGroupEventInterface
|
||||
{
|
||||
/**
|
||||
* The user who updated the component group.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\User
|
||||
*/
|
||||
public $user;
|
||||
|
||||
/**
|
||||
* The component group that was updated.
|
||||
*
|
||||
@@ -25,12 +34,14 @@ final class ComponentGroupWasUpdatedEvent implements ComponentGroupEventInterfac
|
||||
/**
|
||||
* Create a new component group was updated event instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\User $user
|
||||
* @param \CachetHQ\Cachet\Models\ComponentGroup $group
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(ComponentGroup $group)
|
||||
public function __construct(User $user, ComponentGroup $group)
|
||||
{
|
||||
$this->user = $user;
|
||||
$this->group = $group;
|
||||
}
|
||||
|
||||
@@ -43,4 +54,17 @@ final class ComponentGroupWasUpdatedEvent implements ComponentGroupEventInterfac
|
||||
{
|
||||
return 'Component Group was updated.';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event action.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAction()
|
||||
{
|
||||
return [
|
||||
'user' => $this->user,
|
||||
'description' => (string) $this,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,12 @@
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events;
|
||||
|
||||
/**
|
||||
* This is the event interface.
|
||||
*
|
||||
* @author Graham Campbell <graham@alt-three.com>
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
interface EventInterface
|
||||
{
|
||||
//
|
||||
|
||||
@@ -13,6 +13,12 @@ namespace CachetHQ\Cachet\Bus\Events\Incident;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\EventInterface;
|
||||
|
||||
/**
|
||||
* This is the incident event interface.
|
||||
*
|
||||
* @author Graham Campbell <graham@alt-three.com>
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
interface IncidentEventInterface extends EventInterface
|
||||
{
|
||||
//
|
||||
|
||||
@@ -11,10 +11,19 @@
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\Incident;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\ActionInterface;
|
||||
use CachetHQ\Cachet\Models\Incident;
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
|
||||
final class IncidentWasRemovedEvent implements IncidentEventInterface
|
||||
final class IncidentWasRemovedEvent implements ActionInterface, IncidentEventInterface
|
||||
{
|
||||
/**
|
||||
* The user who removed the event.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\User
|
||||
*/
|
||||
public $user;
|
||||
|
||||
/**
|
||||
* The incident that has been removed.
|
||||
*
|
||||
@@ -25,12 +34,14 @@ final class IncidentWasRemovedEvent implements IncidentEventInterface
|
||||
/**
|
||||
* Create a new incident was removed event instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\User $user
|
||||
* @param \CachetHQ\Cachet\Models\Incident $incident
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Incident $incident)
|
||||
public function __construct(User $user, Incident $incident)
|
||||
{
|
||||
$this->user = $user;
|
||||
$this->incident = $incident;
|
||||
}
|
||||
|
||||
@@ -43,4 +54,17 @@ final class IncidentWasRemovedEvent implements IncidentEventInterface
|
||||
{
|
||||
return 'Incident was removed.';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event action.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAction()
|
||||
{
|
||||
return [
|
||||
'user' => $this->user,
|
||||
'description' => (string) $this,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,10 +11,19 @@
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\Incident;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\ActionInterface;
|
||||
use CachetHQ\Cachet\Models\Incident;
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
|
||||
final class IncidentWasReportedEvent implements IncidentEventInterface
|
||||
final class IncidentWasReportedEvent implements ActionInterface, IncidentEventInterface
|
||||
{
|
||||
/**
|
||||
* The user who reported the event.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\User
|
||||
*/
|
||||
public $user;
|
||||
|
||||
/**
|
||||
* The incident that has been reported.
|
||||
*
|
||||
@@ -32,13 +41,15 @@ final class IncidentWasReportedEvent implements IncidentEventInterface
|
||||
/**
|
||||
* Create a new incident has reported event instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\User $user
|
||||
* @param \CachetHQ\Cachet\Models\Incident $incident
|
||||
* @param bool $notify
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Incident $incident, $notify = false)
|
||||
public function __construct(User $user, Incident $incident, $notify = false)
|
||||
{
|
||||
$this->user = $user;
|
||||
$this->incident = $incident;
|
||||
$this->notify = $notify;
|
||||
}
|
||||
@@ -52,4 +63,17 @@ final class IncidentWasReportedEvent implements IncidentEventInterface
|
||||
{
|
||||
return 'Incident was reported.';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event action.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAction()
|
||||
{
|
||||
return [
|
||||
'user' => $this->user,
|
||||
'description' => (string) $this,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,10 +11,19 @@
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\Incident;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\ActionInterface;
|
||||
use CachetHQ\Cachet\Models\Incident;
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
|
||||
final class IncidentWasUpdatedEvent implements IncidentEventInterface
|
||||
final class IncidentWasUpdatedEvent implements ActionInterface, IncidentEventInterface
|
||||
{
|
||||
/**
|
||||
* The user who updated the event.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\User
|
||||
*/
|
||||
public $user;
|
||||
|
||||
/**
|
||||
* The incident that has been updated.
|
||||
*
|
||||
@@ -25,12 +34,14 @@ final class IncidentWasUpdatedEvent implements IncidentEventInterface
|
||||
/**
|
||||
* Create a new incident has updated event instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\User $user
|
||||
* @param \CachetHQ\Cachet\Models\Incident $incident
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Incident $incident)
|
||||
public function __construct(User $user, Incident $incident)
|
||||
{
|
||||
$this->user = $user;
|
||||
$this->incident = $incident;
|
||||
}
|
||||
|
||||
@@ -43,4 +54,17 @@ final class IncidentWasUpdatedEvent implements IncidentEventInterface
|
||||
{
|
||||
return 'Incident was updated.';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event action.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAction()
|
||||
{
|
||||
return [
|
||||
'user' => $this->user,
|
||||
'description' => (string) $this,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,15 +11,24 @@
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\IncidentUpdate;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\ActionInterface;
|
||||
use CachetHQ\Cachet\Models\IncidentUpdate;
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
|
||||
/**
|
||||
* This is the incident update was removed event.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
final class IncidentUpdateWasRemovedEvent implements IncidentUpdateEventInterface
|
||||
final class IncidentUpdateWasRemovedEvent implements ActionInterface, IncidentUpdateEventInterface
|
||||
{
|
||||
/**
|
||||
* The user who removed the incident update.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\User
|
||||
*/
|
||||
public $user;
|
||||
|
||||
/**
|
||||
* The incident update that has been removed.
|
||||
*
|
||||
@@ -30,12 +39,14 @@ final class IncidentUpdateWasRemovedEvent implements IncidentUpdateEventInterfac
|
||||
/**
|
||||
* Create a new incident update was removed event instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\User $user
|
||||
* @param \CachetHQ\Cachet\Models\IncidentUpdate $update
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(IncidentUpdate $update)
|
||||
public function __construct(User $user, IncidentUpdate $update)
|
||||
{
|
||||
$this->user = $user;
|
||||
$this->update = $update;
|
||||
}
|
||||
|
||||
@@ -48,4 +59,17 @@ final class IncidentUpdateWasRemovedEvent implements IncidentUpdateEventInterfac
|
||||
{
|
||||
return 'Incident Update was removed.';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event action.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAction()
|
||||
{
|
||||
return [
|
||||
'user' => $this->user,
|
||||
'description' => (string) $this,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,15 +11,24 @@
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\IncidentUpdate;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\ActionInterface;
|
||||
use CachetHQ\Cachet\Models\IncidentUpdate;
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
|
||||
/**
|
||||
* This is the incident update was reported event.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
final class IncidentUpdateWasReportedEvent implements IncidentUpdateEventInterface
|
||||
final class IncidentUpdateWasReportedEvent implements ActionInterface, IncidentUpdateEventInterface
|
||||
{
|
||||
/**
|
||||
* The user who reported the incident update.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\User
|
||||
*/
|
||||
public $user;
|
||||
|
||||
/**
|
||||
* The incident update that has been reported.
|
||||
*
|
||||
@@ -30,12 +39,14 @@ final class IncidentUpdateWasReportedEvent implements IncidentUpdateEventInterfa
|
||||
/**
|
||||
* Create a new incident update was reported event instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\User $user
|
||||
* @param \CachetHQ\Cachet\Models\IncidentUpdate $update
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(IncidentUpdate $update)
|
||||
public function __construct(User $user, IncidentUpdate $update)
|
||||
{
|
||||
$this->user = $user;
|
||||
$this->update = $update;
|
||||
}
|
||||
|
||||
@@ -48,4 +59,17 @@ final class IncidentUpdateWasReportedEvent implements IncidentUpdateEventInterfa
|
||||
{
|
||||
return 'Incident Update was reported.';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event action.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAction()
|
||||
{
|
||||
return [
|
||||
'user' => $this->user,
|
||||
'description' => (string) $this,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,15 +11,24 @@
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\IncidentUpdate;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\ActionInterface;
|
||||
use CachetHQ\Cachet\Models\IncidentUpdate;
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
|
||||
/**
|
||||
* This is the incident update was updated event.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
final class IncidentUpdateWasUpdatedEvent implements IncidentUpdateEventInterface
|
||||
final class IncidentUpdateWasUpdatedEvent implements ActionInterface, IncidentUpdateEventInterface
|
||||
{
|
||||
/**
|
||||
* The user who updated the incident update.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\User
|
||||
*/
|
||||
public $user;
|
||||
|
||||
/**
|
||||
* The incident update that has been updated.
|
||||
*
|
||||
@@ -34,8 +43,9 @@ final class IncidentUpdateWasUpdatedEvent implements IncidentUpdateEventInterfac
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(IncidentUpdate $update)
|
||||
public function __construct(User $user, IncidentUpdate $update)
|
||||
{
|
||||
$this->user = $user;
|
||||
$this->update = $update;
|
||||
}
|
||||
|
||||
@@ -48,4 +58,17 @@ final class IncidentUpdateWasUpdatedEvent implements IncidentUpdateEventInterfac
|
||||
{
|
||||
return 'Incident Update was updated.';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event action.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAction()
|
||||
{
|
||||
return [
|
||||
'user' => $this->user,
|
||||
'description' => (string) $this,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,12 @@ namespace CachetHQ\Cachet\Bus\Events\Invite;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\EventInterface;
|
||||
|
||||
/**
|
||||
* This is the invite event interface.
|
||||
*
|
||||
* @author Graham Campbell <graham@alt-three.com>
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
interface InviteEventInterface extends EventInterface
|
||||
{
|
||||
//
|
||||
|
||||
@@ -13,6 +13,12 @@ namespace CachetHQ\Cachet\Bus\Events\Metric;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\EventInterface;
|
||||
|
||||
/**
|
||||
* This is the metric event interface.
|
||||
*
|
||||
* @author Graham Campbell <graham@alt-three.com>
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
interface MetricEventInterface extends EventInterface
|
||||
{
|
||||
//
|
||||
|
||||
@@ -11,10 +11,19 @@
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\Metric;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\ActionInterface;
|
||||
use CachetHQ\Cachet\Models\MetricPoint;
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
|
||||
final class MetricPointWasAddedEvent implements MetricEventInterface
|
||||
final class MetricPointWasAddedEvent implements ActionInterface, MetricEventInterface
|
||||
{
|
||||
/**
|
||||
* The user who added the metric point.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\User
|
||||
*/
|
||||
public $user;
|
||||
|
||||
/**
|
||||
* The metric point that was added.
|
||||
*
|
||||
@@ -25,12 +34,14 @@ final class MetricPointWasAddedEvent implements MetricEventInterface
|
||||
/**
|
||||
* Create a new metric point was added event instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\User $user
|
||||
* @param \CachetHQ\Cachet\Models\MetricPoint $metricPoint
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(MetricPoint $metricPoint)
|
||||
public function __construct(User $user, MetricPoint $metricPoint)
|
||||
{
|
||||
$this->user = $user;
|
||||
$this->metricPoint = $metricPoint;
|
||||
}
|
||||
|
||||
@@ -43,4 +54,17 @@ final class MetricPointWasAddedEvent implements MetricEventInterface
|
||||
{
|
||||
return 'Metric Point was added.';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event action.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAction()
|
||||
{
|
||||
return [
|
||||
'user' => $this->user,
|
||||
'description' => (string) $this,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,10 +11,19 @@
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\Metric;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\ActionInterface;
|
||||
use CachetHQ\Cachet\Models\MetricPoint;
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
|
||||
final class MetricPointWasRemovedEvent implements MetricEventInterface
|
||||
final class MetricPointWasRemovedEvent implements ActionInterface, MetricEventInterface
|
||||
{
|
||||
/**
|
||||
* The user who removed the metric point.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\User
|
||||
*/
|
||||
public $user;
|
||||
|
||||
/**
|
||||
* The metric point that was removed.
|
||||
*
|
||||
@@ -25,12 +34,14 @@ final class MetricPointWasRemovedEvent implements MetricEventInterface
|
||||
/**
|
||||
* Create a new metric point was removed event instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\User $user
|
||||
* @param \CachetHQ\Cachet\Models\MetricPoint $memtricPoint
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(MetricPoint $metricPoint)
|
||||
public function __construct(User $user, MetricPoint $metricPoint)
|
||||
{
|
||||
$this->user = $user;
|
||||
$this->metricPoint = $metricPoint;
|
||||
}
|
||||
|
||||
@@ -43,4 +54,17 @@ final class MetricPointWasRemovedEvent implements MetricEventInterface
|
||||
{
|
||||
return 'Metric Point was removed.';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event action.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAction()
|
||||
{
|
||||
return [
|
||||
'user' => $this->user,
|
||||
'description' => (string) $this,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,10 +11,19 @@
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\Metric;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\ActionInterface;
|
||||
use CachetHQ\Cachet\Models\MetricPoint;
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
|
||||
final class MetricPointWasUpdatedEvent implements MetricEventInterface
|
||||
final class MetricPointWasUpdatedEvent implements ActionInterface, MetricEventInterface
|
||||
{
|
||||
/**
|
||||
* The user who updated the metric point.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\User
|
||||
*/
|
||||
public $user;
|
||||
|
||||
/**
|
||||
* The metric point that was updated.
|
||||
*
|
||||
@@ -25,12 +34,14 @@ final class MetricPointWasUpdatedEvent implements MetricEventInterface
|
||||
/**
|
||||
* Create a new metric point was updated event instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\User $user
|
||||
* @param \CachetHQ\Cachet\Models\MetricPoint $metricPoint
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(MetricPoint $metricPoint)
|
||||
public function __construct(User $user, MetricPoint $metricPoint)
|
||||
{
|
||||
$this->user = $user;
|
||||
$this->metricPoint = $metricPoint;
|
||||
}
|
||||
|
||||
@@ -43,4 +54,17 @@ final class MetricPointWasUpdatedEvent implements MetricEventInterface
|
||||
{
|
||||
return 'Metric Point was updated.';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event action.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAction()
|
||||
{
|
||||
return [
|
||||
'user' => $this->user,
|
||||
'description' => (string) $this,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,10 +11,19 @@
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\Metric;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\ActionInterface;
|
||||
use CachetHQ\Cachet\Models\Metric;
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
|
||||
final class MetricWasAddedEvent implements MetricEventInterface
|
||||
final class MetricWasAddedEvent implements ActionInterface, MetricEventInterface
|
||||
{
|
||||
/**
|
||||
* The user who added the metric.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\User
|
||||
*/
|
||||
public $user;
|
||||
|
||||
/**
|
||||
* The metric that was added.
|
||||
*
|
||||
@@ -25,12 +34,14 @@ final class MetricWasAddedEvent implements MetricEventInterface
|
||||
/**
|
||||
* Create a new metric was added event instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\User $user
|
||||
* @param \CachetHQ\Cachet\Models\Metric $metric
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Metric $metric)
|
||||
public function __construct(User $user, Metric $metric)
|
||||
{
|
||||
$this->user = $user;
|
||||
$this->metric = $metric;
|
||||
}
|
||||
|
||||
@@ -43,4 +54,17 @@ final class MetricWasAddedEvent implements MetricEventInterface
|
||||
{
|
||||
return 'Metric was added.';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event action.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAction()
|
||||
{
|
||||
return [
|
||||
'user' => $this->user,
|
||||
'description' => (string) $this,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,10 +11,19 @@
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\Metric;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\ActionInterface;
|
||||
use CachetHQ\Cachet\Models\Metric;
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
|
||||
final class MetricWasRemovedEvent implements MetricEventInterface
|
||||
final class MetricWasRemovedEvent implements ActionInterface, MetricEventInterface
|
||||
{
|
||||
/**
|
||||
* The user who removed the metric.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\User
|
||||
*/
|
||||
public $user;
|
||||
|
||||
/**
|
||||
* The metric that was removed.
|
||||
*
|
||||
@@ -25,12 +34,14 @@ final class MetricWasRemovedEvent implements MetricEventInterface
|
||||
/**
|
||||
* Create a new metric was removed event instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\User $user
|
||||
* @param \CachetHQ\Cachet\Models\Metric $metric
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Metric $metric)
|
||||
public function __construct(User $user, Metric $metric)
|
||||
{
|
||||
$this->user = $user;
|
||||
$this->metric = $metric;
|
||||
}
|
||||
|
||||
@@ -43,4 +54,17 @@ final class MetricWasRemovedEvent implements MetricEventInterface
|
||||
{
|
||||
return 'Metric was removed.';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event action.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAction()
|
||||
{
|
||||
return [
|
||||
'user' => $this->user,
|
||||
'description' => (string) $this,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,10 +11,19 @@
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\Metric;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\ActionInterface;
|
||||
use CachetHQ\Cachet\Models\Metric;
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
|
||||
final class MetricWasUpdatedEvent implements MetricEventInterface
|
||||
final class MetricWasUpdatedEvent implements ActionInterface, MetricEventInterface
|
||||
{
|
||||
/**
|
||||
* The user who update the metric.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\User
|
||||
*/
|
||||
public $user;
|
||||
|
||||
/**
|
||||
* The metric that was updated.
|
||||
*
|
||||
@@ -25,12 +34,14 @@ final class MetricWasUpdatedEvent implements MetricEventInterface
|
||||
/**
|
||||
* Create a new metric was updated event instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\User $user
|
||||
* @param \CachetHQ\Cachet\Models\Metric $metric
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Metric $metric)
|
||||
public function __construct(User $user, Metric $metric)
|
||||
{
|
||||
$this->user = $user;
|
||||
$this->metric = $metric;
|
||||
}
|
||||
|
||||
@@ -43,4 +54,17 @@ final class MetricWasUpdatedEvent implements MetricEventInterface
|
||||
{
|
||||
return 'Metric was updated.';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event action.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAction()
|
||||
{
|
||||
return [
|
||||
'user' => $this->user,
|
||||
'description' => (string) $this,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,15 +11,24 @@
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\Schedule;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\ActionInterface;
|
||||
use CachetHQ\Cachet\Models\Schedule;
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
|
||||
/**
|
||||
* This is the schedule was created event class.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
final class ScheduleWasCreatedEvent implements ScheduleEventInterface
|
||||
final class ScheduleWasCreatedEvent implements ActionInterface, ScheduleEventInterface
|
||||
{
|
||||
/**
|
||||
* The user that created the schedule.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\User
|
||||
*/
|
||||
public $user;
|
||||
|
||||
/**
|
||||
* The schedule that has been created.
|
||||
*
|
||||
@@ -30,12 +39,14 @@ final class ScheduleWasCreatedEvent implements ScheduleEventInterface
|
||||
/**
|
||||
* Create a new schedule was created event instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\User $user
|
||||
* @param \CachetHQ\Cachet\Models\Schedule $schedule
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Schedule $schedule)
|
||||
public function __construct(User $user, Schedule $schedule)
|
||||
{
|
||||
$this->user = $user;
|
||||
$this->schedule = $schedule;
|
||||
}
|
||||
|
||||
@@ -48,4 +59,17 @@ final class ScheduleWasCreatedEvent implements ScheduleEventInterface
|
||||
{
|
||||
return 'Schedule was created.';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event action.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAction()
|
||||
{
|
||||
return [
|
||||
'user' => $this->user,
|
||||
'description' => (string) $this,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,15 +11,24 @@
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\Schedule;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\ActionInterface;
|
||||
use CachetHQ\Cachet\Models\Schedule;
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
|
||||
/**
|
||||
* This is the schedule was removed event class.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
final class ScheduleWasRemovedEvent implements ScheduleEventInterface
|
||||
final class ScheduleWasRemovedEvent implements ActionInterface, ScheduleEventInterface
|
||||
{
|
||||
/**
|
||||
* The user that removed the schedule.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\User
|
||||
*/
|
||||
public $user;
|
||||
|
||||
/**
|
||||
* The schedule that has been removed.
|
||||
*
|
||||
@@ -30,12 +39,14 @@ final class ScheduleWasRemovedEvent implements ScheduleEventInterface
|
||||
/**
|
||||
* Create a new schedule was removed event instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\User $user
|
||||
* @param \CachetHQ\Cachet\Models\Schedule $schedule
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Schedule $schedule)
|
||||
public function __construct(User $user, Schedule $schedule)
|
||||
{
|
||||
$this->user = $user;
|
||||
$this->schedule = $schedule;
|
||||
}
|
||||
|
||||
@@ -48,4 +59,17 @@ final class ScheduleWasRemovedEvent implements ScheduleEventInterface
|
||||
{
|
||||
return 'Schedule was removed.';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event action.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAction()
|
||||
{
|
||||
return [
|
||||
'user' => $this->user,
|
||||
'description' => (string) $this,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,15 +11,24 @@
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\Schedule;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\ActionInterface;
|
||||
use CachetHQ\Cachet\Models\Schedule;
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
|
||||
/**
|
||||
* This is the schedule was updated event class.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
final class ScheduleWasUpdatedEvent implements ScheduleEventInterface
|
||||
final class ScheduleWasUpdatedEvent implements ActionInterface, ScheduleEventInterface
|
||||
{
|
||||
/**
|
||||
* The user that created the schedule.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\User
|
||||
*/
|
||||
public $user;
|
||||
|
||||
/**
|
||||
* The schedule that has been updated.
|
||||
*
|
||||
@@ -30,12 +39,14 @@ final class ScheduleWasUpdatedEvent implements ScheduleEventInterface
|
||||
/**
|
||||
* Create a new schedule was updated event instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\User $user
|
||||
* @param \CachetHQ\Cachet\Models\Schedule $schedule
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Schedule $schedule)
|
||||
public function __construct(User $user, Schedule $schedule)
|
||||
{
|
||||
$this->user = $user;
|
||||
$this->schedule = $schedule;
|
||||
}
|
||||
|
||||
@@ -48,4 +59,17 @@ final class ScheduleWasUpdatedEvent implements ScheduleEventInterface
|
||||
{
|
||||
return 'Schedule was updated.';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event action.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAction()
|
||||
{
|
||||
return [
|
||||
'user' => $this->user,
|
||||
'description' => (string) $this,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,12 @@ namespace CachetHQ\Cachet\Bus\Events\Subscriber;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\EventInterface;
|
||||
|
||||
/**
|
||||
* This is the subscriber event interface.
|
||||
*
|
||||
* @author Graham Campbell <graham@alt-three.com>
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
interface SubscriberEventInterface extends EventInterface
|
||||
{
|
||||
//
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\User;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\ActionInterface;
|
||||
use CachetHQ\Cachet\Models\Invite;
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
|
||||
@@ -19,7 +20,7 @@ use CachetHQ\Cachet\Models\User;
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
final class UserAcceptedInviteEvent implements UserEventInterface
|
||||
final class UserAcceptedInviteEvent implements ActionInterface, UserEventInterface
|
||||
{
|
||||
/**
|
||||
* The user that accepted the invite.
|
||||
@@ -58,4 +59,17 @@ final class UserAcceptedInviteEvent implements UserEventInterface
|
||||
{
|
||||
return 'User accepted invite.';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event action.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAction()
|
||||
{
|
||||
return [
|
||||
'user' => $this->user,
|
||||
'description' => (string) $this,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\User;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\ActionInterface;
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
|
||||
/**
|
||||
@@ -18,7 +19,7 @@ use CachetHQ\Cachet\Models\User;
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
final class UserDisabledTwoAuthEvent implements UserEventInterface
|
||||
final class UserDisabledTwoAuthEvent implements ActionInterface, UserEventInterface
|
||||
{
|
||||
/**
|
||||
* The user that disabled two auth.
|
||||
@@ -48,4 +49,17 @@ final class UserDisabledTwoAuthEvent implements UserEventInterface
|
||||
{
|
||||
return 'User disabled two-factor authentication.';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event action.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAction()
|
||||
{
|
||||
return [
|
||||
'user' => $this->user,
|
||||
'description' => (string) $this,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\User;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\ActionInterface;
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
|
||||
/**
|
||||
@@ -18,7 +19,7 @@ use CachetHQ\Cachet\Models\User;
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
final class UserEnabledTwoAuthEvent implements UserEventInterface
|
||||
final class UserEnabledTwoAuthEvent implements ActionInterface, UserEventInterface
|
||||
{
|
||||
/**
|
||||
* The user that enabled two auth.
|
||||
@@ -48,4 +49,17 @@ final class UserEnabledTwoAuthEvent implements UserEventInterface
|
||||
{
|
||||
return 'User enabled two-factor authentication.';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event action.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAction()
|
||||
{
|
||||
return [
|
||||
'user' => $this->user,
|
||||
'description' => (string) $this,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,12 @@ namespace CachetHQ\Cachet\Bus\Events\User;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\EventInterface;
|
||||
|
||||
/**
|
||||
* This is the user event interface.
|
||||
*
|
||||
* @author Graham Campbell <graham@alt-three.com>
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
interface UserEventInterface extends EventInterface
|
||||
{
|
||||
//
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\User;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\ActionInterface;
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
|
||||
/**
|
||||
@@ -18,7 +19,7 @@ use CachetHQ\Cachet\Models\User;
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
final class UserFailedTwoAuthEvent implements UserEventInterface
|
||||
final class UserFailedTwoAuthEvent implements ActionInterface, UserEventInterface
|
||||
{
|
||||
/**
|
||||
* The user that failed two auth.
|
||||
@@ -48,4 +49,17 @@ final class UserFailedTwoAuthEvent implements UserEventInterface
|
||||
{
|
||||
return 'User failed two-factor authentication.';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event action.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAction()
|
||||
{
|
||||
return [
|
||||
'user' => $this->user,
|
||||
'description' => (string) $this,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\User;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\ActionInterface;
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
|
||||
/**
|
||||
@@ -18,7 +19,7 @@ use CachetHQ\Cachet\Models\User;
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
final class UserLoggedInEvent implements UserEventInterface
|
||||
final class UserLoggedInEvent implements ActionInterface, UserEventInterface
|
||||
{
|
||||
/**
|
||||
* The user that logged in.
|
||||
@@ -48,4 +49,17 @@ final class UserLoggedInEvent implements UserEventInterface
|
||||
{
|
||||
return 'User logged in.';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event action.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAction()
|
||||
{
|
||||
return [
|
||||
'user' => $this->user,
|
||||
'description' => (string) $this,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\User;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\ActionInterface;
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
|
||||
/**
|
||||
@@ -18,7 +19,7 @@ use CachetHQ\Cachet\Models\User;
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
final class UserLoggedOutEvent implements UserEventInterface
|
||||
final class UserLoggedOutEvent implements ActionInterface, UserEventInterface
|
||||
{
|
||||
/**
|
||||
* The user that logged out.
|
||||
@@ -48,4 +49,17 @@ final class UserLoggedOutEvent implements UserEventInterface
|
||||
{
|
||||
return 'User logged out.';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event action.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAction()
|
||||
{
|
||||
return [
|
||||
'user' => $this->user,
|
||||
'description' => (string) $this,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\User;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\ActionInterface;
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
|
||||
/**
|
||||
@@ -18,7 +19,7 @@ use CachetHQ\Cachet\Models\User;
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
final class UserPassedTwoAuthEvent implements UserEventInterface
|
||||
final class UserPassedTwoAuthEvent implements ActionInterface, UserEventInterface
|
||||
{
|
||||
/**
|
||||
* The user that passed two auth.
|
||||
@@ -48,4 +49,17 @@ final class UserPassedTwoAuthEvent implements UserEventInterface
|
||||
{
|
||||
return 'User passed two-factor authentication.';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event action.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAction()
|
||||
{
|
||||
return [
|
||||
'user' => $this->user,
|
||||
'description' => (string) $this,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\User;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\ActionInterface;
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
|
||||
/**
|
||||
@@ -18,7 +19,7 @@ use CachetHQ\Cachet\Models\User;
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
final class UserRegeneratedApiTokenEvent implements UserEventInterface
|
||||
final class UserRegeneratedApiTokenEvent implements ActionInterface, UserEventInterface
|
||||
{
|
||||
/**
|
||||
* The user that regenerated their api token.
|
||||
@@ -48,4 +49,17 @@ final class UserRegeneratedApiTokenEvent implements UserEventInterface
|
||||
{
|
||||
return 'User regenerated api token.';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event action.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAction()
|
||||
{
|
||||
return [
|
||||
'user' => $this->user,
|
||||
'description' => (string) $this,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,9 +11,10 @@
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\User;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\ActionInterface;
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
|
||||
final class UserWasAddedEvent implements UserEventInterface
|
||||
final class UserWasAddedEvent implements ActionInterface, UserEventInterface
|
||||
{
|
||||
/**
|
||||
* The user that has been added.
|
||||
@@ -43,4 +44,17 @@ final class UserWasAddedEvent implements UserEventInterface
|
||||
{
|
||||
return 'User was added.';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event action.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAction()
|
||||
{
|
||||
return [
|
||||
'user' => $this->user,
|
||||
'description' => (string) $this,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,9 +11,10 @@
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\User;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\ActionInterface;
|
||||
use CachetHQ\Cachet\Models\Invite;
|
||||
|
||||
final class UserWasInvitedEvent implements UserEventInterface
|
||||
final class UserWasInvitedEvent implements ActionInterface, UserEventInterface
|
||||
{
|
||||
/**
|
||||
* The invite that has been added.
|
||||
@@ -43,4 +44,17 @@ final class UserWasInvitedEvent implements UserEventInterface
|
||||
{
|
||||
return 'User was invited.';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event action.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAction()
|
||||
{
|
||||
return [
|
||||
'user' => $this->user,
|
||||
'description' => (string) $this,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,9 +11,10 @@
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\User;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\ActionInterface;
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
|
||||
final class UserWasRemovedEvent implements UserEventInterface
|
||||
final class UserWasRemovedEvent implements ActionInterface, UserEventInterface
|
||||
{
|
||||
/**
|
||||
* The user that has been removed.
|
||||
@@ -43,4 +44,17 @@ final class UserWasRemovedEvent implements UserEventInterface
|
||||
{
|
||||
return 'User was removed.';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event action.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAction()
|
||||
{
|
||||
return [
|
||||
'user' => $this->user,
|
||||
'description' => (string) $this,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\User;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\ActionInterface;
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
|
||||
/**
|
||||
@@ -18,7 +19,7 @@ use CachetHQ\Cachet\Models\User;
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
final class UserWasWelcomedEvent implements UserEventInterface
|
||||
final class UserWasWelcomedEvent implements ActionInterface, UserEventInterface
|
||||
{
|
||||
/**
|
||||
* The user.
|
||||
@@ -48,4 +49,17 @@ final class UserWasWelcomedEvent implements UserEventInterface
|
||||
{
|
||||
return 'User was welcomed.';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event action.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAction()
|
||||
{
|
||||
return [
|
||||
'user' => $this->user,
|
||||
'description' => (string) $this,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user