| Conditions | 1 |
| Paths | 1 |
| Total Lines | 15 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 23 | public function execute() |
||
| 24 | { |
||
| 25 | $document = new DocumentFactory(); |
||
| 26 | $carDocument = $document->create(DocumentFactory::CAR_DOCUMENT, |
||
| 27 | $this->preparedDocument->docId, |
||
| 28 | $this->preparedDocument->title, |
||
| 29 | $this->preparedDocument->description, |
||
| 30 | $this->preparedDocument->source |
||
| 31 | ); |
||
| 32 | |||
| 33 | $car = $this->repository->find($this->carId); |
||
| 34 | $car->addCarDocument($carDocument); |
||
|
|
|||
| 35 | |||
| 36 | $this->repository->add($car); |
||
| 37 | } |
||
| 38 | } |
||
| 39 |
If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:
If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.