| Conditions | 4 |
| Paths | 4 |
| Total Lines | 30 |
| Code Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 20 |
| Changes | 0 | ||
| 1 | <?php |
||
| 22 | public function enrich( |
||
| 23 | AlbumInterface $album, |
||
| 24 | AudioFileInterface $audioFile, |
||
| 25 | ): void { |
||
| 26 | $genres = $audioFile->getGenres(); |
||
| 27 | |||
| 28 | if ($genres === []) { |
||
| 29 | return; |
||
| 30 | } |
||
| 31 | |||
| 32 | foreach ($genres as $genre_name) { |
||
| 33 | $cachedGenre = $this->genreRepository->findOneBy([ |
||
| 34 | 'title' => $genre_name, |
||
| 35 | ]); |
||
| 36 | |||
| 37 | if ($cachedGenre === null) { |
||
| 38 | $cachedGenre = $this->genreRepository |
||
| 39 | ->prototype() |
||
| 40 | ->setTitle($genre_name); |
||
| 41 | |||
| 42 | $this->genreRepository->save($cachedGenre); |
||
| 43 | } |
||
| 44 | |||
| 45 | $mapped_genre = $this->genreMapRepository |
||
| 46 | ->prototype() |
||
| 47 | ->setGenre($cachedGenre) |
||
| 48 | ->setMappedItemType(GenreMapEnum::ALBUM) |
||
| 49 | ->setMappedItemId($album->getId()); |
||
| 50 | |||
| 51 | $this->genreMapRepository->save($mapped_genre); |
||
| 52 | } |
||
| 55 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths