From ec22705882575e724e10c91fd7a43309ebfcddfe Mon Sep 17 00:00:00 2001 From: Sergei Morozov Date: Thu, 17 Jan 2019 22:47:10 -0800 Subject: [PATCH] Updated PHPStan to v0.11 --- composer.json | 2 +- composer.lock | 226 ++++++++++++------ lib/Doctrine/DBAL/Connection.php | 14 +- .../Connections/MasterSlaveConnection.php | 4 +- .../DBAL/Driver/IBMDB2/DB2Statement.php | 2 +- .../DBAL/Driver/Mysqli/MysqliStatement.php | 30 +-- .../DBAL/Platforms/SqlitePlatform.php | 6 +- 7 files changed, 177 insertions(+), 107 deletions(-) diff --git a/composer.json b/composer.json index bec40c7e7f2..df888004dce 100644 --- a/composer.json +++ b/composer.json @@ -29,7 +29,7 @@ "require-dev": { "doctrine/coding-standard": "^5.0", "jetbrains/phpstorm-stubs": "^2018.1.2", - "phpstan/phpstan": "^0.10.1", + "phpstan/phpstan": "^0.11.1", "phpunit/phpunit": "^7.4", "symfony/console": "^2.0.5|^3.0|^4.0", "symfony/phpunit-bridge": "^3.4.5|^4.0.5" diff --git a/composer.lock b/composer.lock index a17fed1ffbe..9d34a231f1e 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "3ebc0109174963fe21391619cdae7254", + "content-hash": "c0b2296029841f54d6b8438c7773e861", "packages": [ { "name": "doctrine/cache", @@ -158,16 +158,16 @@ "packages-dev": [ { "name": "composer/xdebug-handler", - "version": "1.1.0", + "version": "1.3.1", "source": { "type": "git", "url": "https://github.com/composer/xdebug-handler.git", - "reference": "c919dc6c62e221fc6406f861ea13433c0aa24f08" + "reference": "dc523135366eb68f22268d069ea7749486458562" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/c919dc6c62e221fc6406f861ea13433c0aa24f08", - "reference": "c919dc6c62e221fc6406f861ea13433c0aa24f08", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/dc523135366eb68f22268d069ea7749486458562", + "reference": "dc523135366eb68f22268d069ea7749486458562", "shasum": "" }, "require": { @@ -198,7 +198,7 @@ "Xdebug", "performance" ], - "time": "2018-04-11T15:42:36+00:00" + "time": "2018-11-29T10:59:02+00:00" }, { "name": "dealerdirect/phpcodesniffer-composer-installer", @@ -598,16 +598,16 @@ }, { "name": "nette/di", - "version": "v2.4.13", + "version": "v2.4.14", "source": { "type": "git", "url": "https://github.com/nette/di.git", - "reference": "3f8f212b02d5c17feb97a7e0a39ab306f40c06ca" + "reference": "923da3e2c0aa53162ef455472c0ac7787b096c5a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nette/di/zipball/3f8f212b02d5c17feb97a7e0a39ab306f40c06ca", - "reference": "3f8f212b02d5c17feb97a7e0a39ab306f40c06ca", + "url": "https://api.github.com/repos/nette/di/zipball/923da3e2c0aa53162ef455472c0ac7787b096c5a", + "reference": "923da3e2c0aa53162ef455472c0ac7787b096c5a", "shasum": "" }, "require": { @@ -663,7 +663,7 @@ "nette", "static" ], - "time": "2018-06-11T08:46:01+00:00" + "time": "2018-09-17T15:47:40+00:00" }, { "name": "nette/finder", @@ -790,16 +790,16 @@ }, { "name": "nette/php-generator", - "version": "v3.0.4", + "version": "v3.0.5", "source": { "type": "git", "url": "https://github.com/nette/php-generator.git", - "reference": "b381ecacbf5a0b5f99cc0b303d5b0578d409f446" + "reference": "ea90209c2e8a7cd087b2742ca553c047a8df5eff" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nette/php-generator/zipball/b381ecacbf5a0b5f99cc0b303d5b0578d409f446", - "reference": "b381ecacbf5a0b5f99cc0b303d5b0578d409f446", + "url": "https://api.github.com/repos/nette/php-generator/zipball/ea90209c2e8a7cd087b2742ca553c047a8df5eff", + "reference": "ea90209c2e8a7cd087b2742ca553c047a8df5eff", "shasum": "" }, "require": { @@ -848,20 +848,20 @@ "php", "scaffolding" ], - "time": "2018-04-26T16:48:20+00:00" + "time": "2018-08-09T14:32:27+00:00" }, { "name": "nette/robot-loader", - "version": "v3.0.4", + "version": "v3.1.0", "source": { "type": "git", "url": "https://github.com/nette/robot-loader.git", - "reference": "3cf88781a05e0bf4618ae605361afcbaa4d5b392" + "reference": "fc76c70e740b10f091e502b2e393d0be912f38d4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nette/robot-loader/zipball/3cf88781a05e0bf4618ae605361afcbaa4d5b392", - "reference": "3cf88781a05e0bf4618ae605361afcbaa4d5b392", + "url": "https://api.github.com/repos/nette/robot-loader/zipball/fc76c70e740b10f091e502b2e393d0be912f38d4", + "reference": "fc76c70e740b10f091e502b2e393d0be912f38d4", "shasum": "" }, "require": { @@ -880,7 +880,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "3.1-dev" } }, "autoload": { @@ -913,20 +913,20 @@ "nette", "trait" ], - "time": "2018-06-22T09:34:04+00:00" + "time": "2018-08-13T14:19:06+00:00" }, { "name": "nette/utils", - "version": "v2.5.2", + "version": "v2.5.3", "source": { "type": "git", "url": "https://github.com/nette/utils.git", - "reference": "183069866dc477fcfbac393ed486aaa6d93d19a5" + "reference": "17b9f76f2abd0c943adfb556e56f2165460b15ce" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nette/utils/zipball/183069866dc477fcfbac393ed486aaa6d93d19a5", - "reference": "183069866dc477fcfbac393ed486aaa6d93d19a5", + "url": "https://api.github.com/repos/nette/utils/zipball/17b9f76f2abd0c943adfb556e56f2165460b15ce", + "reference": "17b9f76f2abd0c943adfb556e56f2165460b15ce", "shasum": "" }, "require": { @@ -995,20 +995,20 @@ "utility", "validation" ], - "time": "2018-05-02T17:16:08+00:00" + "time": "2018-09-18T10:22:16+00:00" }, { "name": "nikic/php-parser", - "version": "v4.0.2", + "version": "v4.2.0", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "35b8caf75e791ba1b2d24fec1552168d72692b12" + "reference": "594bcae1fc0bccd3993d2f0d61a018e26ac2865a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/35b8caf75e791ba1b2d24fec1552168d72692b12", - "reference": "35b8caf75e791ba1b2d24fec1552168d72692b12", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/594bcae1fc0bccd3993d2f0d61a018e26ac2865a", + "reference": "594bcae1fc0bccd3993d2f0d61a018e26ac2865a", "shasum": "" }, "require": { @@ -1024,7 +1024,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-master": "4.2-dev" } }, "autoload": { @@ -1046,7 +1046,7 @@ "parser", "php" ], - "time": "2018-06-03T11:33:10+00:00" + "time": "2019-01-12T16:31:37+00:00" }, { "name": "ocramius/package-versions", @@ -1416,16 +1416,16 @@ }, { "name": "phpstan/phpdoc-parser", - "version": "0.3", + "version": "0.3.1", "source": { "type": "git", "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "ed3223362174b8067729930439e139794e9e514a" + "reference": "2cc49f47c69b023eaf05b48e6529389893b13d74" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/ed3223362174b8067729930439e139794e9e514a", - "reference": "ed3223362174b8067729930439e139794e9e514a", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/2cc49f47c69b023eaf05b48e6529389893b13d74", + "reference": "2cc49f47c69b023eaf05b48e6529389893b13d74", "shasum": "" }, "require": { @@ -1435,7 +1435,7 @@ "consistence/coding-standard": "^2.0.0", "jakub-onderka/php-parallel-lint": "^0.9.2", "phing/phing": "^2.16.0", - "phpstan/phpstan": "^0.10@dev", + "phpstan/phpstan": "^0.10", "phpunit/phpunit": "^6.3", "slevomat/coding-standard": "^3.3.0", "symfony/process": "^3.4 || ^4.0" @@ -1458,24 +1458,24 @@ "MIT" ], "description": "PHPDoc parser with support for nullable, intersection and generic types", - "time": "2018-06-20T17:48:01+00:00" + "time": "2019-01-14T12:26:23+00:00" }, { "name": "phpstan/phpstan", - "version": "0.10.1", + "version": "0.11.1", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "3179cf27542e9e47acb548150e7ca21ca5ab92d6" + "reference": "a138b8a2731b2c19f1dffa2f1411984a638fe977" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/3179cf27542e9e47acb548150e7ca21ca5ab92d6", - "reference": "3179cf27542e9e47acb548150e7ca21ca5ab92d6", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/a138b8a2731b2c19f1dffa2f1411984a638fe977", + "reference": "a138b8a2731b2c19f1dffa2f1411984a638fe977", "shasum": "" }, "require": { - "composer/xdebug-handler": "^1.0", + "composer/xdebug-handler": "^1.3.0", "jean85/pretty-package-versions": "^1.0.3", "nette/bootstrap": "^2.4 || ^3.0", "nette/di": "^2.4.7 || ^3.0", @@ -1487,22 +1487,27 @@ "symfony/console": "~3.2 || ~4.0", "symfony/finder": "~3.2 || ~4.0" }, + "conflict": { + "symfony/console": "3.4.16 || 4.1.5" + }, "require-dev": { "brianium/paratest": "^2.0", - "consistence/coding-standard": "^3.3", + "consistence/coding-standard": "^3.5", "dealerdirect/phpcodesniffer-composer-installer": "^0.4.4", - "ext-gd": "*", "ext-intl": "*", "ext-mysqli": "*", + "ext-soap": "*", "ext-zip": "*", "jakub-onderka/php-parallel-lint": "^1.0", + "localheinz/composer-normalize": "^1.1.0", "phing/phing": "^2.16.0", - "phpstan/phpstan-deprecation-rules": "^0.10.2", - "phpstan/phpstan-php-parser": "^0.10", - "phpstan/phpstan-phpunit": "^0.10", - "phpstan/phpstan-strict-rules": "^0.10", + "phpstan/phpstan-deprecation-rules": "^0.11", + "phpstan/phpstan-php-parser": "^0.11", + "phpstan/phpstan-phpunit": "^0.11", + "phpstan/phpstan-strict-rules": "^0.11", "phpunit/phpunit": "^7.0", - "slevomat/coding-standard": "^4.6.2" + "slevomat/coding-standard": "^4.7.2", + "squizlabs/php_codesniffer": "^3.3.2" }, "bin": [ "bin/phpstan" @@ -1510,7 +1515,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "0.10-dev" + "dev-master": "0.11-dev" } }, "autoload": { @@ -1526,7 +1531,7 @@ "MIT" ], "description": "PHPStan - PHP Static Analysis Tool", - "time": "2018-07-01T18:22:12+00:00" + "time": "2019-01-19T20:23:08+00:00" }, { "name": "phpunit/php-code-coverage", @@ -1866,16 +1871,16 @@ }, { "name": "psr/log", - "version": "1.0.2", + "version": "1.1.0", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d" + "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", - "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "url": "https://api.github.com/repos/php-fig/log/zipball/6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", + "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", "shasum": "" }, "require": { @@ -1909,7 +1914,7 @@ "psr", "psr-3" ], - "time": "2016-10-10T12:19:37+00:00" + "time": "2018-11-20T15:27:04+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", @@ -2566,20 +2571,21 @@ }, { "name": "symfony/console", - "version": "v4.1.1", + "version": "v4.2.2", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "70591cda56b4b47c55776ac78e157c4bb6c8b43f" + "reference": "b0a03c1bb0fcbe288629956cf2f1dd3f1dc97522" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/70591cda56b4b47c55776ac78e157c4bb6c8b43f", - "reference": "70591cda56b4b47c55776ac78e157c4bb6c8b43f", + "url": "https://api.github.com/repos/symfony/console/zipball/b0a03c1bb0fcbe288629956cf2f1dd3f1dc97522", + "reference": "b0a03c1bb0fcbe288629956cf2f1dd3f1dc97522", "shasum": "" }, "require": { "php": "^7.1.3", + "symfony/contracts": "^1.0", "symfony/polyfill-mbstring": "~1.0" }, "conflict": { @@ -2603,7 +2609,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.1-dev" + "dev-master": "4.2-dev" } }, "autoload": { @@ -2630,7 +2636,75 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2018-05-31T10:17:53+00:00" + "time": "2019-01-04T15:13:53+00:00" + }, + { + "name": "symfony/contracts", + "version": "v1.0.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/contracts.git", + "reference": "1aa7ab2429c3d594dd70689604b5cf7421254cdf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/contracts/zipball/1aa7ab2429c3d594dd70689604b5cf7421254cdf", + "reference": "1aa7ab2429c3d594dd70689604b5cf7421254cdf", + "shasum": "" + }, + "require": { + "php": "^7.1.3" + }, + "require-dev": { + "psr/cache": "^1.0", + "psr/container": "^1.0" + }, + "suggest": { + "psr/cache": "When using the Cache contracts", + "psr/container": "When using the Service contracts", + "symfony/cache-contracts-implementation": "", + "symfony/service-contracts-implementation": "", + "symfony/translation-contracts-implementation": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\": "" + }, + "exclude-from-classmap": [ + "**/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "A set of abstractions extracted out of the Symfony components", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "time": "2018-12-05T08:06:11+00:00" }, { "name": "symfony/debug", @@ -2690,16 +2764,16 @@ }, { "name": "symfony/finder", - "version": "v4.1.1", + "version": "v4.2.2", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "84714b8417d19e4ba02ea78a41a975b3efaafddb" + "reference": "9094d69e8c6ee3fe186a0ec5a4f1401e506071ce" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/84714b8417d19e4ba02ea78a41a975b3efaafddb", - "reference": "84714b8417d19e4ba02ea78a41a975b3efaafddb", + "url": "https://api.github.com/repos/symfony/finder/zipball/9094d69e8c6ee3fe186a0ec5a4f1401e506071ce", + "reference": "9094d69e8c6ee3fe186a0ec5a4f1401e506071ce", "shasum": "" }, "require": { @@ -2708,7 +2782,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.1-dev" + "dev-master": "4.2-dev" } }, "autoload": { @@ -2735,7 +2809,7 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2018-06-19T21:38:16+00:00" + "time": "2019-01-03T09:07:35+00:00" }, { "name": "symfony/phpunit-bridge", @@ -2805,16 +2879,16 @@ }, { "name": "symfony/polyfill-mbstring", - "version": "v1.7.0", + "version": "v1.10.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "78be803ce01e55d3491c1397cf1c64beb9c1b63b" + "reference": "c79c051f5b3a46be09205c73b80b346e4153e494" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/78be803ce01e55d3491c1397cf1c64beb9c1b63b", - "reference": "78be803ce01e55d3491c1397cf1c64beb9c1b63b", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/c79c051f5b3a46be09205c73b80b346e4153e494", + "reference": "c79c051f5b3a46be09205c73b80b346e4153e494", "shasum": "" }, "require": { @@ -2826,7 +2900,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.7-dev" + "dev-master": "1.9-dev" } }, "autoload": { @@ -2860,7 +2934,7 @@ "portable", "shim" ], - "time": "2018-01-30T19:27:44+00:00" + "time": "2018-09-21T13:07:52+00:00" }, { "name": "theseer/tokenizer", diff --git a/lib/Doctrine/DBAL/Connection.php b/lib/Doctrine/DBAL/Connection.php index 85761fcca9b..62023534c87 100644 --- a/lib/Doctrine/DBAL/Connection.php +++ b/lib/Doctrine/DBAL/Connection.php @@ -1227,9 +1227,7 @@ protected function _getNestedTransactionSavePointName() } /** - * Starts a transaction by suspending auto-commit mode. - * - * @return void + * {@inheritDoc} */ public function beginTransaction() { @@ -1256,12 +1254,12 @@ public function beginTransaction() $logger->stopQuery(); } } + + return true; } /** - * Commits the current transaction. - * - * @return void + * {@inheritDoc} * * @throws ConnectionException If the commit failed due to no active transaction or * because the transaction was marked for rollback only. @@ -1300,10 +1298,12 @@ public function commit() --$this->transactionNestingLevel; if ($this->autoCommit !== false || $this->transactionNestingLevel !== 0) { - return; + return true; } $this->beginTransaction(); + + return true; } /** diff --git a/lib/Doctrine/DBAL/Connections/MasterSlaveConnection.php b/lib/Doctrine/DBAL/Connections/MasterSlaveConnection.php index d2e4b2c2509..17dac54d4a2 100644 --- a/lib/Doctrine/DBAL/Connections/MasterSlaveConnection.php +++ b/lib/Doctrine/DBAL/Connections/MasterSlaveConnection.php @@ -232,7 +232,7 @@ public function beginTransaction() { $this->connect('master'); - parent::beginTransaction(); + return parent::beginTransaction(); } /** @@ -242,7 +242,7 @@ public function commit() { $this->connect('master'); - parent::commit(); + return parent::commit(); } /** diff --git a/lib/Doctrine/DBAL/Driver/IBMDB2/DB2Statement.php b/lib/Doctrine/DBAL/Driver/IBMDB2/DB2Statement.php index 9c87d46319b..0743c2b9817 100644 --- a/lib/Doctrine/DBAL/Driver/IBMDB2/DB2Statement.php +++ b/lib/Doctrine/DBAL/Driver/IBMDB2/DB2Statement.php @@ -167,7 +167,7 @@ public function closeCursor() public function columnCount() { if (! $this->stmt) { - return false; + return 0; } return db2_num_fields($this->stmt); diff --git a/lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php b/lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php index 2bbe0ca8b20..895e5fa501d 100644 --- a/lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php +++ b/lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php @@ -11,13 +11,14 @@ use mysqli; use mysqli_stmt; use PDO; -use stdClass; use function array_combine; use function array_fill; +use function assert; use function count; use function feof; use function fread; use function get_resource_type; +use function is_array; use function is_resource; use function sprintf; use function str_repeat; @@ -327,28 +328,23 @@ public function fetch($fetchMode = null, $cursorOrientation = PDO::FETCH_ORI_NEX throw new MysqliException($this->_stmt->error, $this->_stmt->sqlstate, $this->_stmt->errno); } - switch ($fetchMode) { - case FetchMode::NUMERIC: - return $values; + if ($fetchMode === FetchMode::NUMERIC) { + return $values; + } + assert(is_array($this->_columnNames)); + $assoc = array_combine($this->_columnNames, $values); + assert(is_array($assoc)); + + switch ($fetchMode) { case FetchMode::ASSOCIATIVE: - return array_combine($this->_columnNames, $values); + return $assoc; case FetchMode::MIXED: - $ret = array_combine($this->_columnNames, $values); - $ret += $values; - - return $ret; + return $assoc + $values; case FetchMode::STANDARD_OBJECT: - $assoc = array_combine($this->_columnNames, $values); - $ret = new stdClass(); - - foreach ($assoc as $column => $value) { - $ret->$column = $value; - } - - return $ret; + return (object) $assoc; default: throw new MysqliException(sprintf("Unknown fetch type '%s'", $fetchMode)); diff --git a/lib/Doctrine/DBAL/Platforms/SqlitePlatform.php b/lib/Doctrine/DBAL/Platforms/SqlitePlatform.php index 819421d3469..6eff6b88d79 100644 --- a/lib/Doctrine/DBAL/Platforms/SqlitePlatform.php +++ b/lib/Doctrine/DBAL/Platforms/SqlitePlatform.php @@ -356,8 +356,8 @@ protected function _getCreateTableSQL($name, array $columns, array $options = [] /** * Generate a PRIMARY KEY definition if no autoincrement value is used * - * @param string[] $columns - * @param mixed[] $options + * @param mixed[][] $columns + * @param mixed[] $options */ private function getNonAutoincrementPrimaryKeyDefinition(array $columns, array $options) : string { @@ -368,7 +368,7 @@ private function getNonAutoincrementPrimaryKeyDefinition(array $columns, array $ $keyColumns = array_unique(array_values($options['primary'])); foreach ($keyColumns as $keyColumn) { - if (isset($columns[$keyColumn]['autoincrement']) && ! empty($columns[$keyColumn]['autoincrement'])) { + if (! empty($columns[$keyColumn]['autoincrement'])) { return ''; } }