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::setParameter()   A

Complexity

Conditions 4
Paths 6

Size

Total Lines 15
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 20

Importance

Changes 0
Metric Value
cc 4
eloc 8
nc 6
nop 3
dl 0
loc 15
ccs 0
cts 13
cp 0
crap 20
rs 10
c 0
b 0
f 0
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