| Conditions | 4 |
| Paths | 3 |
| Total Lines | 15 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 4.25 |
| Changes | 0 | ||
| 1 | <?php |
||
| 51 | 1 | public static function findByKey(string $key): ?CustomExport |
|
| 52 | { |
||
| 53 | 1 | $customExports = static::$exports; |
|
| 54 | 1 | if(!empty($customExports)) { |
|
| 55 | /** @var CustomExport $export */ |
||
| 56 | 1 | foreach ($customExports as $export) { |
|
| 57 | 1 | if($export::key() != $key) { |
|
| 58 | continue; |
||
| 59 | } |
||
| 60 | |||
| 61 | 1 | return new $export; |
|
| 62 | } |
||
| 63 | } |
||
| 64 | |||
| 65 | return null; |
||
| 66 | } |
||
| 68 |