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

metaForDefaultsDisabled()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 6
rs 10
c 0
b 0
f 0
ccs 5
cts 5
cp 1
cc 1
nc 1
nop 1
crap 1
1
<?php declare(strict_types=1);
2
3
namespace EdmondsCommerce\DoctrineStaticMeta\Entity\Fields\Traits\Boolean;
4
5
use Doctrine\ORM\Mapping\Builder\ClassMetadataBuilder;
6
use EdmondsCommerce\DoctrineStaticMeta\Entity\Fields\Interfaces\Boolean\DefaultsDisabledFieldInterface;
7
use EdmondsCommerce\DoctrineStaticMeta\MappingHelper;
8
9
trait DefaultsDisabledFieldTrait
10
{
11
12
    /**
13
     * @var bool
14
     */
15
    private $defaultsDisabled = DefaultsDisabledFieldInterface::DEFAULT_DEFAULTS_DISABLED;
16
17
    /**
18
     * @SuppressWarnings(PHPMD.StaticAccess)
19
     * @param ClassMetadataBuilder $builder
20
     */
21 2
    public static function metaForDefaultsDisabled(ClassMetadataBuilder $builder): void
22
    {
23 2
        MappingHelper::setSimpleBooleanFields(
24 2
            [DefaultsDisabledFieldInterface::PROP_DEFAULTS_DISABLED],
25 2
            $builder,
26 2
            DefaultsDisabledFieldInterface::DEFAULT_DEFAULTS_DISABLED
27
        );
28 2
    }
29
30
    /**
31
     * @return bool
32
     */
33 2
    public function isDefaultsDisabled(): bool
34
    {
35 2
        return $this->defaultsDisabled;
36
    }
37
38
    /**
39
     * @param bool $defaultsDisabled
40
     *
41
     * @return self
42
     */
43 2
    private function setDefaultsDisabled(bool $defaultsDisabled): self
44
    {
45 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

45
        $this->/** @scrutinizer ignore-call */ 
46
               updatePropertyValue(
Loading history...
46 2
            DefaultsDisabledFieldInterface::PROP_DEFAULTS_DISABLED,
47 2
            $defaultsDisabled
48
        );
49
50 2
        return $this;
51
    }
52
53 2
    private function initDefaultDisabled(): void
54
    {
55 2
        $this->defaultsDisabled = DefaultsDisabledFieldInterface::DEFAULT_DEFAULTS_DISABLED;
56 2
    }
57
}
58