Passed
Pull Request — master (#3)
by Harry
03:37 queued 01:14
created

ParsedSchema::getSchameName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 3
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Graze\Sprout\Parser;
4
5
use Graze\Sprout\Config\SchemaConfigInterface;
6
7
class ParsedSchema
8
{
9
    /** @var SchemaConfigInterface */
10
    private $schemaConfig;
11
    /** @var string */
12
    private $path;
13
    /** @var array */
14
    private $tables;
15
16
    /**
17
     * ParsedSchema constructor.
18
     *
19
     * @param SchemaConfigInterface $schemaConfig
20
     * @param string                $path
21
     * @param array                 $tables
22
     */
23 9
    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...
24
    {
25 9
        $this->schemaConfig = $schemaConfig;
26 9
        $this->path = $path;
27 9
        $this->tables = $tables;
28 9
    }
29
30
    /**
31
     * @return SchemaConfigInterface
32
     */
33 5
    public function getSchemaConfig(): SchemaConfigInterface
34
    {
35 5
        return $this->schemaConfig;
36
    }
37
38
    /**
39
     * @return string
40
     */
41 7
    public function getPath(): string
42
    {
43 7
        return $this->path;
44
    }
45
46
    /**
47
     * @return array
48
     */
49 9
    public function getTables(): array
50
    {
51 9
        return $this->tables;
52
    }
53
54
    /**
55
     * @param array $tables
56
     *
57
     * @return ParsedSchema
58
     */
59 3
    public function setTables(array $tables): ParsedSchema
60
    {
61 3
        $this->tables = $tables;
62 3
        return $this;
63
    }
64
65
    /**
66
     * @return string
67
     */
68 4
    public function getSchemaName(): string
69
    {
70 4
        return $this->schemaConfig->getSchema();
71
    }
72
}
73