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 ( 69b831...bd71a5 )
by joseph
20:49 queued 13s
created

DefaultsNullFieldTrait   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

3 Methods

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

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