| Conditions | 4 |
| Paths | 8 |
| Total Lines | 13 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 20 |
| Changes | 0 | ||
| 1 | <?php |
||
| 28 | public function attach(string $name, $command): SymfonyCommand |
||
| 29 | { |
||
| 30 | if (is_string($command)) { |
||
| 31 | $command = $this->container->get($command); |
||
| 32 | } |
||
| 33 | if ($command instanceof Command) { |
||
| 34 | $command = new CommandAdapter($command); |
||
| 35 | } |
||
| 36 | if ($command = $this->application->add($command->setName($name))) { |
||
| 37 | return $command; |
||
| 38 | } |
||
| 39 | throw new RuntimeException("cannot attach the command"); |
||
| 40 | } |
||
| 41 | |||
| 50 |