Passed
Push — master ( ffa34c...f9eaa3 )
by SignpostMarv
12:18
created

TraitSupersededBy::SetSupersededBy()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 1
dl 0
loc 5
ccs 4
cts 4
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
* @author SignpostMarv
4
*/
5
declare(strict_types=1);
6
7
namespace SignpostMarv\DaftObject\SchemaOrg\DaftObjectTraits;
8
9
use SignpostMarv\DaftObject\SchemaOrg\Intangible\Enumeration;
10
use SignpostMarv\DaftObject\SchemaOrg\Intangible\IntangibleClass;
11
use SignpostMarv\DaftObject\SchemaOrg\Intangible\IntangibleProperty;
12
use SignpostMarv\DaftObject\SchemaOrg\TypeUtilities;
13
14
trait TraitSupersededBy
15
{
16
    use DaftObjectTrait;
17
18
    /**
19
    * @return array<int, IntangibleClass|Enumeration|IntangibleProperty>
20
    */
21 110
    public function GetSupersededBy() : array
22
    {
23
        /**
24
        * @var array<int, IntangibleClass|Enumeration|IntangibleProperty>
25
        */
26 110
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
27 110
            'supersededBy',
28 110
            $this->RetrievePropertyValueFromData('supersededBy'),
0 ignored issues
show
Bug introduced by
It seems like RetrievePropertyValueFromData() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

28
            $this->/** @scrutinizer ignore-call */ 
29
                   RetrievePropertyValueFromData('supersededBy'),
Loading history...
29 110
            static::class
30
        );
31
32 110
        return $out;
33
    }
34
35
    /**
36
    * @param array<int, IntangibleClass|Enumeration|IntangibleProperty> $value
37
    */
38 24
    public function SetSupersededBy(array $value) : void
39
    {
40 24
        $this->NudgePropertyValue(
41 24
            'supersededBy',
42 24
            $value
43
        );
44 24
    }
45
}
46