| Total Complexity | 5 |
| Total Lines | 51 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 21 | trait HasAliasesTrait { |
||
| 22 | /** |
||
| 23 | * Aliases. |
||
| 24 | * |
||
| 25 | * @var array<string, string|Closure> |
||
| 26 | */ |
||
| 27 | protected $aliases = []; |
||
| 28 | |||
| 29 | /** |
||
| 30 | * Register an alias. |
||
| 31 | * |
||
| 32 | * @param string $alias |
||
| 33 | * @param string|Closure $target |
||
| 34 | * @return void |
||
| 35 | */ |
||
| 36 | public function alias( $alias, $target ) { |
||
| 37 | $this->aliases[ $alias ] = $target; |
||
| 38 | } |
||
| 39 | |||
| 40 | /** |
||
| 41 | * Get whether an alias is registered. |
||
| 42 | * |
||
| 43 | * @param string $alias |
||
| 44 | * @return boolean |
||
| 45 | */ |
||
| 46 | public function hasAlias( $alias ) { |
||
| 48 | } |
||
| 49 | |||
| 50 | public function __call( $method, $parameters ) { |
||
| 63 | } |
||
| 64 | |||
| 65 | /** |
||
| 66 | * Resolve a dependency from the IoC container. |
||
| 67 | * |
||
| 68 | * @param string $key |
||
| 69 | * @return mixed|null |
||
| 70 | */ |
||
| 71 | abstract public function resolve( $key ); |
||
| 72 | } |
||
| 73 |