Passed
Push — main ( af1024...b746de )
by Thierry
02:04
created

Table   A

Complexity

Total Complexity 12

Size/Duplication

Total Lines 119
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 21
dl 0
loc 119
rs 10
c 1
b 0
f 0
wmc 12

11 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A triggerOptions() 0 3 1
A triggers() 0 3 1
A trigger() 0 3 1
A isView() 0 3 1
A alterIndexes() 0 3 1
A foreignKeys() 0 3 1
A supportForeignKeys() 0 3 1
A referencableTables() 0 3 1
A tableHelp() 0 3 1
A tableStatusOrName() 0 6 2
1
<?php
2
3
namespace Lagdo\DbAdmin\Driver\Db;
4
5
use Lagdo\DbAdmin\Driver\DriverInterface;
6
use Lagdo\DbAdmin\Driver\UtilInterface;
7
use Lagdo\DbAdmin\Driver\TranslatorInterface;
8
9
use Lagdo\DbAdmin\Driver\Entity\TableEntity;
10
11
abstract class Table implements TableInterface
12
{
13
    /**
14
     * @var DriverInterface
15
     */
16
    protected $driver;
17
18
    /**
19
     * @var UtilInterface
20
     */
21
    protected $util;
22
23
    /**
24
     * @var TranslatorInterface
25
     */
26
    protected $trans;
27
28
    /**
29
     * @var ConnectionInterface
30
     */
31
    protected $connection;
32
33
    /**
34
     * The constructor
35
     *
36
     * @param DriverInterface $driver
37
     * @param UtilInterface $util
38
     * @param TranslatorInterface $trans
39
     * @param ConnectionInterface $connection
40
     */
41
    public function __construct(DriverInterface $driver, UtilInterface $util, TranslatorInterface $trans, ConnectionInterface $connection)
42
    {
43
        $this->driver = $driver;
44
        $this->util = $util;
45
        $this->trans = $trans;
46
        $this->connection = $connection;
47
    }
48
49
    /**
50
     * @inheritDoc
51
     */
52
    public function tableStatusOrName(string $table, bool $fast = false)
53
    {
54
        if (($status = $this->tableStatus($table, $fast))) {
55
            return $status;
56
        }
57
        return new TableEntity($table);
58
    }
59
60
    /**
61
     * @inheritDoc
62
     */
63
    public function foreignKeys(string $table)
64
    {
65
        return [];
66
    }
67
68
    /**
69
     * @inheritDoc
70
     */
71
    public function supportForeignKeys(TableEntity $tableStatus)
72
    {
73
        return false;
74
    }
75
76
    /**
77
     * @inheritDoc
78
     */
79
    public function alterIndexes(string $table, array $alte)
0 ignored issues
show
Unused Code introduced by
The parameter $table is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

79
    public function alterIndexes(/** @scrutinizer ignore-unused */ string $table, array $alte)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $alte is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

79
    public function alterIndexes(string $table, /** @scrutinizer ignore-unused */ array $alte)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
80
    {
81
        return false;
82
    }
83
84
    /**
85
     * @inheritDoc
86
     */
87
    public function isView(TableEntity $tableStatus)
88
    {
89
        return false;
90
    }
91
92
    /**
93
     * @inheritDoc
94
     */
95
    public function trigger(string $name, string $table = '')
96
    {
97
        return null;
98
    }
99
100
    /**
101
     * @inheritDoc
102
     */
103
    public function triggers(string $table)
104
    {
105
        return [];
106
    }
107
108
    /**
109
     * @inheritDoc
110
     */
111
    public function triggerOptions()
112
    {
113
        return [];
114
    }
115
116
    /**
117
     * @inheritDoc
118
     */
119
    public function referencableTables(string $table)
120
    {
121
        return [];
122
    }
123
124
    /**
125
     * @inheritDoc
126
     */
127
    public function tableHelp(string $name)
128
    {
129
        return '';
130
    }
131
}
132