1 | <?php |
||
16 | class MySQLTable extends AbstractTable |
||
17 | { |
||
18 | /** |
||
19 | * List of most common MySQL table engines. |
||
20 | */ |
||
21 | const ENGINE_INNODB = 'InnoDB'; |
||
22 | const ENGINE_MYISAM = 'MyISAM'; |
||
23 | const ENGINE_MEMORY = 'Memory'; |
||
24 | |||
25 | /** |
||
26 | * MySQL table engine. |
||
27 | * |
||
28 | * @var string |
||
29 | */ |
||
30 | private $engine = self::ENGINE_INNODB; |
||
31 | |||
32 | /** |
||
33 | * Populate table schema with values from database. |
||
34 | * |
||
35 | * @param TableState $state |
||
36 | */ |
||
37 | protected function initSchema(TableState $state) |
||
46 | |||
47 | /** |
||
48 | * Change table engine. Such operation will be applied only at moment of table creation. |
||
49 | * |
||
50 | * @param string $engine |
||
51 | * |
||
52 | * @return $this |
||
53 | * |
||
54 | * @throws SchemaException |
||
55 | */ |
||
56 | public function setEngine($engine) |
||
66 | |||
67 | /** |
||
68 | * @return string |
||
69 | */ |
||
70 | public function getEngine() |
||
74 | |||
75 | /** |
||
76 | * {@inheritdoc} |
||
77 | */ |
||
78 | protected function fetchColumns(): array |
||
89 | |||
90 | /** |
||
91 | * {@inheritdoc} |
||
92 | */ |
||
93 | protected function fetchIndexes(): array |
||
115 | |||
116 | /** |
||
117 | * {@inheritdoc} |
||
118 | */ |
||
119 | protected function fetchReferences(): array |
||
144 | |||
145 | /** |
||
146 | * Fetching primary keys from table. |
||
147 | * |
||
148 | * @return array |
||
149 | */ |
||
150 | protected function fetchPrimaryKeys(): array |
||
163 | |||
164 | /** |
||
165 | * {@inheritdoc} |
||
166 | */ |
||
167 | protected function createColumn(string $name): AbstractColumn |
||
171 | |||
172 | /** |
||
173 | * {@inheritdoc} |
||
174 | */ |
||
175 | protected function createIndex(string $name): AbstractIndex |
||
179 | |||
180 | /** |
||
181 | * {@inheritdoc} |
||
182 | */ |
||
183 | protected function createForeign(string $column): AbstractReference |
||
187 | } |
There are different options of fixing this problem.
If you want to be on the safe side, you can add an additional type-check:
If you are sure that the expression is traversable, you might want to add a doc comment cast to improve IDE auto-completion and static analysis:
Mark the issue as a false-positive: Just hover the remove button, in the top-right corner of this issue for more options.