GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Passed
Push — master ( 354c7c...907f89 )
by Jamie
05:42
created

Schema::__construct()   A

Complexity

Conditions 4
Paths 6

Size

Total Lines 14
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 11
CRAP Score 4

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 14
rs 9.2
ccs 11
cts 11
cp 1
cc 4
eloc 7
nc 6
nop 2
crap 4
1
<?php
2
3
namespace OpenStack\Images\v2\Models;
4
5
use JsonSchema\Validator;
6
7
class Schema extends \OpenStack\Common\JsonSchema\Schema
8
{
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
}