Passed
Push — master ( 8fc551...e19a0d )
by Harry
02:28
created

ParsedSchema::getSchemaName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * This file is part of graze/sprout.
4
 *
5
 * Copyright © 2018 Nature Delivered Ltd. <https://www.graze.com>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 *
10
 * @license https://github.com/graze/sprout/blob/master/LICENSE.md
11
 * @link    https://github.com/graze/sprout
12
 */
13
14
namespace Graze\Sprout\Parser;
15
16
use Graze\Sprout\Config\SchemaConfigInterface;
17
18
class ParsedSchema
19
{
20
    /** @var SchemaConfigInterface */
21
    private $schemaConfig;
22
    /** @var string */
23
    private $path;
24
    /** @var string[] */
25
    private $tables;
26
27
    /**
28
     * ParsedSchema constructor.
29
     *
30
     * @param SchemaConfigInterface $schemaConfig
31
     * @param string                $path
32
     * @param string[]              $tables
33
     */
34 16
    public function __construct(SchemaConfigInterface $schemaConfig, string $path, array $tables)
0 ignored issues
show
Coding Style introduced by
Unknown type hint "string" found for $path
Loading history...
35
    {
36 16
        $this->schemaConfig = $schemaConfig;
37 16
        $this->path = $path;
38 16
        $this->tables = $tables;
39 16
    }
40
41
    /**
42
     * @return SchemaConfigInterface
43
     */
44 11
    public function getSchemaConfig(): SchemaConfigInterface
45
    {
46 11
        return $this->schemaConfig;
47
    }
48
49
    /**
50
     * @return string
51
     */
52 10
    public function getPath(): string
53
    {
54 10
        return $this->path;
55
    }
56
57
    /**
58
     * @return string[]
59
     */
60 16
    public function getTables(): array
61
    {
62 16
        return $this->tables;
63
    }
64
65
    /**
66
     * @param string[] $tables
67
     *
68
     * @return ParsedSchema
69
     */
70 6
    public function setTables(array $tables): ParsedSchema
71
    {
72 6
        $this->tables = $tables;
73 6
        return $this;
74
    }
75
76
    /**
77
     * @return string
78
     */
79 7
    public function getSchemaName(): string
80
    {
81 7
        return $this->schemaConfig->getSchema();
82
    }
83
}
84