| Total Complexity | 5 |
| Total Lines | 51 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 14 | trait HasAliasesTrait { |
||
| 15 | /** |
||
| 16 | * Aliases. |
||
| 17 | * |
||
| 18 | * @var array<string, string|Closure> |
||
| 19 | */ |
||
| 20 | protected $aliases = []; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * Register an alias. |
||
| 24 | * |
||
| 25 | * @param string $alias |
||
| 26 | * @param string|Closure $target |
||
| 27 | * @return void |
||
| 28 | */ |
||
| 29 | public function alias( $alias, $target ) { |
||
| 30 | $this->aliases[ $alias ] = $target; |
||
| 31 | } |
||
| 32 | |||
| 33 | /** |
||
| 34 | * Get whether an alias is registered. |
||
| 35 | * |
||
| 36 | * @param string $alias |
||
| 37 | * @return boolean |
||
| 38 | */ |
||
| 39 | public function hasAlias( $alias ) { |
||
| 41 | } |
||
| 42 | |||
| 43 | public function __call( $method, $parameters ) { |
||
| 56 | } |
||
| 57 | |||
| 58 | /** |
||
| 59 | * Resolve a dependency from the IoC container. |
||
| 60 | * |
||
| 61 | * @param string $key |
||
| 62 | * @return mixed|null |
||
| 63 | */ |
||
| 64 | abstract public function resolve( $key ); |
||
| 65 | } |
||
| 66 |