@@ -49,17 +49,17 @@ public function initialize(Nette\Database\Connection $connection, array $options
4949
5050 public function convertException (\PDOException $ e ): Nette \Database \DriverException
5151 {
52- $ code = $ e ->errorInfo [1 ] ?? NULL ;
53- if (in_array ($ code , [1216 , 1217 , 1451 , 1452 , 1701 ], TRUE )) {
52+ $ code = $ e ->errorInfo [1 ] ?? null ;
53+ if (in_array ($ code , [1216 , 1217 , 1451 , 1452 , 1701 ], true )) {
5454 return Nette \Database \ForeignKeyConstraintViolationException::from ($ e );
5555
56- } elseif (in_array ($ code , [1062 , 1557 , 1569 , 1586 ], TRUE )) {
56+ } elseif (in_array ($ code , [1062 , 1557 , 1569 , 1586 ], true )) {
5757 return Nette \Database \UniqueConstraintViolationException::from ($ e );
5858
5959 } elseif ($ code >= 2001 && $ code <= 2028 ) {
6060 return Nette \Database \ConnectionException::from ($ e );
6161
62- } elseif (in_array ($ code , [1048 , 1121 , 1138 , 1171 , 1252 , 1263 , 1566 ], TRUE )) {
62+ } elseif (in_array ($ code , [1048 , 1121 , 1138 , 1171 , 1252 , 1263 , 1566 ], true )) {
6363 return Nette \Database \NotNullConstraintViolationException::from ($ e );
6464
6565 } else {
@@ -118,9 +118,9 @@ public function applyLimit(string &$sql, ?int $limit, ?int $offset): void
118118 if ($ limit < 0 || $ offset < 0 ) {
119119 throw new Nette \InvalidArgumentException ('Negative offset or limit. ' );
120120
121- } elseif ($ limit !== NULL || $ offset ) {
121+ } elseif ($ limit !== null || $ offset ) {
122122 // see http://dev.mysql.com/doc/refman/5.0/en/select.html
123- $ sql .= ' LIMIT ' . ($ limit === NULL ? '18446744073709551615 ' : $ limit )
123+ $ sql .= ' LIMIT ' . ($ limit === null ? '18446744073709551615 ' : $ limit )
124124 . ($ offset ? ' OFFSET ' . $ offset : '' );
125125 }
126126 }
@@ -138,7 +138,7 @@ public function getTables(): array
138138 foreach ($ this ->connection ->query ('SHOW FULL TABLES ' ) as $ row ) {
139139 $ tables [] = [
140140 'name ' => $ row [0 ],
141- 'view ' => ($ row [1 ] ?? NULL ) === 'VIEW ' ,
141+ 'view ' => ($ row [1 ] ?? null ) === 'VIEW ' ,
142142 ];
143143 }
144144 return $ tables ;
@@ -157,7 +157,7 @@ public function getColumns(string $table): array
157157 'name ' => $ row ['Field ' ],
158158 'table ' => $ table ,
159159 'nativetype ' => strtoupper ($ type [0 ]),
160- 'size ' => isset ($ type [1 ]) ? (int ) $ type [1 ] : NULL ,
160+ 'size ' => isset ($ type [1 ]) ? (int ) $ type [1 ] : null ,
161161 'unsigned ' => (bool ) strstr ($ row ['Type ' ], 'unsigned ' ),
162162 'nullable ' => $ row ['Null ' ] === 'YES ' ,
163163 'default ' => $ row ['Default ' ],
0 commit comments