Completed
Push — master ( e54b6a...c762b0 )
by John
03:11
created

OpenApiResponse::__construct()   A

Complexity

Conditions 2
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 5
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 5
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\Standard\OpenApi;
10
11
use KleijnWeb\ApiDescriptions\Description\Response;
12
use KleijnWeb\ApiDescriptions\Description\Schema;
13
14
/**
15
 * @author John Kleijn <[email protected]>
16
 */
17 View Code Duplication
class OpenApiResponse extends Response
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
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