GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( d68f0e...658fac )
by Ross
14s queued 12s
created

UuidQueryBuilder   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 9
dl 0
loc 17
ccs 0
cts 13
cp 0
rs 10
c 0
b 0
f 0
wmc 4

1 Method

Rating   Name   Duplication   Size   Complexity  
A setParameter() 0 15 4
1
<?php declare(strict_types=1);
2
3
namespace EdmondsCommerce\DoctrineStaticMeta\Entity\Repositories;
4
5
use Doctrine\ORM\QueryBuilder;
6
use EdmondsCommerce\DoctrineStaticMeta\Entity\Interfaces\EntityInterface;
7
use EdmondsCommerce\DoctrineStaticMeta\MappingHelper;
8
use Ramsey\Uuid\UuidInterface;
9
10
class UuidQueryBuilder extends QueryBuilder
11
{
12
    public function setParameter($key, $value, $type = null): self
13
    {
14
        if ($value instanceof EntityInterface) {
15
            $value = $value->getId();
16
        }
17
        if ($value instanceof UuidInterface) {
18
            if (null === $type) {
19
                $type = MappingHelper::TYPE_UUID;
20
            }
21
            $value = $value->toString();
22
        }
23
24
        parent::setParameter($key, $value, $type);
25
26
        return $this;
27
    }
28
}
29