| Conditions | 3 |
| Paths | 3 |
| Total Lines | 12 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 22 | 1 | public function upcaster(array $payload): ?Upcaster |
|
| 23 | { |
||
| 24 | 1 | $type = $payload['headers'][Header::EVENT_TYPE]; |
|
| 25 | |||
| 26 | 1 | foreach ($this->upcasters[$type] ?? [] as $upcaster) { |
|
| 27 | 1 | if ($upcaster->canUpcast($type, $payload)) { |
|
| 28 | 1 | return $upcaster; |
|
| 29 | } |
||
| 30 | } |
||
| 31 | |||
| 32 | 1 | return null; |
|
| 33 | } |
||
| 34 | |||
| 50 | } |