| Total Complexity | 6 |
| Total Lines | 56 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 15 | abstract class MysqlRepository |
||
| 16 | { |
||
| 17 | /** |
||
| 18 | * @param object $model |
||
| 19 | */ |
||
| 20 | public function register(object $model): void |
||
| 21 | { |
||
| 22 | $this->entityManager->persist($model); |
||
| 23 | $this->apply(); |
||
| 24 | } |
||
| 25 | |||
| 26 | public function apply(): void |
||
| 29 | } |
||
| 30 | |||
| 31 | /** |
||
| 32 | * @throws NotFoundHttpException |
||
| 33 | * @throws \Doctrine\ORM\NonUniqueResultException |
||
| 34 | */ |
||
| 35 | protected function oneOrException(QueryBuilder $queryBuilder) |
||
| 36 | { |
||
| 37 | $model = $queryBuilder |
||
| 38 | ->getQuery() |
||
| 39 | ->getOneOrNullResult(); |
||
| 40 | if (null === $model) { |
||
| 41 | throw new NotFoundHttpException(); |
||
| 42 | } |
||
| 43 | |||
| 44 | return $model; |
||
| 45 | } |
||
| 46 | |||
| 47 | private function setRepository(string $model): void |
||
| 48 | { |
||
| 49 | /** @var EntityRepository $objectRepository */ |
||
| 50 | $objectRepository = $this->entityManager->getRepository($model); |
||
| 51 | $this->repository = $objectRepository; |
||
| 52 | } |
||
| 53 | |||
| 54 | /** |
||
| 55 | * MysqlRepository constructor. |
||
| 56 | */ |
||
| 57 | public function __construct(EntityManagerInterface $entityManager) |
||
| 61 | } |
||
| 62 | |||
| 63 | /** @var string */ |
||
| 64 | protected $class; |
||
| 65 | /** @var EntityRepository */ |
||
| 66 | protected $repository; |
||
| 67 | /** |
||
| 68 | * @var EntityManagerInterface |
||
| 69 | */ |
||
| 70 | protected $entityManager; |
||
| 71 | } |
||
| 72 |
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