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

HasAddressEmbeddableTrait   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A metaForAddress() 0 5 1
A initAddress() 0 3 1
A getAddressEmbeddable() 0 3 1
A setAddressEmbeddable() 0 5 1
1
<?php declare(strict_types=1);
2
3
4
namespace EdmondsCommerce\DoctrineStaticMeta\Entity\Embeddable\Traits\Geo;
5
6
use Doctrine\ORM\Mapping\Builder\ClassMetadataBuilder;
7
use EdmondsCommerce\DoctrineStaticMeta\Entity\Embeddable\Interfaces\Geo\HasAddressEmbeddableInterface;
8
use EdmondsCommerce\DoctrineStaticMeta\Entity\Embeddable\Interfaces\Objects\Geo\AddressEmbeddableInterface;
9
use EdmondsCommerce\DoctrineStaticMeta\Entity\Embeddable\Objects\Geo\AddressEmbeddable;
10
11
trait HasAddressEmbeddableTrait
12
{
13
    /**
14
     * @var AddressEmbeddableInterface
15
     */
16
    private $addressEmbeddable;
17
18
19 2
    private function initAddress()
20
    {
21 2
        $this->addressEmbeddable = new AddressEmbeddable();
22 2
    }
23
24
    /**
25
     * @return AddressEmbeddableInterface
26
     */
27 2
    public function getAddressEmbeddable(): AddressEmbeddableInterface
28
    {
29 2
        return $this->addressEmbeddable;
30
    }
31
32
    /**
33
     * @param AddressEmbeddableInterface $address
34
     *
35
     * @return HasAddressEmbeddableInterface
36
     */
37 1
    public function setAddressEmbeddable(AddressEmbeddableInterface $address): HasAddressEmbeddableInterface
38
    {
39 1
        $this->addressEmbeddable = $address;
40
41 1
        return $this;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this returns the type EdmondsCommerce\Doctrine...sAddressEmbeddableTrait which is incompatible with the type-hinted return EdmondsCommerce\Doctrine...ressEmbeddableInterface.
Loading history...
42
    }
43
44
    /**
45
     * @param ClassMetadataBuilder $builder
46
     */
47 1
    protected static function metaForAddress(ClassMetadataBuilder $builder): void
48
    {
49 1
        $builder->createEmbedded(HasAddressEmbeddableInterface::PROP_ADDRESS, AddressEmbeddable::class)
50 1
                ->setColumnPrefix(HasAddressEmbeddableInterface::COLUMN_PREFIX_ADDRESS)
51 1
                ->build();
52 1
    }
53
}
54