Passed
Pull Request — master (#3)
by Harry
02:24
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
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 10
    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 10
        $this->schemaConfig = $schemaConfig;
26 10
        $this->path = $path;
27 10
        $this->tables = $tables;
28 10
    }
29
30
    /**
31
     * @return SchemaConfigInterface
32
     */
33 6
    public function getSchemaConfig(): SchemaConfigInterface
34
    {
35 6
        return $this->schemaConfig;
36
    }
37
38
    /**
39
     * @return string
40
     */
41 8
    public function getPath(): string
42
    {
43 8
        return $this->path;
44
    }
45
46
    /**
47
     * @return array
48
     */
49 10
    public function getTables(): array
50
    {
51 10
        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 5
    public function getSchemaName(): string
69
    {
70 5
        return $this->schemaConfig->getSchema();
71
    }
72
}
73