Completed
Push — dev ( 6293b4...41c0d5 )
by James Ekow Abaka
03:00
created

AbstractDatabaseManipulator   A

Complexity

Total Complexity 32

Size/Duplication

Total Lines 234
Duplicated Lines 0 %

Coupling/Cohesion

Components 3
Dependencies 7

Test Coverage

Coverage 78.72%

Importance

Changes 0
Metric Value
dl 0
loc 234
ccs 74
cts 94
cp 0.7872
rs 9.84
c 0
b 0
f 0
wmc 32
lcom 3
cbo 7

44 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A __get() 0 6 2
A setDumpQuery() 0 4 1
A setDisableQuery() 0 4 1
A __call() 0 12 2
A query() 0 16 4
A disconnect() 0 4 1
A getAssertor() 0 7 2
_addSchema() 0 1 ?
_dropSchema() 0 1 ?
_addTable() 0 1 ?
_dropTable() 0 1 ?
_changeTableName() 0 1 ?
_addColumn() 0 1 ?
_changeColumnNulls() 0 1 ?
_changeColumnName() 0 1 ?
_changeColumnDefault() 0 1 ?
_dropColumn() 0 1 ?
_addPrimaryKey() 0 1 ?
_dropPrimaryKey() 0 1 ?
_addUniqueKey() 0 1 ?
_dropUniqueKey() 0 1 ?
_addAutoPrimaryKey() 0 1 ?
_dropAutoPrimaryKey() 0 1 ?
_addForeignKey() 0 1 ?
_dropForeignKey() 0 1 ?
_addIndex() 0 1 ?
_dropIndex() 0 1 ?
_addView() 0 1 ?
_dropView() 0 1 ?
_changeViewDefinition() 0 1 ?
A _changeForeignKeyOnDelete() 0 5 1
A _changeForeignKeyOnUpdate() 0 5 1
A _executeQuery() 0 4 1
A _reverseQuery() 0 4 1
convertTypes() 0 1 ?
A getDescription() 0 7 2
A setVersion() 0 4 1
A getVersion() 0 5 2
A getLastSession() 0 5 2
A getSessionVersions() 0 13 2
A createHistory() 0 20 2
A __clone() 0 6 2
A getDefaultSchema() 0 4 1
1
<?php
2
3
namespace yentu\manipulators;
4
5
use clearice\io\Io;
6
use ntentan\atiaa\DriverFactory;
7
use yentu\Yentu;
8
use yentu\DatabaseAssertor;
9
use yentu\SchemaDescription;
10
use yentu\exceptions\DatabaseManipulatorException;
11
use yentu\Parameters;
12
13
abstract class AbstractDatabaseManipulator
14
{
15
16
    const CONVERT_TO_DRIVER = 'driver';
17
    const CONVERT_TO_YENTU = 'yentu';
18
19
    private $schemaDescription;
20
    private $assertor;
21
    private $connection;
22
    private $dumpQuery;
23
    private $disableQuery;
24
    protected $defaultSchema;
25
    private $io;
26
27
    /**
28
     * AbstractDatabaseManipulator constructor.
29
     * @param DriverFactory $driverFactory
30
     * @param Io $io
31
     * @throws \ntentan\atiaa\exceptions\ConnectionException
32
     */
33 32
    public function __construct(DriverFactory $driverFactory, Io $io)
34
    {
35 32
        $this->connection = $driverFactory->createDriver();
36 32
        $this->connection->connect();
37 32
        $this->io = $io;
38 32
    }
39
40 32
    public function __get($name)
41
    {
42 32
        if ($name === 'description') {
43 32
            return $this->getDescription();
44
        }
45
    }
46
47 9
    public function setDumpQuery($dumpQuery)
48
    {
49 9
        $this->dumpQuery = $dumpQuery;
50 9
    }
51
52 9
    public function setDisableQuery($disableQuery)
53
    {
54 9
        $this->disableQuery = $disableQuery;
55 9
    }
56
57 29
    public function __call($name, $arguments)
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
58
    {
59 29
        if (preg_match("/^(add|drop|change|executeQuery|reverseQuery)/", $name)) {
60 29
            $details = Parameters::wrap($arguments[0]);
61 29
            $this->description->$name($details);
0 ignored issues
show
Bug introduced by
The property description does not seem to exist. Did you mean schemaDescription?

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
62 29
            $name = "_$name";
63 29
            new \ReflectionMethod($this, $name);
64 29
            return $this->$name($details);
65
        } else {
66
            throw new \Exception("Failed to execute method '$name'");
67
        }
68
    }
69
70 29
    public function query($query, $bind = false)
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
71
    {
72
        try {
73 29
            if ($this->dumpQuery) {
74
                echo "$query\n";
75
            }
76
77 29
            $this->io->output("\n    > Running Query [$query]", Io::OUTPUT_LEVEL_3);
78
79 29
            if ($this->disableQuery !== true) {
80 29
                return $this->connection->query($query, $bind);
0 ignored issues
show
Documentation introduced by
$bind is of type boolean, but the function expects a array.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
81
            }
82 3
        } catch (\ntentan\atiaa\exceptions\DatabaseDriverException $e) {
83 3
            throw new DatabaseManipulatorException($e->getMessage());
84
        }
85 9
    }
86
87 26
    public function disconnect()
88
    {
89 26
        $this->connection->disconnect();
90 26
    }
91
92 1
    public function getDefaultSchema()
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
93
    {
94 1
        return $this->connection->getDefaultSchema();
95
    }
96
97 29
    public function getAssertor()
98
    {
99 29
        if (!is_object($this->assertor)) {
100 29
            $this->assertor = new DatabaseAssertor($this->description);
0 ignored issues
show
Bug introduced by
The property description does not seem to exist. Did you mean schemaDescription?

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
101
        }
102 29
        return $this->assertor;
103
    }
104
105
    abstract protected function _addSchema($name);
0 ignored issues
show
Documentation introduced by
For interfaces and abstract methods it is generally a good practice to add a @return annotation even if it is just @return void or @return null, so that implementors know what to do in the overridden method.

For interface and abstract methods, it is impossible to infer the return type from the immediate code. In these cases, it is generally advisible to explicitly annotate these methods with a @return doc comment to communicate to implementors of these methods what they are expected to return.

Loading history...
106
107
    abstract protected function _dropSchema($name);
0 ignored issues
show
Documentation introduced by
For interfaces and abstract methods it is generally a good practice to add a @return annotation even if it is just @return void or @return null, so that implementors know what to do in the overridden method.

For interface and abstract methods, it is impossible to infer the return type from the immediate code. In these cases, it is generally advisible to explicitly annotate these methods with a @return doc comment to communicate to implementors of these methods what they are expected to return.

Loading history...
108
109
    abstract protected function _addTable($details);
0 ignored issues
show
Documentation introduced by
For interfaces and abstract methods it is generally a good practice to add a @return annotation even if it is just @return void or @return null, so that implementors know what to do in the overridden method.

For interface and abstract methods, it is impossible to infer the return type from the immediate code. In these cases, it is generally advisible to explicitly annotate these methods with a @return doc comment to communicate to implementors of these methods what they are expected to return.

Loading history...
110
111
    abstract protected function _dropTable($details);
0 ignored issues
show
Documentation introduced by
For interfaces and abstract methods it is generally a good practice to add a @return annotation even if it is just @return void or @return null, so that implementors know what to do in the overridden method.

For interface and abstract methods, it is impossible to infer the return type from the immediate code. In these cases, it is generally advisible to explicitly annotate these methods with a @return doc comment to communicate to implementors of these methods what they are expected to return.

Loading history...
112
113
    abstract protected function _changeTableName($details);
0 ignored issues
show
Documentation introduced by
For interfaces and abstract methods it is generally a good practice to add a @return annotation even if it is just @return void or @return null, so that implementors know what to do in the overridden method.

For interface and abstract methods, it is impossible to infer the return type from the immediate code. In these cases, it is generally advisible to explicitly annotate these methods with a @return doc comment to communicate to implementors of these methods what they are expected to return.

Loading history...
114
115
    abstract protected function _addColumn($details);
0 ignored issues
show
Documentation introduced by
For interfaces and abstract methods it is generally a good practice to add a @return annotation even if it is just @return void or @return null, so that implementors know what to do in the overridden method.

For interface and abstract methods, it is impossible to infer the return type from the immediate code. In these cases, it is generally advisible to explicitly annotate these methods with a @return doc comment to communicate to implementors of these methods what they are expected to return.

Loading history...
116
117
    abstract protected function _changeColumnNulls($details);
0 ignored issues
show
Documentation introduced by
For interfaces and abstract methods it is generally a good practice to add a @return annotation even if it is just @return void or @return null, so that implementors know what to do in the overridden method.

For interface and abstract methods, it is impossible to infer the return type from the immediate code. In these cases, it is generally advisible to explicitly annotate these methods with a @return doc comment to communicate to implementors of these methods what they are expected to return.

Loading history...
118
119
    abstract protected function _changeColumnName($details);
0 ignored issues
show
Documentation introduced by
For interfaces and abstract methods it is generally a good practice to add a @return annotation even if it is just @return void or @return null, so that implementors know what to do in the overridden method.

For interface and abstract methods, it is impossible to infer the return type from the immediate code. In these cases, it is generally advisible to explicitly annotate these methods with a @return doc comment to communicate to implementors of these methods what they are expected to return.

Loading history...
120
121
    abstract protected function _changeColumnDefault($details);
0 ignored issues
show
Documentation introduced by
For interfaces and abstract methods it is generally a good practice to add a @return annotation even if it is just @return void or @return null, so that implementors know what to do in the overridden method.

For interface and abstract methods, it is impossible to infer the return type from the immediate code. In these cases, it is generally advisible to explicitly annotate these methods with a @return doc comment to communicate to implementors of these methods what they are expected to return.

Loading history...
122
123
    abstract protected function _dropColumn($details);
0 ignored issues
show
Documentation introduced by
For interfaces and abstract methods it is generally a good practice to add a @return annotation even if it is just @return void or @return null, so that implementors know what to do in the overridden method.

For interface and abstract methods, it is impossible to infer the return type from the immediate code. In these cases, it is generally advisible to explicitly annotate these methods with a @return doc comment to communicate to implementors of these methods what they are expected to return.

Loading history...
124
125
    abstract protected function _addPrimaryKey($details);
0 ignored issues
show
Documentation introduced by
For interfaces and abstract methods it is generally a good practice to add a @return annotation even if it is just @return void or @return null, so that implementors know what to do in the overridden method.

For interface and abstract methods, it is impossible to infer the return type from the immediate code. In these cases, it is generally advisible to explicitly annotate these methods with a @return doc comment to communicate to implementors of these methods what they are expected to return.

Loading history...
126
127
    abstract protected function _dropPrimaryKey($details);
0 ignored issues
show
Documentation introduced by
For interfaces and abstract methods it is generally a good practice to add a @return annotation even if it is just @return void or @return null, so that implementors know what to do in the overridden method.

For interface and abstract methods, it is impossible to infer the return type from the immediate code. In these cases, it is generally advisible to explicitly annotate these methods with a @return doc comment to communicate to implementors of these methods what they are expected to return.

Loading history...
128
129
    abstract protected function _addUniqueKey($details);
0 ignored issues
show
Documentation introduced by
For interfaces and abstract methods it is generally a good practice to add a @return annotation even if it is just @return void or @return null, so that implementors know what to do in the overridden method.

For interface and abstract methods, it is impossible to infer the return type from the immediate code. In these cases, it is generally advisible to explicitly annotate these methods with a @return doc comment to communicate to implementors of these methods what they are expected to return.

Loading history...
130
131
    abstract protected function _dropUniqueKey($details);
0 ignored issues
show
Documentation introduced by
For interfaces and abstract methods it is generally a good practice to add a @return annotation even if it is just @return void or @return null, so that implementors know what to do in the overridden method.

For interface and abstract methods, it is impossible to infer the return type from the immediate code. In these cases, it is generally advisible to explicitly annotate these methods with a @return doc comment to communicate to implementors of these methods what they are expected to return.

Loading history...
132
133
    abstract protected function _addAutoPrimaryKey($details);
0 ignored issues
show
Documentation introduced by
For interfaces and abstract methods it is generally a good practice to add a @return annotation even if it is just @return void or @return null, so that implementors know what to do in the overridden method.

For interface and abstract methods, it is impossible to infer the return type from the immediate code. In these cases, it is generally advisible to explicitly annotate these methods with a @return doc comment to communicate to implementors of these methods what they are expected to return.

Loading history...
134
135
    abstract protected function _dropAutoPrimaryKey($details);
0 ignored issues
show
Documentation introduced by
For interfaces and abstract methods it is generally a good practice to add a @return annotation even if it is just @return void or @return null, so that implementors know what to do in the overridden method.

For interface and abstract methods, it is impossible to infer the return type from the immediate code. In these cases, it is generally advisible to explicitly annotate these methods with a @return doc comment to communicate to implementors of these methods what they are expected to return.

Loading history...
136
137
    abstract protected function _addForeignKey($details);
0 ignored issues
show
Documentation introduced by
For interfaces and abstract methods it is generally a good practice to add a @return annotation even if it is just @return void or @return null, so that implementors know what to do in the overridden method.

For interface and abstract methods, it is impossible to infer the return type from the immediate code. In these cases, it is generally advisible to explicitly annotate these methods with a @return doc comment to communicate to implementors of these methods what they are expected to return.

Loading history...
138
139
    abstract protected function _dropForeignKey($details);
0 ignored issues
show
Documentation introduced by
For interfaces and abstract methods it is generally a good practice to add a @return annotation even if it is just @return void or @return null, so that implementors know what to do in the overridden method.

For interface and abstract methods, it is impossible to infer the return type from the immediate code. In these cases, it is generally advisible to explicitly annotate these methods with a @return doc comment to communicate to implementors of these methods what they are expected to return.

Loading history...
140
141
    abstract protected function _addIndex($details);
0 ignored issues
show
Documentation introduced by
For interfaces and abstract methods it is generally a good practice to add a @return annotation even if it is just @return void or @return null, so that implementors know what to do in the overridden method.

For interface and abstract methods, it is impossible to infer the return type from the immediate code. In these cases, it is generally advisible to explicitly annotate these methods with a @return doc comment to communicate to implementors of these methods what they are expected to return.

Loading history...
142
143
    abstract protected function _dropIndex($details);
0 ignored issues
show
Documentation introduced by
For interfaces and abstract methods it is generally a good practice to add a @return annotation even if it is just @return void or @return null, so that implementors know what to do in the overridden method.

For interface and abstract methods, it is impossible to infer the return type from the immediate code. In these cases, it is generally advisible to explicitly annotate these methods with a @return doc comment to communicate to implementors of these methods what they are expected to return.

Loading history...
144
145
    abstract protected function _addView($details);
0 ignored issues
show
Documentation introduced by
For interfaces and abstract methods it is generally a good practice to add a @return annotation even if it is just @return void or @return null, so that implementors know what to do in the overridden method.

For interface and abstract methods, it is impossible to infer the return type from the immediate code. In these cases, it is generally advisible to explicitly annotate these methods with a @return doc comment to communicate to implementors of these methods what they are expected to return.

Loading history...
146
147
    abstract protected function _dropView($details);
0 ignored issues
show
Documentation introduced by
For interfaces and abstract methods it is generally a good practice to add a @return annotation even if it is just @return void or @return null, so that implementors know what to do in the overridden method.

For interface and abstract methods, it is impossible to infer the return type from the immediate code. In these cases, it is generally advisible to explicitly annotate these methods with a @return doc comment to communicate to implementors of these methods what they are expected to return.

Loading history...
148
149
    abstract protected function _changeViewDefinition($details);
0 ignored issues
show
Documentation introduced by
For interfaces and abstract methods it is generally a good practice to add a @return annotation even if it is just @return void or @return null, so that implementors know what to do in the overridden method.

For interface and abstract methods, it is impossible to infer the return type from the immediate code. In these cases, it is generally advisible to explicitly annotate these methods with a @return doc comment to communicate to implementors of these methods what they are expected to return.

Loading history...
150
151
    protected function _changeForeignKeyOnDelete($details)
152
    {
153
        $this->_dropForeignKey($details['from']);
154
        $this->_addForeignKey($details['to']);
155
    }
156
157
    protected function _changeForeignKeyOnUpdate($details)
158
    {
159
        $this->_dropForeignKey($details['from']);
160
        $this->_addForeignKey($details['to']);
161
    }
162
163
    protected function _executeQuery($details)
164
    {
165
        $this->query($details['query'], $details['bind'] ?? []);
166
    }
167
168
    protected function _reverseQuery($details)
0 ignored issues
show
Unused Code introduced by
The parameter $details is not used and could be removed.

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

Loading history...
169
    {
170
        
171
    }
172
173
    abstract public function convertTypes($type, $direction, $length);
0 ignored issues
show
Documentation introduced by
For interfaces and abstract methods it is generally a good practice to add a @return annotation even if it is just @return void or @return null, so that implementors know what to do in the overridden method.

For interface and abstract methods, it is impossible to infer the return type from the immediate code. In these cases, it is generally advisible to explicitly annotate these methods with a @return doc comment to communicate to implementors of these methods what they are expected to return.

Loading history...
174
175
    /**
176
     * 
177
     * @return SchemaDescription
178
     */
179 32
    public function getDescription()
180
    {
181 32
        if (!is_object($this->schemaDescription)) {
182 32
            $this->schemaDescription = SchemaDescription::wrap($this->connection->describe(), $this);
183
        }
184 32
        return $this->schemaDescription;
185
    }
186
187 8
    public function setVersion($version)
188
    {
189 8
        $this->query('INSERT INTO yentu_history(version) values (?)', array($version));
0 ignored issues
show
Documentation introduced by
array($version) is of type array<integer,?,{"0":"?"}>, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
190 8
    }
191
192
    public function getVersion()
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
193
    {
194
        $version = $this->query("SELECT MAX(version) as version FROM yentu_history");
195
        return isset($version[0]) ? $version[0]['version'] : null;
196
    }
197
198 6
    public function getLastSession()
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
199
    {
200 6
        $session = $this->query("SELECT session FROM yentu_history ORDER BY id DESC LIMIT 1");
201 6
        return isset($session[0]['session']) ? $session[0]['session'] : null;
202
    }
203
204 3
    public function getSessionVersions($session)
205
    {
206 3
        $sessionVersions = array();
207 3
        $versions = $this->query(
208 3
            "SELECT DISTINCT version FROM yentu_history WHERE session = ?", array($session)
0 ignored issues
show
Documentation introduced by
array($session) is of type array<integer,?,{"0":"?"}>, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
209
        );
210
211 3
        foreach ($versions as $version) {
212 3
            $sessionVersions[] = $version['version'];
213
        }
214
215 3
        return $sessionVersions;
216
    }
217
218 26
    public function createHistory()
219
    {
220
        try {
221 26
            $this->connection->describeTable('yentu_history');
222 26
        } catch (\ntentan\atiaa\exceptions\TableNotFoundException $e) {
223 26
            $this->io->pushOutputLevel(Io::OUTPUT_LEVEL_0);
224 26
            $this->addTable(array('schema' => '', 'name' => 'yentu_history'));
0 ignored issues
show
Bug introduced by
The method addTable() does not exist on yentu\manipulators\AbstractDatabaseManipulator. Did you maybe mean _addTable()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
225
226 26
            $this->addColumn(array('default' => null, 'schema' => '', 'nulls' => true, 'length' => null, 'table' => 'yentu_history', 'name' => 'session', 'type' => 'string'));
0 ignored issues
show
Bug introduced by
The method addColumn() does not exist on yentu\manipulators\AbstractDatabaseManipulator. Did you maybe mean _addColumn()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
227 26
            $this->addColumn(array('default' => null, 'schema' => '', 'nulls' => false, 'length' => null, 'table' => 'yentu_history', 'name' => 'version', 'type' => 'string'));
0 ignored issues
show
Bug introduced by
The method addColumn() does not exist on yentu\manipulators\AbstractDatabaseManipulator. Did you maybe mean _addColumn()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
228 26
            $this->addColumn(array('default' => null, 'schema' => '', 'nulls' => true, 'length' => null, 'table' => 'yentu_history', 'name' => 'method', 'type' => 'string'));
0 ignored issues
show
Bug introduced by
The method addColumn() does not exist on yentu\manipulators\AbstractDatabaseManipulator. Did you maybe mean _addColumn()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
229 26
            $this->addColumn(array('default' => null, 'schema' => '', 'nulls' => true, 'length' => null, 'table' => 'yentu_history', 'name' => 'arguments', 'type' => 'text'));
0 ignored issues
show
Bug introduced by
The method addColumn() does not exist on yentu\manipulators\AbstractDatabaseManipulator. Did you maybe mean _addColumn()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
230 26
            $this->addColumn(array('default' => null, 'schema' => '', 'nulls' => true, 'length' => null, 'table' => 'yentu_history', 'name' => 'migration', 'type' => 'string'));
0 ignored issues
show
Bug introduced by
The method addColumn() does not exist on yentu\manipulators\AbstractDatabaseManipulator. Did you maybe mean _addColumn()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
231 26
            $this->addColumn(array('default' => null, 'schema' => '', 'nulls' => true, 'length' => null, 'table' => 'yentu_history', 'name' => 'default_schema', 'type' => 'string'));
0 ignored issues
show
Bug introduced by
The method addColumn() does not exist on yentu\manipulators\AbstractDatabaseManipulator. Did you maybe mean _addColumn()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
232 26
            $this->addColumn(array('default' => null, 'schema' => '', 'nulls' => true, 'length' => null, 'table' => 'yentu_history', 'name' => 'id', 'type' => 'integer'));
0 ignored issues
show
Bug introduced by
The method addColumn() does not exist on yentu\manipulators\AbstractDatabaseManipulator. Did you maybe mean _addColumn()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
233 26
            $this->addPrimaryKey(array('schema' => '', 'table' => 'yentu_history', 'name' => 'yentu_history_pk', 'columns' => array('id')));
0 ignored issues
show
Bug introduced by
The method addPrimaryKey() does not exist on yentu\manipulators\AbstractDatabaseManipulator. Did you maybe mean _addPrimaryKey()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
234 26
            $this->addAutoPrimaryKey(array('schema' => '', 'table' => 'yentu_history', 'column' => 'id'));
0 ignored issues
show
Bug introduced by
The method addAutoPrimaryKey() does not exist on yentu\manipulators\AbstractDatabaseManipulator. Did you maybe mean _addAutoPrimaryKey()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
235 26
            $this->io->popOutputLevel();
236
        }
237 26
    }
238
239 9
    public function __clone()
240
    {
241 9
        if (is_object($this->schemaDescription)) {
242
            $this->schemaDescription = clone $this->schemaDescription;
243
        }
244 9
    }
245
246
}
247