| Total Complexity | 9 |
| Total Lines | 61 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 21 | trait ClassmapTrait |
||
| 22 | { |
||
| 23 | /** |
||
| 24 | * service objects stored by its classname |
||
| 25 | * |
||
| 26 | * @var object[] |
||
| 27 | */ |
||
| 28 | protected $classMap = []; |
||
| 29 | |||
| 30 | /** |
||
| 31 | * has service created by its classname/interface name already? |
||
| 32 | * returns the matching classname or NULL |
||
| 33 | * |
||
| 34 | * @param string $className |
||
| 35 | * @return string|NULL |
||
| 36 | */ |
||
| 37 | protected function hasClass(string $className): ?string |
||
| 58 | } |
||
| 59 | |||
| 60 | /** |
||
| 61 | * Retrieve object from classmap if match found |
||
| 62 | * |
||
| 63 | * @param string $className |
||
| 64 | * @return object|null |
||
| 65 | */ |
||
| 66 | protected function matchClass(string $className): ?object |
||
| 72 | } |
||
| 73 | |||
| 74 | /** |
||
| 75 | * Store object in classmap |
||
| 76 | * |
||
| 77 | * @param object $object |
||
| 78 | */ |
||
| 79 | protected function storeClass(object $object): void |
||
| 82 | } |
||
| 83 | } |