Conditions | 5 |
Paths | 2 |
Total Lines | 16 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
30 | public static function findAentsByHandledEvent(string $handledEvent): array |
||
31 | { |
||
32 | $containerProjectDir = Pheromone::getContainerProjectDirectory(); |
||
33 | |||
34 | $aenthillJSONstr = file_get_contents($containerProjectDir . '/aenthill.json'); |
||
35 | $aenthillJSON = \GuzzleHttp\json_decode($aenthillJSONstr, true); |
||
36 | |||
37 | $aents = array(); |
||
38 | if (isset($aenthillJSON['aents'])) { |
||
39 | foreach ($aenthillJSON['aents'] as $aent) { |
||
40 | if (array_key_exists('handled_events', $aent) && \in_array($handledEvent, $aent['handled_events'], true)) { |
||
41 | $aents[] = $aent; |
||
42 | } |
||
43 | } |
||
44 | } |
||
45 | return $aents; |
||
46 | } |
||
59 |