Completed
Push — master ( fcd315...e54b6a )
by John
02:20
created

OpenApiResponse::__construct()   A

Complexity

Conditions 2
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 5
rs 9.4285
c 1
b 0
f 0
cc 2
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
9
namespace KleijnWeb\ApiDescriptions\Description\OpenApi;
10
11
use KleijnWeb\ApiDescriptions\Description\Response;
12
use KleijnWeb\ApiDescriptions\Description\Schema;
13
14
/**
15
 * @author John Kleijn <[email protected]>
16
 */
17
class OpenApiResponse extends Response
18
{
19
    /**
20
     * Response constructor.
21
     *
22
     * @param int       $code
23
     * @param \stdClass $definition
24
     */
25
    public function __construct(int $code, \stdClass $definition)
26
    {
27
        $this->code   = $code;
28
        $this->schema = Schema::get(isset($definition->schema) ? $definition->schema : null);
29
    }
30
}
31