Passed
Branch fuzzy-generators (9f9b2f)
by SignpostMarv
11:06
created

HasInLanguage::SetInLanguage()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 5
nc 1
nop 1
dl 0
loc 7
ccs 6
cts 6
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\Language;
10
use SignpostMarv\DaftObject\SchemaOrg\TypeUtilities;
11
12
trait HasInLanguage
13
{
14
    use DaftObjectTrait;
15
16
    /**
17
    * @return array<int, string|Language>
18
    */
19 243
    public function GetInLanguage() : array
20
    {
21
        /**
22
        * @var array<int, string|Language>
23
        */
24 243
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
25 243
            'inLanguage',
26 243
            $this->RetrievePropertyValueFromData('inLanguage'),
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('inLanguage'),
Loading history...
27 243
            static::class
28
        );
29
30 243
        return $out;
31
    }
32
33
    /**
34
    * @param array<int, string|Language> $value
35
    */
36 61
    public function SetInLanguage(array $value) : void
37
    {
38 61
        $this->NudgePropertyWithUniqueTrimmedStringsOrThings(
0 ignored issues
show
Bug introduced by
The method NudgePropertyWithUniqueTrimmedStringsOrThings() does not exist on SignpostMarv\DaftObject\...ectTraits\HasInLanguage. 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

38
        $this->/** @scrutinizer ignore-call */ 
39
               NudgePropertyWithUniqueTrimmedStringsOrThings(

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...
39 61
            'inLanguage',
40 61
            __METHOD__,
41 61
            $value,
42 61
            Language::class
43
        );
44 61
    }
45
}
46