Passed
Push — master ( 85dfa5...b7b55a )
by SignpostMarv
04:48
created

Issn::GetIssn()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
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 0
dl 0
loc 12
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\TypeUtilities;
10
11
trait Issn
12
{
13
    use DaftObjectTrait;
14
15
    /**
16
    * @return array<int, string>
17
    */
18 6
    public function GetIssn() : array
19
    {
20
        /**
21
        * @var array<int, string>
22
        */
23 6
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
24 6
            'issn',
25 6
            $this->RetrievePropertyValueFromData('issn'),
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('issn'),
Loading history...
26 6
            static::class
27
        );
28
29 6
        return $out;
30
    }
31
32
    /**
33
    * @param array<int, string> $value
34
    */
35 2
    public function SetIssn(array $value) : void
36
    {
37 2
        $this->NudgePropertyWithUniqueTrimmedStringsMightNotBeString(
0 ignored issues
show
Bug introduced by
It seems like NudgePropertyWithUniqueT...ringsMightNotBeString() 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

37
        $this->/** @scrutinizer ignore-call */ 
38
               NudgePropertyWithUniqueTrimmedStringsMightNotBeString(
Loading history...
38 2
            'issn',
39 2
            __METHOD__,
40 2
            $value
41
        );
42 2
    }
43
}
44