Completed
Push — master ( c762b0...684d44 )
by John
02:56
created

ArraySchema::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 2
1
<?php declare(strict_types = 1);
2
/*
3
 * This file is part of the KleijnWeb\ApiDescriptions package.
4
 *
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 */
8
namespace KleijnWeb\ApiDescriptions\Description\Schema;
9
10
/**
11
 * @author John Kleijn <[email protected]>
12
 */
13
class ArraySchema extends Schema
14
{
15
    /**
16
     * @var Schema|null
17
     */
18
    protected $itemsSchema;
19
20
    /**
21
     * ArraySchema constructor.
22
     *
23
     * @param \stdClass   $definition
24
     * @param Schema|null $itemsSchema
25
     */
26
    public function __construct(\stdClass $definition, $itemsSchema)
27
    {
28
        $this->itemsSchema = $itemsSchema;
29
        parent::__construct($definition);
30
    }
31
32
    /**
33
     * @return string
34
     */
35
    public function getType(): string
36
    {
37
        return Schema::TYPE_ARRAY;
38
    }
39
40
    /**
41
     * @return Schema
42
     */
43
    public function getItemsSchema(): Schema
44
    {
45
        return $this->itemsSchema;
46
    }
47
}
48