@@ -51,16 +51,16 @@ public function __construct(Nette\Database\Connection $connection, array $option
5151 public function convertException (\PDOException $ e )
5252 {
5353 $ code = isset ($ e ->errorInfo [1 ]) ? $ e ->errorInfo [1 ] : NULL ;
54- if (in_array ($ code , array ( 1216 , 1217 , 1451 , 1452 , 1701 ) , TRUE )) {
54+ if (in_array ($ code , [ 1216 , 1217 , 1451 , 1452 , 1701 ] , TRUE )) {
5555 return Nette \Database \ForeignKeyConstraintViolationException::from ($ e );
5656
57- } elseif (in_array ($ code , array ( 1062 , 1557 , 1569 , 1586 ) , TRUE )) {
57+ } elseif (in_array ($ code , [ 1062 , 1557 , 1569 , 1586 ] , TRUE )) {
5858 return Nette \Database \UniqueConstraintViolationException::from ($ e );
5959
6060 } elseif ($ code >= 2001 && $ code <= 2028 ) {
6161 return Nette \Database \ConnectionException::from ($ e );
6262
63- } elseif (in_array ($ code , array ( 1048 , 1121 , 1138 , 1171 , 1252 , 1263 , 1566 ) , TRUE )) {
63+ } elseif (in_array ($ code , [ 1048 , 1121 , 1138 , 1171 , 1252 , 1263 , 1566 ] , TRUE )) {
6464 return Nette \Database \NotNullConstraintViolationException::from ($ e );
6565
6666 } else {
@@ -149,12 +149,12 @@ public function normalizeRow($row)
149149 */
150150 public function getTables ()
151151 {
152- $ tables = array () ;
152+ $ tables = [] ;
153153 foreach ($ this ->connection ->query ('SHOW FULL TABLES ' ) as $ row ) {
154- $ tables [] = array (
154+ $ tables [] = [
155155 'name ' => $ row [0 ],
156156 'view ' => isset ($ row [1 ]) && $ row [1 ] === 'VIEW ' ,
157- ) ;
157+ ] ;
158158 }
159159 return $ tables ;
160160 }
@@ -165,10 +165,10 @@ public function getTables()
165165 */
166166 public function getColumns ($ table )
167167 {
168- $ columns = array () ;
168+ $ columns = [] ;
169169 foreach ($ this ->connection ->query ('SHOW FULL COLUMNS FROM ' . $ this ->delimite ($ table )) as $ row ) {
170170 $ type = explode ('( ' , $ row ['Type ' ]);
171- $ columns [] = array (
171+ $ columns [] = [
172172 'name ' => $ row ['Field ' ],
173173 'table ' => $ table ,
174174 'nativetype ' => strtoupper ($ type [0 ]),
@@ -179,7 +179,7 @@ public function getColumns($table)
179179 'autoincrement ' => $ row ['Extra ' ] === 'auto_increment ' ,
180180 'primary ' => $ row ['Key ' ] === 'PRI ' ,
181181 'vendor ' => (array ) $ row ,
182- ) ;
182+ ] ;
183183 }
184184 return $ columns ;
185185 }
@@ -190,7 +190,7 @@ public function getColumns($table)
190190 */
191191 public function getIndexes ($ table )
192192 {
193- $ indexes = array () ;
193+ $ indexes = [] ;
194194 foreach ($ this ->connection ->query ('SHOW INDEX FROM ' . $ this ->delimite ($ table )) as $ row ) {
195195 $ indexes [$ row ['Key_name ' ]]['name ' ] = $ row ['Key_name ' ];
196196 $ indexes [$ row ['Key_name ' ]]['unique ' ] = !$ row ['Non_unique ' ];
@@ -206,7 +206,7 @@ public function getIndexes($table)
206206 */
207207 public function getForeignKeys ($ table )
208208 {
209- $ keys = array () ;
209+ $ keys = [] ;
210210 $ query = 'SELECT CONSTRAINT_NAME, COLUMN_NAME, REFERENCED_TABLE_NAME, REFERENCED_COLUMN_NAME FROM information_schema.KEY_COLUMN_USAGE '
211211 . 'WHERE TABLE_SCHEMA = DATABASE() AND REFERENCED_TABLE_NAME IS NOT NULL AND TABLE_NAME = ' . $ this ->connection ->quote ($ table );
212212
@@ -226,7 +226,7 @@ public function getForeignKeys($table)
226226 */
227227 public function getColumnTypes (\PDOStatement $ statement )
228228 {
229- $ types = array () ;
229+ $ types = [] ;
230230 $ count = $ statement ->columnCount ();
231231 for ($ col = 0 ; $ col < $ count ; $ col ++) {
232232 $ meta = $ statement ->getColumnMeta ($ col );
0 commit comments