UuidCrudRepository   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 18
c 0
b 0
f 0
wmc 2
lcom 0
cbo 2
ccs 8
cts 8
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A findByUuid() 0 6 1
A createFindByUuidQuery() 0 8 1
1
<?php
2
3
namespace Dontdrinkandroot\Repository;
4
5
use Doctrine\ORM\Query;
6
7
/**
8
 * @author Philip Washington Sorst <[email protected]>
9
 */
10
class UuidCrudRepository extends CrudRepository implements UuidCrudRepositoryInterface
0 ignored issues
show
Bug introduced by
There is at least one abstract method in this class. Maybe declare it as abstract, or implement the remaining methods: find, findAll, findBy, findOneBy, getClassName
Loading history...
11
{
12 6
    public function findByUuid(string $uuid): ?object
13
    {
14 6
        $query = $this->createFindByUuidQuery($uuid);
15
16 6
        return $query->getOneOrNullResult();
17
    }
18
19 6
    protected function createFindByUuidQuery($uuid): Query
20
    {
21 6
        $queryBuilder = $this->createQueryBuilder('entity');
0 ignored issues
show
Bug introduced by
The method createQueryBuilder() does not seem to exist on object<Dontdrinkandroot\...ory\UuidCrudRepository>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
22 6
        $queryBuilder->where('entity.uuid = :uuid');
23 6
        $queryBuilder->setParameter('uuid', $uuid);
24
25 6
        return $queryBuilder->getQuery();
26
    }
27
}
28