Skip to content
This repository was archived by the owner on Dec 11, 2020. It is now read-only.

Commit e12186f

Browse files
committed
Log op arguments along with class FQN
1 parent b299e07 commit e12186f

File tree

5 files changed

+30
-9
lines changed

5 files changed

+30
-9
lines changed

src/Events/FeatureStarted.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,19 @@ class FeatureStarted
99
*/
1010
public $name;
1111

12+
/**
13+
* @var array
14+
*/
15+
public $arguments;
16+
1217
/**
1318
* FeatureStarted constructor.
1419
* @param string $name
20+
* @param array $arguments
1521
*/
16-
public function __construct($name)
22+
public function __construct($name, array $arguments = [])
1723
{
1824
$this->name = $name;
25+
$this->arguments = $arguments;
1926
}
20-
}
27+
}

src/Events/JobStarted.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,19 @@ class JobStarted
99
*/
1010
public $name;
1111

12+
/**
13+
* @var array
14+
*/
15+
public $arguments;
16+
1217
/**
1318
* JobStarted constructor.
1419
* @param string $name
20+
* @param array $arguments
1521
*/
16-
public function __construct($name)
22+
public function __construct($name, array $arguments = [])
1723
{
1824
$this->name = $name;
25+
$this->arguments = $arguments;
1926
}
20-
}
27+
}

src/Events/OperationStarted.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,19 @@ class OperationStarted
99
*/
1010
public $name;
1111

12+
/**
13+
* @var array
14+
*/
15+
public $arguments;
16+
1217
/**
1318
* OperationStarted constructor.
1419
* @param string $name
20+
* @param array $arguments
1521
*/
16-
public function __construct($name)
22+
public function __construct($name, array $arguments = [])
1723
{
1824
$this->name = $name;
25+
$this->arguments = $arguments;
1926
}
20-
}
27+
}

src/JobDispatcherTrait.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ public function run($job, $arguments = [], $extra = [])
3434
}
3535

3636
if ($job instanceof Operation) {
37-
event(new OperationStarted(get_class($job)));
37+
event(new OperationStarted(get_class($job), $arguments));
3838
}
3939
if ($job instanceof Job) {
40-
event(new JobStarted(get_class($job)));
40+
event(new JobStarted(get_class($job), $arguments));
4141
}
4242

4343
$result = $this->dispatch($job, $arguments);

src/ServesFeaturesTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ trait ServesFeaturesTrait
2121
*/
2222
public function serve($feature, $arguments = [])
2323
{
24-
event(new FeatureStarted($feature));
24+
event(new FeatureStarted($feature, $arguments));
2525

2626
return $this->dispatch($this->marshal($feature, new Collection(), $arguments));
2727
}

0 commit comments

Comments
 (0)