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

DefaultsDisabledFieldTrait   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 47
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 12
dl 0
loc 47
ccs 0
cts 15
cp 0
rs 10
c 0
b 0
f 0
wmc 4

4 Methods

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

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