1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Imanghafoori\HeyMan; |
4
|
|
|
|
5
|
|
|
use Imanghafoori\HeyMan\Reactions\ReactionFactory; |
6
|
|
|
|
7
|
|
|
class Chain |
8
|
|
|
{ |
9
|
|
|
/** |
10
|
|
|
* @var \Imanghafoori\HeyMan\ListenerApplier |
|
|
|
|
11
|
|
|
*/ |
12
|
|
|
public $eventManager; |
13
|
|
|
|
14
|
|
|
public $debugInfo; |
15
|
|
|
|
16
|
|
|
public $condition; |
17
|
|
|
|
18
|
|
|
public $responseType = 'nothing'; |
19
|
|
|
|
20
|
|
|
public $data = []; |
21
|
|
|
|
22
|
|
|
private $beforeResponse = []; |
23
|
|
|
|
24
|
2 |
|
public function addAfterCall($callback, $parameters) |
25
|
|
|
{ |
26
|
|
|
$this->beforeResponse[] = function () use ($callback, $parameters) { |
27
|
2 |
|
app()->call($callback, $parameters); |
28
|
1 |
|
}; |
29
|
2 |
|
} |
30
|
|
|
|
31
|
1 |
|
public function eventFire($event, array $payload, bool $halt) |
32
|
|
|
{ |
33
|
|
|
$this->beforeResponse[] = function () use ($event, $payload, $halt) { |
34
|
1 |
|
app('events')->dispatch($event, $payload, $halt); |
35
|
1 |
|
}; |
36
|
1 |
|
} |
37
|
|
|
|
38
|
93 |
|
public function submitChainConfig() |
39
|
|
|
{ |
40
|
93 |
|
$callbackListener = app(ReactionFactory::class)->make(); |
41
|
93 |
|
$this->eventManager->commitChain($callbackListener); |
42
|
93 |
|
} |
43
|
|
|
|
44
|
93 |
|
public function beforeResponse(): \Closure |
45
|
|
|
{ |
46
|
93 |
|
$calls = $this->beforeResponse; |
47
|
93 |
|
$this->beforeResponse = []; |
48
|
|
|
|
49
|
|
|
return function () use ($calls) { |
50
|
52 |
|
foreach ($calls as $call) { |
51
|
3 |
|
$call(); |
52
|
|
|
} |
53
|
93 |
|
}; |
54
|
|
|
} |
55
|
|
|
|
56
|
83 |
|
public function commit($args, $methodName) |
57
|
|
|
{ |
58
|
83 |
|
$this->data = $args; |
59
|
83 |
|
$this->responseType = $methodName; |
60
|
83 |
|
} |
61
|
|
|
|
62
|
5 |
|
public function commitArray($args, $methodName) |
63
|
|
|
{ |
64
|
5 |
|
$this->data[] = $args; |
65
|
5 |
|
$this->responseType = $methodName; |
66
|
5 |
|
} |
67
|
|
|
} |
68
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths