| Conditions | 2 |
| Paths | 2 |
| Total Lines | 11 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 48 | 1 | public function getConnectorByName(string $name) : ConnectorInterface |
|
| 49 | { |
||
| 50 | 1 | if (!isset($this->connectors[$name])) { |
|
| 51 | 1 | throw new InvalidArgumentException( |
|
| 52 | 1 | sprintf('% is not a registered connector name.', $name), |
|
| 53 | 1 | 1000 |
|
| 54 | ); |
||
| 55 | } |
||
| 56 | |||
| 57 | 1 | return clone $this->connectors[$name]; |
|
| 58 | } |
||
| 59 | } |
||
| 60 |
Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.