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 ( 2a6b46...0d82f1 )
by joseph
20s queued 14s
created

DefaultsNullFieldTrait   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 11
dl 0
loc 42
ccs 0
cts 13
cp 0
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setDefaultsNull() 0 8 1
A metaForDefaultsNull() 0 6 1
A isDefaultsNull() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace EdmondsCommerce\DoctrineStaticMeta\Entity\Fields\Traits\Boolean;
6
7
// phpcs:disable
8
9
use Doctrine\ORM\Mapping\Builder\ClassMetadataBuilder;
10
use EdmondsCommerce\DoctrineStaticMeta\Entity\Fields\Interfaces\Boolean\DefaultsNullFieldInterface;
11
use EdmondsCommerce\DoctrineStaticMeta\MappingHelper;
12
use Symfony\Component\Validator\Mapping\ClassMetadata as ValidatorClassMetaData;
13
14
// phpcs:enable
15
trait DefaultsNullFieldTrait
16
{
17
18
    /**
19
     * @var bool|null
20
     */
21
    private $defaultsNull;
22
23
    /**
24
     * @SuppressWarnings(PHPMD.StaticAccess)
25
     * @param ClassMetadataBuilder $builder
26
     */
27
    public static function metaForDefaultsNull(ClassMetadataBuilder $builder): void
28
    {
29
        MappingHelper::setSimpleBooleanFields(
30
            [DefaultsNullFieldInterface::PROP_DEFAULTS_NULL],
31
            $builder,
32
            DefaultsNullFieldInterface::DEFAULT_DEFAULTS_NULL
33
        );
34
    }
35
36
    /**
37
     * @return bool|null
38
     */
39
    public function isDefaultsNull(): ?bool
40
    {
41
        return $this->defaultsNull;
42
    }
43
44
    /**
45
     * @param bool|null $defaultsNull
46
     *
47
     * @return self
48
     */
49
    private function setDefaultsNull(?bool $defaultsNull): self
50
    {
51
        $this->updatePropertyValue(
0 ignored issues
show
Bug introduced by
It seems like updatePropertyValue() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

51
        $this->/** @scrutinizer ignore-call */ 
52
               updatePropertyValue(
Loading history...
52
            DefaultsNullFieldInterface::PROP_DEFAULTS_NULL,
53
            $defaultsNull
54
        );
55
56
        return $this;
57
    }
58
}
59