Skip to content

Commit 02a7282

Browse files
committed
Fixing static analysis
1 parent d4ca66f commit 02a7282

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Schema/Traits/Custom_Table_Query_Methods.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
use Generator;
1818
use InvalidArgumentException;
1919
use StellarWP\Schema\Columns\Contracts\Column;
20+
use StellarWP\Schema\Columns\Contracts\Auto_Incrementable;
2021
use StellarWP\Schema\Columns\PHP_Types;
2122
use StellarWP\Schema\Config;
2223

@@ -231,7 +232,7 @@ protected static function prepare_statements_values( array $entries ): array {
231232

232233
$entries = array_map(
233234
function ( $entry ) use ( $uid_column, $column_object ) {
234-
if ( ! ( PHP_Types::INT === $column_object->get_php_type() && $column_object->get_auto_increment() ) ) {
235+
if ( ! ( $column_object instanceof Auto_Incrementable && $column_object->get_auto_increment() ) ) {
235236
return $entry;
236237
}
237238

@@ -385,6 +386,8 @@ public static function update_many( array $entries ): bool {
385386

386387
$database::beginTransaction();
387388

389+
$results = [];
390+
388391
foreach ( $queries as $query ) {
389392
$results[] = $database::query( $query );
390393
}

0 commit comments

Comments
 (0)