Passed
Push — master ( f71194...439e24 )
by SignpostMarv
11:18
created

HasLogo   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 12
dl 0
loc 31
ccs 12
cts 12
cp 1
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A GetLogo() 0 12 1
A SetLogo() 0 7 1
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\MediaObject\ImageObject;
10
use SignpostMarv\DaftObject\SchemaOrg\TypeUtilities;
11
12
trait HasLogo
13
{
14
    use DaftObjectTrait;
15
16
    /**
17
    * @return array<int, ImageObject>
18
    */
19 87
    public function GetLogo() : array
20
    {
21
        /**
22
        * @var array<int, ImageObject>
23
        */
24 87
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
25 87
            'logo',
26 87
            $this->RetrievePropertyValueFromData('logo'),
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

26
            $this->/** @scrutinizer ignore-call */ 
27
                   RetrievePropertyValueFromData('logo'),
Loading history...
27 87
            static::class
28
        );
29
30 87
        return $out;
31
    }
32
33
    /**
34
    * @param array<int, ImageObject> $value
35
    */
36 3
    public function SetLogo(array $value) : void
37
    {
38 3
        $this->NudgePropertyWithUniqueValuesOfThings(
39 3
            'logo',
40 3
            __METHOD__,
41 3
            $value,
42 3
            ImageObject::class
43
        );
44 3
    }
45
}
46