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 ( 810b23...1b23c8 )
by joseph
12s
created

DefaultsDisabledFieldTrait::initDefaultDisabled()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
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 1
    public static function metaForDefaultsDisabled(ClassMetadataBuilder $builder): void
22
    {
23 1
        MappingHelper::setSimpleBooleanFields(
24 1
            [DefaultsDisabledFieldInterface::PROP_DEFAULTS_DISABLED],
25 1
            $builder,
26 1
            DefaultsDisabledFieldInterface::DEFAULT_DEFAULTS_DISABLED
27
        );
28 1
    }
29
30 2
    private function initDefaultDisabled()
31
    {
32 2
        $this->defaultsDisabled = DefaultsDisabledFieldInterface::DEFAULT_DEFAULTS_DISABLED;
33 2
    }
34
35
    /**
36
     * @return bool
37
     */
38 2
    public function isDefaultsDisabled(): bool
39
    {
40 2
        return $this->defaultsDisabled;
41
    }
42
43
    /**
44
     * @param bool $defaultsDisabled
45
     *
46
     * @return self
47
     */
48 2
    public function setDefaultsDisabled(bool $defaultsDisabled): self
49
    {
50 2
        $this->updatePropertyValueThenValidateAndNotify(
0 ignored issues
show
Bug introduced by
It seems like updatePropertyValueThenValidateAndNotify() 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

50
        $this->/** @scrutinizer ignore-call */ 
51
               updatePropertyValueThenValidateAndNotify(
Loading history...
51 2
            DefaultsDisabledFieldInterface::PROP_DEFAULTS_DISABLED,
52 2
            $defaultsDisabled
53
        );
54
55 2
        return $this;
56
    }
57
}
58