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
28:39
created

HasAddressEmbeddableTrait   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

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
     * Called at construction time
20
     */
21 2
    private function initAddress()
22
    {
23 2
        $this->addressEmbeddable = new AddressEmbeddable();
24 2
    }
25
26
    /**
27
     * @return AddressEmbeddableInterface
28
     */
29 2
    public function getAddressEmbeddable(): AddressEmbeddableInterface
30
    {
31 2
        return $this->addressEmbeddable;
32
    }
33
34
    /**
35
     * @param AddressEmbeddableInterface $address
36
     *
37
     * @return $this
38
     */
39 1
    public function setAddressEmbeddable(AddressEmbeddableInterface $address): self
40
    {
41 1
        $this->addressEmbeddable = $address;
42
43 1
        return $this;
44
    }
45
46
    /**
47
     * @param ClassMetadataBuilder $builder
48
     */
49 1
    protected static function metaForAddress(ClassMetadataBuilder $builder): void
50
    {
51 1
        $builder->createEmbedded(HasAddressEmbeddableInterface::PROP_ADDRESS, AddressEmbeddable::class)
52 1
                ->setColumnPrefix(HasAddressEmbeddableInterface::COLUMN_PREFIX_ADDRESS)
53 1
                ->build();
54 1
    }
55
}
56