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
Pull Request — master (#152)
by joseph
17:58
created

Traits/Identity/HasFullNameEmbeddableTrait.php (1 issue)

Labels
Severity
1
<?php declare(strict_types=1);
2
3
namespace EdmondsCommerce\DoctrineStaticMeta\Entity\Embeddable\Traits\Identity;
4
5
use Doctrine\ORM\Events;
6
use Doctrine\ORM\Mapping\Builder\ClassMetadataBuilder;
7
use EdmondsCommerce\DoctrineStaticMeta\Entity\Embeddable\Interfaces\Identity\HasFullNameEmbeddableInterface;
8
use EdmondsCommerce\DoctrineStaticMeta\Entity\Embeddable\Interfaces\Objects\Identity\FullNameEmbeddableInterface;
9
use EdmondsCommerce\DoctrineStaticMeta\Entity\Embeddable\Objects\Identity\FullNameEmbeddable;
10
11
trait HasFullNameEmbeddableTrait
12
{
13
    /**
14
     * @var FullNameEmbeddableInterface
15
     */
16
    private $fullNameEmbeddable;
17
18
    /**
19
     * @param ClassMetadataBuilder $builder
20
     */
21
    protected static function metaForFullNameEmbeddable(ClassMetadataBuilder $builder): void
22
    {
23
        $builder->addLifecycleEvent(
24
            'postLoadSetOwningEntityOnFullNameEmbeddable',
25
            Events::postLoad
26
        );
27
        $builder->createEmbedded(
28
            HasFullNameEmbeddableInterface::PROP_FULL_NAME_EMBEDDABLE,
29
            FullNameEmbeddable::class
30
        )
31
                ->setColumnPrefix(
32
                    HasFullNameEmbeddableInterface::COLUMN_PREFIX_FULL_NAME
33
                )
34
                ->build();
35
    }
36
37
    /**
38
     * @return mixed
39
     */
40
    public function getFullNameEmbeddable(): FullNameEmbeddableInterface
41
    {
42
        return $this->fullNameEmbeddable;
43
    }
44
45
    public function postLoadSetOwningEntityOnFullNameEmbeddable(): void
46
    {
47
        $this->fullNameEmbeddable->setOwningEntity($this);
0 ignored issues
show
The method setOwningEntity() does not exist on EdmondsCommerce\Doctrine...NameEmbeddableInterface. Since it exists in all sub-types, consider adding an abstract or default implementation to EdmondsCommerce\Doctrine...NameEmbeddableInterface. ( 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->fullNameEmbeddable->/** @scrutinizer ignore-call */ 
48
                                   setOwningEntity($this);
Loading history...
48
    }
49
50
    /**
51
     * Called at construction time
52
     */
53
    private function initFullNameEmbeddable(): void
54
    {
55
        $this->setFullNameEmbeddable(new FullNameEmbeddable(), false);
56
    }
57
58
    /**
59
     * @param mixed $fullNameEmbeddable
60
     *
61
     * @param bool  $notify
62
     *
63
     * @return $this
64
     * @SuppressWarnings(PHPMD.BooleanArgumentFlag)
65
     */
66
    private function setFullNameEmbeddable($fullNameEmbeddable, bool $notify = true): self
67
    {
68
        $this->fullNameEmbeddable = $fullNameEmbeddable;
69
        $this->fullNameEmbeddable->setOwningEntity($this);
70
        if (true === $notify) {
71
            $this->notifyEmbeddablePrefixedProperties(
72
                HasFullNameEmbeddableInterface::PROP_FULL_NAME_EMBEDDABLE
73
            );
74
        }
75
76
        return $this;
77
    }
78
}
79