| Conditions | 6 |
| Paths | 10 |
| Total Lines | 22 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 25 | protected function getProject($packageName = null) { |
||
|
|
|||
| 26 | if ($this->prj === null) { |
||
| 27 | if ($packageName === null) { |
||
| 28 | $input = $this->io->getInput(); |
||
| 29 | $packageName = $input->getOption('package'); |
||
| 30 | if (empty($packageName)) { |
||
| 31 | $packageName = $this->package->getFullName(); |
||
| 32 | } |
||
| 33 | } |
||
| 34 | |||
| 35 | if ($this->package->getFullName() == $packageName) { |
||
| 36 | $this->prj = $this->project; |
||
| 37 | } else { |
||
| 38 | $path = 'vendor/' . $packageName; |
||
| 39 | if (!file_exists($path)) { |
||
| 40 | throw new \RuntimeException(sprintf('Package (%s) cannot be found', $packageName)); |
||
| 41 | } |
||
| 42 | $this->prj = new Project($path); |
||
| 43 | } |
||
| 44 | } |
||
| 45 | return $this->prj; |
||
| 46 | } |
||
| 47 | |||
| 48 | } |
Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a
@returnannotation as described here.