| Total Complexity | 6 |
| Total Lines | 38 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | abstract class AbstractFacade |
||
| 19 | { |
||
| 20 | /** @var array<string, AbstractFactory> */ |
||
| 21 | private static array $factories = []; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * @param list<mixed> $arguments |
||
| 25 | */ |
||
| 26 | public static function __callStatic(string $name = '', array $arguments = []) |
||
| 27 | { |
||
| 28 | if ($name === 'getFactory') { |
||
| 29 | return self::doGetFactory(); |
||
| 30 | } |
||
| 31 | |||
| 32 | throw new RuntimeException(sprintf("Method unknown: '%s'", $name)); |
||
| 33 | } |
||
| 34 | |||
| 35 | /** |
||
| 36 | * @param list<mixed> $arguments |
||
| 37 | */ |
||
| 38 | public function __call(string $name = '', array $arguments = []) |
||
| 39 | { |
||
| 40 | if ($name === 'getFactory') { |
||
| 41 | return self::doGetFactory(); |
||
| 42 | } |
||
| 43 | |||
| 44 | throw new RuntimeException(sprintf("Method unknown: '%s'", $name)); |
||
| 45 | } |
||
| 46 | |||
| 47 | public static function resetCache(): void |
||
| 50 | } |
||
| 51 | |||
| 52 | private static function doGetFactory(): AbstractFactory |
||
| 56 | } |
||
| 57 | } |
||
| 58 |