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

Builder::__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 1
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\Builder;
9
10
use KleijnWeb\ApiDescriptions\Description\Description;
11
use KleijnWeb\ApiDescriptions\Description\Document\Document;
12
use KleijnWeb\ApiDescriptions\Description\Schema\SchemaFactory;
13
14
/**
15
 * @author John Kleijn <[email protected]>
16
 */
17
abstract class Builder
18
{
19
    protected static $methodNames = [
20
        'get',
21
        'patch',
22
        'put',
23
        'post',
24
        'delete',
25
        'options',
26
        'head'
27
    ];
28
29
    /**
30
     * @var \stdClass
31
     */
32
    protected $document;
33
34
    /**
35
     * @var SchemaFactory
36
     */
37
    protected $schemaFactory;
38
39
    /**
40
     * OpenApiBuilder constructor.
41
     *
42
     * @param Document $document
43
     */
44
    public function __construct(Document $document)
45
    {
46
        $this->document      = $document;
47
        $this->schemaFactory = new SchemaFactory();
48
    }
49
50
    abstract public function build(): Description;
51
}
52