Test Failed
Branch master (16bdc1)
by SignpostMarv
02:18
created

Track::SetTrack()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 1
dl 0
loc 5
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\CreativeWork\MusicRecording;
10
use SignpostMarv\DaftObject\SchemaOrg\Intangible\ItemList;
11
use SignpostMarv\DaftObject\SchemaOrg\TypeUtilities;
12
13
trait Track
14
{
15
    use DaftObjectTrait;
16
17
    /**
18
    * @return array<int, ItemList|MusicRecording>
19
    */
20
    public function GetTrack() : array
21
    {
22
        /**
23
        * @var array<int, ItemList|MusicRecording>
24
        */
25
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
26
            'track',
27
            $this->RetrievePropertyValueFromData('track'),
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

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