NewsArticle::SetPrintColumn()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 1
dl 0
loc 6
ccs 5
cts 5
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\CreativeWork\Article;
8
9
use SignpostMarv\DaftObject\SchemaOrg\CreativeWork\Article as Base;
10
use SignpostMarv\DaftObject\SchemaOrg\TypeUtilities;
11
12
/**
13
* @property array<int, string> $dateline
14
* @property array<int, string> $printColumn
15
* @property array<int, string> $printEdition
16
* @property array<int, string> $printPage
17
* @property array<int, string> $printSection
18
*/
19
class NewsArticle extends Base
20
{
21
    const SCHEMA_ORG_TYPE = 'NewsArticle';
22
23
    const PROPERTIES = [
24
        'dateline',
25
        'printColumn',
26
        'printEdition',
27
        'printPage',
28
        'printSection',
29
    ];
30
31
    const PROPERTIES_WITH_MULTI_TYPED_ARRAYS = [
32
        'dateline' => [
33
            'string',
34
        ],
35
        'printColumn' => [
36
            'string',
37
        ],
38
        'printEdition' => [
39
            'string',
40
        ],
41
        'printPage' => [
42
            'string',
43
        ],
44
        'printSection' => [
45
            'string',
46
        ],
47
    ];
48
49
    /**
50
    * @return array<int, string>
51
    */
52 10
    public function GetDateline() : array
53
    {
54
        /**
55
        * @var array<int, string>
56
        */
57 10
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
58 10
            'dateline',
59 10
            $this->RetrievePropertyValueFromData('dateline'),
60 10
            static::class
61
        );
62
63 10
        return $out;
64
    }
65
66
    /**
67
    * @param array<int, string> $value
68
    */
69 1
    public function SetDateline(array $value) : void
70
    {
71 1
        $this->NudgePropertyValue(
72 1
            'dateline',
73 1
            $value,
74 1
            self::BOOL_DEFAULT_AUTOTRIMSTRINGS
75
        );
76 1
    }
77
78
    /**
79
    * @return array<int, string>
80
    */
81 10
    public function GetPrintColumn() : array
82
    {
83
        /**
84
        * @var array<int, string>
85
        */
86 10
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
87 10
            'printColumn',
88 10
            $this->RetrievePropertyValueFromData('printColumn'),
89 10
            static::class
90
        );
91
92 10
        return $out;
93
    }
94
95
    /**
96
    * @param array<int, string> $value
97
    */
98 1
    public function SetPrintColumn(array $value) : void
99
    {
100 1
        $this->NudgePropertyValue(
101 1
            'printColumn',
102 1
            $value,
103 1
            self::BOOL_DEFAULT_AUTOTRIMSTRINGS
104
        );
105 1
    }
106
107
    /**
108
    * @return array<int, string>
109
    */
110 10
    public function GetPrintEdition() : array
111
    {
112
        /**
113
        * @var array<int, string>
114
        */
115 10
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
116 10
            'printEdition',
117 10
            $this->RetrievePropertyValueFromData('printEdition'),
118 10
            static::class
119
        );
120
121 10
        return $out;
122
    }
123
124
    /**
125
    * @param array<int, string> $value
126
    */
127 1
    public function SetPrintEdition(array $value) : void
128
    {
129 1
        $this->NudgePropertyValue(
130 1
            'printEdition',
131 1
            $value,
132 1
            self::BOOL_DEFAULT_AUTOTRIMSTRINGS
133
        );
134 1
    }
135
136
    /**
137
    * @return array<int, string>
138
    */
139 10
    public function GetPrintPage() : array
140
    {
141
        /**
142
        * @var array<int, string>
143
        */
144 10
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
145 10
            'printPage',
146 10
            $this->RetrievePropertyValueFromData('printPage'),
147 10
            static::class
148
        );
149
150 10
        return $out;
151
    }
152
153
    /**
154
    * @param array<int, string> $value
155
    */
156 1
    public function SetPrintPage(array $value) : void
157
    {
158 1
        $this->NudgePropertyValue(
159 1
            'printPage',
160 1
            $value,
161 1
            self::BOOL_DEFAULT_AUTOTRIMSTRINGS
162
        );
163 1
    }
164
165
    /**
166
    * @return array<int, string>
167
    */
168 10
    public function GetPrintSection() : array
169
    {
170
        /**
171
        * @var array<int, string>
172
        */
173 10
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
174 10
            'printSection',
175 10
            $this->RetrievePropertyValueFromData('printSection'),
176 10
            static::class
177
        );
178
179 10
        return $out;
180
    }
181
182
    /**
183
    * @param array<int, string> $value
184
    */
185 1
    public function SetPrintSection(array $value) : void
186
    {
187 1
        $this->NudgePropertyValue(
188 1
            'printSection',
189 1
            $value,
190 1
            self::BOOL_DEFAULT_AUTOTRIMSTRINGS
191
        );
192 1
    }
193
}
194