Test Failed
Push — master ( 4486b3...16bdc1 )
by SignpostMarv
02:20
created

DateCreatedModified   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 8
dl 0
loc 44
rs 10
c 0
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A SetDateModified() 0 3 1
A GetDateModified() 0 8 1
A SetDateCreated() 0 3 1
A GetDateCreated() 0 8 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\DataTypes\Date;
10
use SignpostMarv\DaftObject\SchemaOrg\DataTypes\DateTime;
11
12
trait DateCreatedModified
13
{
14
    use DaftObjectTrait;
15
16
    /**
17
    * @return array<int, Date|DateTime>
18
    */
19
    public function GetDateCreated() : array
20
    {
21
        /**
22
        * @var array<int, Date|DateTime>
23
        */
24
        $out = $this->ExpectRetrievedValueIsArray('dateCreated');
0 ignored issues
show
Bug introduced by
It seems like ExpectRetrievedValueIsArray() 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

24
        /** @scrutinizer ignore-call */ 
25
        $out = $this->ExpectRetrievedValueIsArray('dateCreated');
Loading history...
25
26
        return $out;
27
    }
28
29
    /**
30
    * @param array<int, Date|DateTime> $value
31
    */
32
    public function SetDateCreated(array $value) : void
33
    {
34
        $this->NudgePropertyValue('dateCreated', $value);
35
    }
36
37
    /**
38
    * @return array<int, Date|DateTime>
39
    */
40
    public function GetDateModified() : array
41
    {
42
        /**
43
        * @var array<int, Date|DateTime>
44
        */
45
        $out = $this->ExpectRetrievedValueIsArray('dateModified');
46
47
        return $out;
48
    }
49
50
    /**
51
    * @param array<int, Date|DateTime> $value
52
    */
53
    public function SetDateModified(array $value) : void
54
    {
55
        $this->NudgePropertyValue('dateModified', $value);
56
    }
57
}
58