Passed
Push — master ( df1a48...669ccb )
by SignpostMarv
04:37
created

Composer::SetComposer()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
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\TypeUtilities;
10
11
trait Composer
12
{
13
    use DaftObjectTrait;
14
15
    /**
16
    * @return array<int, \SignpostMarv\DaftObject\SchemaOrg\Organization|\SignpostMarv\DaftObject\SchemaOrg\Person>
17
    */
18 4
    public function GetComposer() : array
19
    {
20
        /**
21
        * @var array<int, \SignpostMarv\DaftObject\SchemaOrg\Organization|\SignpostMarv\DaftObject\SchemaOrg\Person>
22
        */
23 4
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
24 4
            'composer',
25 4
            $this->RetrievePropertyValueFromData('composer'),
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

25
            $this->/** @scrutinizer ignore-call */ 
26
                   RetrievePropertyValueFromData('composer'),
Loading history...
26 4
            static::class
27
        );
28
29 4
        return $out;
30
    }
31
32
    /**
33
    * @param array<int, \SignpostMarv\DaftObject\SchemaOrg\Organization|\SignpostMarv\DaftObject\SchemaOrg\Person> $value
34
    */
35
    public function SetComposer(array $value) : void
36
    {
37
        $this->NudgePropertyWithUniqueOrganizationsOrPersons('composer', __METHOD__, $value);
0 ignored issues
show
Bug introduced by
The method NudgePropertyWithUniqueOrganizationsOrPersons() does not exist on SignpostMarv\DaftObject\...ftObjectTraits\Composer. Did you maybe mean NudgePropertyWithUniqueValuesOfThings()? ( Ignorable by Annotation )

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

37
        $this->/** @scrutinizer ignore-call */ 
38
               NudgePropertyWithUniqueOrganizationsOrPersons('composer', __METHOD__, $value);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
38
    }
39
}
40