diff --git a/src/Events/FeatureStarted.php b/src/Events/FeatureStarted.php index 13ead6e..4b77819 100644 --- a/src/Events/FeatureStarted.php +++ b/src/Events/FeatureStarted.php @@ -9,12 +9,19 @@ class FeatureStarted */ public $name; + /** + * @var array + */ + public $arguments; + /** * FeatureStarted constructor. * @param string $name + * @param array $arguments */ - public function __construct($name) + public function __construct($name, array $arguments = []) { $this->name = $name; + $this->arguments = $arguments; } -} \ No newline at end of file +} diff --git a/src/Events/JobStarted.php b/src/Events/JobStarted.php index e55ccad..604bced 100644 --- a/src/Events/JobStarted.php +++ b/src/Events/JobStarted.php @@ -9,12 +9,19 @@ class JobStarted */ public $name; + /** + * @var array + */ + public $arguments; + /** * JobStarted constructor. * @param string $name + * @param array $arguments */ - public function __construct($name) + public function __construct($name, array $arguments = []) { $this->name = $name; + $this->arguments = $arguments; } -} \ No newline at end of file +} diff --git a/src/Events/OperationStarted.php b/src/Events/OperationStarted.php index fa1281b..f47b663 100644 --- a/src/Events/OperationStarted.php +++ b/src/Events/OperationStarted.php @@ -9,12 +9,19 @@ class OperationStarted */ public $name; + /** + * @var array + */ + public $arguments; + /** * OperationStarted constructor. * @param string $name + * @param array $arguments */ - public function __construct($name) + public function __construct($name, array $arguments = []) { $this->name = $name; + $this->arguments = $arguments; } -} \ No newline at end of file +} diff --git a/src/JobDispatcherTrait.php b/src/JobDispatcherTrait.php index 5166d53..1f0bbf2 100644 --- a/src/JobDispatcherTrait.php +++ b/src/JobDispatcherTrait.php @@ -34,10 +34,10 @@ public function run($job, $arguments = [], $extra = []) } if ($job instanceof Operation) { - event(new OperationStarted(get_class($job))); + event(new OperationStarted(get_class($job), $arguments)); } if ($job instanceof Job) { - event(new JobStarted(get_class($job))); + event(new JobStarted(get_class($job), $arguments)); } $result = $this->dispatch($job, $arguments); diff --git a/src/ServesFeaturesTrait.php b/src/ServesFeaturesTrait.php index 7ccb9ae..7c6ec3c 100644 --- a/src/ServesFeaturesTrait.php +++ b/src/ServesFeaturesTrait.php @@ -21,7 +21,7 @@ trait ServesFeaturesTrait */ public function serve($feature, $arguments = []) { - event(new FeatureStarted($feature)); + event(new FeatureStarted($feature, $arguments)); return $this->dispatch($this->marshal($feature, new Collection(), $arguments)); }