Passed
Pull Request — master (#1)
by Harry
02:11
created

ParsedSchema   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 64
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 13
dl 0
loc 64
ccs 0
cts 26
cp 0
rs 10
c 0
b 0
f 0
wmc 6

6 Methods

Rating   Name   Duplication   Size   Complexity  
A getPath() 0 3 1
A getTables() 0 3 1
A getSchameName() 0 3 1
A setTables() 0 4 1
A getSchemaConfig() 0 3 1
A __construct() 0 5 1
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
    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
        $this->schemaConfig = $schemaConfig;
26
        $this->path = $path;
27
        $this->tables = $tables;
28
    }
29
30
    /**
31
     * @return SchemaConfigInterface
32
     */
33
    public function getSchemaConfig(): SchemaConfigInterface
34
    {
35
        return $this->schemaConfig;
36
    }
37
38
    /**
39
     * @return string
40
     */
41
    public function getPath(): string
42
    {
43
        return $this->path;
44
    }
45
46
    /**
47
     * @return array
48
     */
49
    public function getTables(): array
50
    {
51
        return $this->tables;
52
    }
53
54
    /**
55
     * @param array $tables
56
     *
57
     * @return ParsedSchema
58
     */
59
    public function setTables(array $tables): ParsedSchema
60
    {
61
        $this->tables = $tables;
62
        return $this;
63
    }
64
65
    /**
66
     * @return string
67
     */
68
    public function getSchameName(): string
69
    {
70
        return $this->schemaConfig->getSchema();
71
    }
72
}
73