1 | <?php |
||
13 | abstract class LeagueContainer extends Container implements BridgeInterface |
||
14 | { |
||
15 | |||
16 | /** |
||
17 | * The registered type aliases. |
||
18 | * |
||
19 | * @var array |
||
20 | */ |
||
21 | protected $aliases = []; |
||
22 | |||
23 | use ContainerArrayAccessTrait; |
||
24 | |||
25 | /** |
||
26 | * @inheritdoc |
||
27 | */ |
||
28 | 1 | public function set($alias, $concrete = null, $share = false) |
|
32 | |||
33 | /** |
||
34 | * @inheritdoc |
||
35 | */ |
||
36 | public function remove($alias) |
||
39 | |||
40 | /** |
||
41 | * Determine if a given string is an alias. |
||
42 | * |
||
43 | * @param string $name |
||
44 | * @return bool |
||
45 | */ |
||
46 | public function isAlias($name) |
||
50 | |||
51 | /** |
||
52 | * Alias a type to a different name. |
||
53 | * |
||
54 | * @param string $abstract |
||
55 | * @param string $alias |
||
56 | * @return void |
||
57 | */ |
||
58 | 1 | public function alias($abstract, $alias) |
|
59 | { |
||
60 | 1 | $this->aliases[$alias] = $abstract; |
|
61 | // $this->abstractAliases[$abstract][] = $alias; |
||
|
|||
62 | |||
63 | 1 | $this->share($alias, function () use ($abstract) { |
|
64 | 1 | return $this->get($abstract); |
|
65 | 1 | }); |
|
66 | 1 | } |
|
67 | |||
68 | /** |
||
69 | * Get the alias for an abstract if available. |
||
70 | * |
||
71 | * @param string $abstract |
||
72 | * @return string |
||
73 | * |
||
74 | * @throws \LogicException |
||
75 | */ |
||
76 | public function getAlias($abstract) |
||
86 | } |
||
87 |
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.
The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.
This check looks for comments that seem to be mostly valid code and reports them.