Conditions | 4 |
Paths | 6 |
Total Lines | 14 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 11 |
CRAP Score | 4 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
9 | 2 | public function __construct($data, Validator $validator = null) |
|
10 | { |
||
11 | 2 | if (!isset($data->type)) { |
|
12 | 2 | $data->type = 'object'; |
|
13 | 2 | } |
|
14 | |||
15 | 2 | foreach ($data->properties as $propertyName => &$property) { |
|
16 | 2 | if (strpos($property->description, 'READ-ONLY') !== false) { |
|
17 | 2 | $property->readOnly = true; |
|
18 | 2 | } |
|
19 | 2 | } |
|
20 | |||
21 | 2 | parent::__construct($data, $validator); |
|
22 | } |
||
23 | } |