Passed
Pull Request — master (#37)
by Viacheslav
09:31
created

SchemaResolver   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
dl 0
loc 16
rs 10
c 1
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A setUpProperties() 0 6 1
1
<?php
2
3
namespace Swaggest\JsonCli;
4
5
use Swaggest\JsonSchema\Constraint\Properties;
6
use Swaggest\JsonSchema\Schema;
7
use Swaggest\JsonSchema\Structure\ClassStructure;
8
9
class SchemaResolver extends ClassStructure
10
{
11
    public $schemaData = [];
12
13
    public $schemaFiles = [];
14
15
    /**
16
     * @param Properties|static $properties
17
     * @param Schema $ownerSchema
18
     */
19
    public static function setUpProperties($properties, Schema $ownerSchema)
20
    {
21
        $properties->schemaData = Schema::object()->setAdditionalProperties(Schema::object())
22
            ->setDescription('Map of schema url to schema data.');
23
        $properties->schemaFiles = Schema::object()->setAdditionalProperties(Schema::string())
24
            ->setDescription('Map of schema url to file path containing schema data.');
25
    }
26
}