| Conditions | 7 |
| Paths | 8 |
| Total Lines | 20 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 7 |
| Changes | 0 | ||
| 1 | <?php |
||
| 23 | 6 | public function aliasHelper(string $alias) |
|
| 24 | { |
||
| 25 | 6 | if (!($this instanceof AliasInterface)) { |
|
| 26 | 1 | throw RegisterException::noAlias(); |
|
| 27 | } |
||
| 28 | 5 | if (!$alias) { |
|
| 29 | 1 | throw RegisterException::blank(); |
|
| 30 | } |
||
| 31 | |||
| 32 | 4 | if (!in_array($alias, $this->alias)) { |
|
| 33 | 4 | $this->alias[] = $alias; |
|
|
|
|||
| 34 | } |
||
| 35 | |||
| 36 | 4 | if ($this instanceof ContainerAwareInterface && $this->isBound()) { |
|
| 37 | 1 | if (!$this->getManager()->isRegistered($alias)) { |
|
| 38 | 1 | $this->getManager()->register($this, $alias); |
|
| 39 | } |
||
| 40 | } |
||
| 41 | 4 | } |
|
| 42 | |||
| 43 | /** |
||
| 51 |