| Conditions | 2 |
| Paths | 2 |
| Total Lines | 9 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php declare(strict_types=1); |
||
| 29 | 35 | protected function searchItemGenerator(array $results, string $class) |
|
| 30 | { |
||
| 31 | 35 | $this->logger->debug('Starting search item generator', array('results' => $results, 'class' => $class)); |
|
|
|
|||
| 32 | 35 | foreach ($results as $result) { |
|
| 33 | 32 | $element = new $class($this->tmdb, $result); |
|
| 34 | |||
| 35 | 32 | yield $element; |
|
| 36 | } |
||
| 37 | 10 | } |
|
| 38 | } |
||
| 39 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: