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 (#58)
by joseph
18:31
created

HasFullNameEmbeddableTrait   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
dl 0
loc 38
rs 10
c 0
b 0
f 0
ccs 12
cts 12
cp 1

4 Methods

Rating   Name   Duplication   Size   Complexity  
A metaForFullNameEmbeddable() 0 5 1
A setFullNameEmbeddable() 0 5 1
A initFullName() 0 3 1
A getFullNameEmbeddable() 0 3 1
1
<?php declare(strict_types=1);
2
3
namespace EdmondsCommerce\DoctrineStaticMeta\Entity\Embeddable\Traits\Identity;
4
5
use Doctrine\ORM\Mapping\Builder\ClassMetadataBuilder;
6
use EdmondsCommerce\DoctrineStaticMeta\Entity\Embeddable\Interfaces\Identity\HasFullNameEmbeddableInterface;
7
use EdmondsCommerce\DoctrineStaticMeta\Entity\Embeddable\Interfaces\Objects\Identity\FullNameEmbeddableInterface;
8
use EdmondsCommerce\DoctrineStaticMeta\Entity\Embeddable\Objects\Identity\FullNameEmbeddable;
9
10
trait HasFullNameEmbeddableTrait
11
{
12
    private $fullNameEmbeddable;
13
14 2
    private function initFullName()
15
    {
16 2
        $this->fullNameEmbeddable = new FullNameEmbeddable();
17 2
    }
18
19
20
    /**
21
     * @return mixed
22
     */
23 2
    public function getFullNameEmbeddable(): FullNameEmbeddableInterface
24
    {
25 2
        return $this->fullNameEmbeddable;
26
    }
27
28
    /**
29
     * @param mixed $fullNameEmbeddable
30
     *
31
     * @return HasFullNameEmbeddableInterface
32
     */
33 1
    public function setFullNameEmbeddable($fullNameEmbeddable): HasFullNameEmbeddableInterface
34
    {
35 1
        $this->fullNameEmbeddable = $fullNameEmbeddable;
36
37 1
        return $this;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this returns the type EdmondsCommerce\Doctrine...FullNameEmbeddableTrait which is incompatible with the type-hinted return EdmondsCommerce\Doctrine...NameEmbeddableInterface.
Loading history...
38
    }
39
40
    /**
41
     * @param ClassMetadataBuilder $builder
42
     */
43 1
    protected static function metaForFullNameEmbeddable(ClassMetadataBuilder $builder): void
44
    {
45 1
        $builder->createEmbedded(HasFullNameEmbeddableInterface::PROP_FULL_NAME, FullNameEmbeddable::class)
46 1
                ->setColumnPrefix(HasFullNameEmbeddableInterface::COLUMN_PREFIX_FULL_NAME)
47 1
                ->build();
48 1
    }
49
}
50