Test Setup Failed
Push — master ( d6fde7...1e848b )
by Php Easy Api
04:20
created

BaseManager   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 10
c 1
b 0
f 0
dl 0
loc 44
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getColumns() 0 5 1
A getTables() 0 3 1
A __construct() 0 5 1
1
<?php
2
3
namespace Migratio\Resource;
4
5
use Migratio\Schema;
6
use Migratio\Contract\QueryBaseContract;
7
use Migratio\Contract\ColumnsProcessContract;
8
9
class BaseManager
10
{
11
    /**
12
     * @var $connection QueryBaseContract
0 ignored issues
show
Documentation Bug introduced by
The doc comment $connection at position 0 could not be parsed: Unknown type name '$connection' at position 0 in $connection.
Loading history...
13
     */
14
    protected $connection;
15
16
    /**
17
     * @var $schema Schema
0 ignored issues
show
Documentation Bug introduced by
The doc comment $schema at position 0 could not be parsed: Unknown type name '$schema' at position 0 in $schema.
Loading history...
18
     */
19
    protected $schema;
20
21
    /**
22
     * @var $config
0 ignored issues
show
Documentation Bug introduced by
The doc comment $config at position 0 could not be parsed: Unknown type name '$config' at position 0 in $config.
Loading history...
23
     */
24
    protected $config;
25
26
    /**
27
     * Pulling constructor.
28
     * @param $schema Schema
29
     */
30
    public function __construct($schema)
31
    {
32
        $this->schema       = $schema;
33
        $this->config       = $this->schema->getConfig();
34
        $this->connection   = $this->schema->getConnection();
35
    }
36
37
    /**
38
     * @return mixed
39
     */
40
    public function getTables()
41
    {
42
        return $this->connection->getTables();
43
    }
44
45
    /**
46
     * @return ColumnsProcessContract
47
     */
48
    public function getColumns()
49
    {
50
        $tables = $this->schema->params['tables'];
51
52
        return $this->connection->getColumns($tables);
53
    }
54
}
55