Completed
Pull Request — master (#1)
by Viacheslav
06:08
created

Composition   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
lcom 0
cbo 4
dl 0
loc 19
rs 10
c 1
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 12 3
1
<?php
2
3
namespace Swaggest\JsonSchema\Structure;
4
5
use Swaggest\JsonSchema\Constraint\Properties;
6
use Swaggest\JsonSchema\Constraint\Type;
7
use Swaggest\JsonSchema\Schema;
8
9
/**
10
 * @todo think of anyOf, allOf, oneOf
11
 */
12
class Composition extends Schema
13
{
14
    /**
15
     * @param Schema... $schema
0 ignored issues
show
Documentation introduced by
The doc-type Schema... could not be parsed: Unknown type name "Schema..." at position 0. (view supported doc-types)

This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.

Loading history...
Bug introduced by
There is no parameter named $schema. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
16
     */
17
    public function __construct()
18
    {
19
        $this->type = new Type(Type::OBJECT);
20
        $properties = new Properties();
21
        $this->properties = $properties;
22
23
        foreach (func_get_args() as $arg) {
24
            if ($arg instanceof ClassSchema) {
25
                $properties->__set($arg->objectItemClass, $arg->nested());
26
            }
27
        }
28
    }
29
30
}