Association   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 9
c 0
b 0
f 0
dl 0
loc 45
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setFirst() 0 4 1
A getFirst() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace AlgoWeb\PODataLaravel\Models\ObjectMap\Entities\Associations;
6
7
abstract class Association
8
{
9
    /** @var array<int, string>  */
10
    protected $multArray = [
11
        AssociationStubRelationType::MANY => '*',
12
        AssociationStubRelationType::ONE => '1',
13
        AssociationStubRelationType::NULL_ONE => '0..1',
14
    ];
15
16
    /**
17
     * @var AssociationStubBase
18
     */
19
    protected $first;
20
21
    /**
22
     * @return AssociationStubBase
23
     */
24
    public function getFirst(): AssociationStubBase
25
    {
26
        return $this->first;
27
    }
28
29
    /**
30
     * @param AssociationStubBase $first
31
     */
32
    public function setFirst(AssociationStubBase $first): void
33
    {
34
        $this->first = $first;
35
        $first->addAssociation($this);
36
    }
37
38
    /**
39
     * @return AssociationStubBase|AssociationStubBase[]
40
     */
41
    abstract public function getLast();
42
43
    /**
44
     * @return bool
45
     */
46
    abstract public function isOk(): bool;
47
48
    /**
49
     * @return AssociationType|AssociationType[]
50
     */
51
    abstract public function getAssociationType();
52
}
53