From ef34319ace82bf99e8b49b0c647c30ca67f42fe4 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Sun, 8 Jan 2023 10:36:33 +0100 Subject: [PATCH] composer update vendor/ --- vendor/composer/installed.json | 14 +- vendor/composer/installed.php | 10 +- .../phpstan-dba/.phpstan-dba-mysqli.cache | 354 ++++++++---------- .../phpstan-dba/.phpstan-dba-pdo-mysql.cache | 354 ++++++++---------- vendor/staabm/phpstan-dba/README.md | 1 - .../staabm/phpstan-dba/docs/configuration.md | 2 +- .../src/Analyzer/QueryPlanAnalyzerMysql.php | 2 +- .../src/DbSchema/SchemaHasherMysql.php | 2 +- .../src/QueryReflection/QueryReflection.php | 10 +- .../QueryReflection/RuntimeConfiguration.php | 2 +- 10 files changed, 325 insertions(+), 426 deletions(-) diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 01d286581..d63c5c0b5 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -768,17 +768,17 @@ }, { "name": "staabm/phpstan-dba", - "version": "0.2.55", - "version_normalized": "0.2.55.0", + "version": "0.2.56", + "version_normalized": "0.2.56.0", "source": { "type": "git", "url": "https://github.com/staabm/phpstan-dba.git", - "reference": "af71a9ea81a9fa95b04b7abf304d73da8a86183c" + "reference": "7d0fb3b98ca4eae8157b787eea5c3bcbefecc867" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/staabm/phpstan-dba/zipball/af71a9ea81a9fa95b04b7abf304d73da8a86183c", - "reference": "af71a9ea81a9fa95b04b7abf304d73da8a86183c", + "url": "https://api.github.com/repos/staabm/phpstan-dba/zipball/7d0fb3b98ca4eae8157b787eea5c3bcbefecc867", + "reference": "7d0fb3b98ca4eae8157b787eea5c3bcbefecc867", "shasum": "" }, "require": { @@ -802,7 +802,7 @@ "tomasvotruba/unused-public": "^0.0.34", "vlucas/phpdotenv": "^5.4" }, - "time": "2023-01-06T19:26:33+00:00", + "time": "2023-01-08T09:26:01+00:00", "type": "phpstan-extension", "extra": { "phpstan": { @@ -823,7 +823,7 @@ ], "support": { "issues": "https://github.com/staabm/phpstan-dba/issues", - "source": "https://github.com/staabm/phpstan-dba/tree/0.2.55" + "source": "https://github.com/staabm/phpstan-dba/tree/0.2.56" }, "install-path": "../staabm/phpstan-dba" }, diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index 642f90c4b..f67ed1c2a 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -3,7 +3,7 @@ 'name' => '__root__', 'pretty_version' => 'dev-main', 'version' => 'dev-main', - 'reference' => '5cb925cb71769f1fab5e6a3db42c1616f41c0556', + 'reference' => 'fac11ba2efb835d7b1e5fbb44d614b61b80bad82', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -13,7 +13,7 @@ '__root__' => array( 'pretty_version' => 'dev-main', 'version' => 'dev-main', - 'reference' => '5cb925cb71769f1fab5e6a3db42c1616f41c0556', + 'reference' => 'fac11ba2efb835d7b1e5fbb44d614b61b80bad82', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -128,9 +128,9 @@ 'dev_requirement' => false, ), 'staabm/phpstan-dba' => array( - 'pretty_version' => '0.2.55', - 'version' => '0.2.55.0', - 'reference' => 'af71a9ea81a9fa95b04b7abf304d73da8a86183c', + 'pretty_version' => '0.2.56', + 'version' => '0.2.56.0', + 'reference' => '7d0fb3b98ca4eae8157b787eea5c3bcbefecc867', 'type' => 'phpstan-extension', 'install_path' => __DIR__ . '/../staabm/phpstan-dba', 'aliases' => array(), diff --git a/vendor/staabm/phpstan-dba/.phpstan-dba-mysqli.cache b/vendor/staabm/phpstan-dba/.phpstan-dba-mysqli.cache index fbce95421..6c0e60b9b 100644 --- a/vendor/staabm/phpstan-dba/.phpstan-dba-mysqli.cache +++ b/vendor/staabm/phpstan-dba/.phpstan-dba-mysqli.cache @@ -14,6 +14,54 @@ array ( 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( + 'keyType' => + PHPStan\Type\UnionType::__set_state(array( + 'sortedTypes' => true, + 'cachedDescriptions' => + array ( + 2 => '0|1|2|\'COLUMN_NAME\'|\'COLUMN_TYPE\'|\'EXTRA\'', + ), + 'types' => + array ( + 0 => + PHPStan\Type\Constant\ConstantIntegerType::__set_state(array( + 'value' => 0, + )), + 1 => + PHPStan\Type\Constant\ConstantIntegerType::__set_state(array( + 'value' => 1, + )), + 2 => + PHPStan\Type\Constant\ConstantIntegerType::__set_state(array( + 'value' => 2, + )), + 3 => + PHPStan\Type\Constant\ConstantStringType::__set_state(array( + 'objectType' => NULL, + 'arrayKeyType' => NULL, + 'value' => 'COLUMN_NAME', + 'isClassString' => false, + )), + 4 => + PHPStan\Type\Constant\ConstantStringType::__set_state(array( + 'objectType' => NULL, + 'arrayKeyType' => NULL, + 'value' => 'COLUMN_TYPE', + 'isClassString' => false, + )), + 5 => + PHPStan\Type\Constant\ConstantStringType::__set_state(array( + 'objectType' => NULL, + 'arrayKeyType' => NULL, + 'value' => 'EXTRA', + 'isClassString' => false, + )), + ), + 'normalized' => false, + )), + 'itemType' => + PHPStan\Type\StringType::__set_state(array( + )), 'allArrays' => NULL, 'nextAutoIndexes' => array ( @@ -80,12 +128,38 @@ array ( ), 'isList' => false, + )), + ), + ), + 'SELECT + MD5( + GROUP_CONCAT( + CONCAT( + COALESCE(COLUMN_NAME, ""), + COALESCE(EXTRA, ""), + COLUMN_TYPE, + IS_NULLABLE + ) + ) + ) AS dbsignature, + 1 AS grouper + FROM + information_schema.columns + WHERE + table_schema = DATABASE() + GROUP BY + grouper' => + array ( + 'result' => + array ( + 5 => + PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'keyType' => PHPStan\Type\UnionType::__set_state(array( 'sortedTypes' => true, 'cachedDescriptions' => array ( - 2 => '0|1|2|\'COLUMN_NAME\'|\'COLUMN_TYPE\'|\'EXTRA\'', + 2 => '0|1|\'dbsignature\'|\'grouper\'', ), 'types' => array ( @@ -98,62 +172,44 @@ 'value' => 1, )), 2 => - PHPStan\Type\Constant\ConstantIntegerType::__set_state(array( - 'value' => 2, - )), - 3 => PHPStan\Type\Constant\ConstantStringType::__set_state(array( 'objectType' => NULL, 'arrayKeyType' => NULL, - 'value' => 'COLUMN_NAME', - 'isClassString' => false, - )), - 4 => - PHPStan\Type\Constant\ConstantStringType::__set_state(array( - 'objectType' => NULL, - 'arrayKeyType' => NULL, - 'value' => 'COLUMN_TYPE', + 'value' => 'dbsignature', 'isClassString' => false, )), - 5 => + 3 => PHPStan\Type\Constant\ConstantStringType::__set_state(array( 'objectType' => NULL, 'arrayKeyType' => NULL, - 'value' => 'EXTRA', + 'value' => 'grouper', 'isClassString' => false, )), ), 'normalized' => false, )), 'itemType' => - PHPStan\Type\StringType::__set_state(array( + PHPStan\Type\UnionType::__set_state(array( + 'sortedTypes' => false, + 'cachedDescriptions' => + array ( + ), + 'types' => + array ( + 0 => + PHPStan\Type\StringType::__set_state(array( + )), + 1 => + PHPStan\Type\IntegerRangeType::__set_state(array( + 'min' => -128, + 'max' => 127, + )), + 2 => + PHPStan\Type\NullType::__set_state(array( + )), + ), + 'normalized' => true, )), - )), - ), - ), - 'SELECT - MD5( - GROUP_CONCAT( - CONCAT( - COALESCE(COLUMN_NAME, ""), - COALESCE(EXTRA, ""), - COLUMN_TYPE, - IS_NULLABLE - ) - ) - ) AS dbsignature, - 1 AS grouper - FROM - information_schema.columns - WHERE - table_schema = DATABASE() - GROUP BY - grouper' => - array ( - 'result' => - array ( - 5 => - PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, 'nextAutoIndexes' => array ( @@ -188,12 +244,9 @@ array ( 0 => PHPStan\Type\UnionType::__set_state(array( - 'sortedTypes' => true, + 'sortedTypes' => false, 'cachedDescriptions' => array ( - 4 => 'string|null', - 2 => 'string|null', - 3 => 'string|null', ), 'types' => array ( @@ -208,12 +261,9 @@ )), 1 => PHPStan\Type\UnionType::__set_state(array( - 'sortedTypes' => true, + 'sortedTypes' => false, 'cachedDescriptions' => array ( - 4 => 'string|null', - 2 => 'string|null', - 3 => 'string|null', ), 'types' => array ( @@ -241,32 +291,26 @@ array ( ), 'isList' => false, + )), + 3 => + PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'keyType' => PHPStan\Type\UnionType::__set_state(array( 'sortedTypes' => true, 'cachedDescriptions' => array ( - 2 => '0|1|\'dbsignature\'|\'grouper\'', - 1 => 'int|string', + 2 => '\'dbsignature\'|\'grouper\'', ), 'types' => array ( 0 => - PHPStan\Type\Constant\ConstantIntegerType::__set_state(array( - 'value' => 0, - )), - 1 => - PHPStan\Type\Constant\ConstantIntegerType::__set_state(array( - 'value' => 1, - )), - 2 => PHPStan\Type\Constant\ConstantStringType::__set_state(array( 'objectType' => NULL, 'arrayKeyType' => NULL, 'value' => 'dbsignature', 'isClassString' => false, )), - 3 => + 1 => PHPStan\Type\Constant\ConstantStringType::__set_state(array( 'objectType' => NULL, 'arrayKeyType' => NULL, @@ -278,30 +322,26 @@ )), 'itemType' => PHPStan\Type\UnionType::__set_state(array( - 'sortedTypes' => true, + 'sortedTypes' => false, 'cachedDescriptions' => array ( - 1 => 'int<-128, 127>|string|null', ), 'types' => array ( 0 => + PHPStan\Type\StringType::__set_state(array( + )), + 1 => PHPStan\Type\IntegerRangeType::__set_state(array( 'min' => -128, 'max' => 127, )), - 1 => - PHPStan\Type\StringType::__set_state(array( - )), 2 => PHPStan\Type\NullType::__set_state(array( )), ), 'normalized' => true, )), - )), - 3 => - PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, 'nextAutoIndexes' => array ( @@ -328,11 +368,9 @@ array ( 0 => PHPStan\Type\UnionType::__set_state(array( - 'sortedTypes' => true, + 'sortedTypes' => false, 'cachedDescriptions' => array ( - 4 => 'string|null', - 3 => 'string|null', ), 'types' => array ( @@ -355,28 +393,57 @@ array ( ), 'isList' => false, + )), + ), + ), + 'SELECT column_name, column_default, is_nullable +FROM information_schema.columns +WHERE table_name = \'1970-01-01\'' => + array ( + 'result' => + array ( + 5 => + PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'keyType' => PHPStan\Type\UnionType::__set_state(array( 'sortedTypes' => true, 'cachedDescriptions' => array ( - 2 => '\'dbsignature\'|\'grouper\'', - 1 => 'string', + 2 => '0|1|2|\'column_default\'|\'column_name\'|\'is_nullable\'', ), 'types' => array ( 0 => + PHPStan\Type\Constant\ConstantIntegerType::__set_state(array( + 'value' => 0, + )), + 1 => + PHPStan\Type\Constant\ConstantIntegerType::__set_state(array( + 'value' => 1, + )), + 2 => + PHPStan\Type\Constant\ConstantIntegerType::__set_state(array( + 'value' => 2, + )), + 3 => PHPStan\Type\Constant\ConstantStringType::__set_state(array( 'objectType' => NULL, 'arrayKeyType' => NULL, - 'value' => 'dbsignature', + 'value' => 'column_default', 'isClassString' => false, )), - 1 => + 4 => PHPStan\Type\Constant\ConstantStringType::__set_state(array( 'objectType' => NULL, 'arrayKeyType' => NULL, - 'value' => 'grouper', + 'value' => 'column_name', + 'isClassString' => false, + )), + 5 => + PHPStan\Type\Constant\ConstantStringType::__set_state(array( + 'objectType' => NULL, + 'arrayKeyType' => NULL, + 'value' => 'is_nullable', 'isClassString' => false, )), ), @@ -384,38 +451,21 @@ )), 'itemType' => PHPStan\Type\UnionType::__set_state(array( - 'sortedTypes' => true, + 'sortedTypes' => false, 'cachedDescriptions' => array ( - 1 => 'int<-128, 127>|string|null', ), 'types' => array ( 0 => - PHPStan\Type\IntegerRangeType::__set_state(array( - 'min' => -128, - 'max' => 127, - )), - 1 => PHPStan\Type\StringType::__set_state(array( )), - 2 => + 1 => PHPStan\Type\NullType::__set_state(array( )), ), 'normalized' => true, )), - )), - ), - ), - 'SELECT column_name, column_default, is_nullable -FROM information_schema.columns -WHERE table_name = \'1970-01-01\'' => - array ( - 'result' => - array ( - 5 => - PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, 'nextAutoIndexes' => array ( @@ -426,13 +476,7 @@ WHERE table_name = \'1970-01-01\'' => 0 => PHPStan\Type\Constant\ConstantStringType::__set_state(array( 'objectType' => NULL, - 'arrayKeyType' => - PHPStan\Type\Constant\ConstantStringType::__set_state(array( - 'objectType' => NULL, - 'arrayKeyType' => NULL, - 'value' => 'column_name', - 'isClassString' => false, - )), + 'arrayKeyType' => NULL, 'value' => 'column_name', 'isClassString' => false, )), @@ -443,13 +487,7 @@ WHERE table_name = \'1970-01-01\'' => 2 => PHPStan\Type\Constant\ConstantStringType::__set_state(array( 'objectType' => NULL, - 'arrayKeyType' => - PHPStan\Type\Constant\ConstantStringType::__set_state(array( - 'objectType' => NULL, - 'arrayKeyType' => NULL, - 'value' => 'column_default', - 'isClassString' => false, - )), + 'arrayKeyType' => NULL, 'value' => 'column_default', 'isClassString' => false, )), @@ -460,13 +498,7 @@ WHERE table_name = \'1970-01-01\'' => 4 => PHPStan\Type\Constant\ConstantStringType::__set_state(array( 'objectType' => NULL, - 'arrayKeyType' => - PHPStan\Type\Constant\ConstantStringType::__set_state(array( - 'objectType' => NULL, - 'arrayKeyType' => NULL, - 'value' => 'is_nullable', - 'isClassString' => false, - )), + 'arrayKeyType' => NULL, 'value' => 'is_nullable', 'isClassString' => false, )), @@ -485,10 +517,9 @@ WHERE table_name = \'1970-01-01\'' => )), 2 => PHPStan\Type\UnionType::__set_state(array( - 'sortedTypes' => true, + 'sortedTypes' => false, 'cachedDescriptions' => array ( - 4 => 'string|null', ), 'types' => array ( @@ -503,10 +534,9 @@ WHERE table_name = \'1970-01-01\'' => )), 3 => PHPStan\Type\UnionType::__set_state(array( - 'sortedTypes' => true, + 'sortedTypes' => false, 'cachedDescriptions' => array ( - 4 => 'string|null', ), 'types' => array ( @@ -530,88 +560,6 @@ WHERE table_name = \'1970-01-01\'' => array ( ), 'isList' => false, - 'keyType' => - PHPStan\Type\UnionType::__set_state(array( - 'sortedTypes' => true, - 'cachedDescriptions' => - array ( - 2 => '0|1|2|\'column_default\'|\'column_name\'|\'is_nullable\'', - 1 => 'int|string', - ), - 'types' => - array ( - 0 => - PHPStan\Type\Constant\ConstantIntegerType::__set_state(array( - 'value' => 0, - )), - 1 => - PHPStan\Type\Constant\ConstantIntegerType::__set_state(array( - 'value' => 1, - )), - 2 => - PHPStan\Type\Constant\ConstantIntegerType::__set_state(array( - 'value' => 2, - )), - 3 => - PHPStan\Type\Constant\ConstantStringType::__set_state(array( - 'objectType' => NULL, - 'arrayKeyType' => - PHPStan\Type\Constant\ConstantStringType::__set_state(array( - 'objectType' => NULL, - 'arrayKeyType' => NULL, - 'value' => 'column_default', - 'isClassString' => false, - )), - 'value' => 'column_default', - 'isClassString' => false, - )), - 4 => - PHPStan\Type\Constant\ConstantStringType::__set_state(array( - 'objectType' => NULL, - 'arrayKeyType' => - PHPStan\Type\Constant\ConstantStringType::__set_state(array( - 'objectType' => NULL, - 'arrayKeyType' => NULL, - 'value' => 'column_name', - 'isClassString' => false, - )), - 'value' => 'column_name', - 'isClassString' => false, - )), - 5 => - PHPStan\Type\Constant\ConstantStringType::__set_state(array( - 'objectType' => NULL, - 'arrayKeyType' => - PHPStan\Type\Constant\ConstantStringType::__set_state(array( - 'objectType' => NULL, - 'arrayKeyType' => NULL, - 'value' => 'is_nullable', - 'isClassString' => false, - )), - 'value' => 'is_nullable', - 'isClassString' => false, - )), - ), - 'normalized' => false, - )), - 'itemType' => - PHPStan\Type\UnionType::__set_state(array( - 'sortedTypes' => true, - 'cachedDescriptions' => - array ( - 1 => 'string|null', - ), - 'types' => - array ( - 0 => - PHPStan\Type\StringType::__set_state(array( - )), - 1 => - PHPStan\Type\NullType::__set_state(array( - )), - ), - 'normalized' => true, - )), )), ), ), diff --git a/vendor/staabm/phpstan-dba/.phpstan-dba-pdo-mysql.cache b/vendor/staabm/phpstan-dba/.phpstan-dba-pdo-mysql.cache index fbce95421..6c0e60b9b 100644 --- a/vendor/staabm/phpstan-dba/.phpstan-dba-pdo-mysql.cache +++ b/vendor/staabm/phpstan-dba/.phpstan-dba-pdo-mysql.cache @@ -14,6 +14,54 @@ array ( 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( + 'keyType' => + PHPStan\Type\UnionType::__set_state(array( + 'sortedTypes' => true, + 'cachedDescriptions' => + array ( + 2 => '0|1|2|\'COLUMN_NAME\'|\'COLUMN_TYPE\'|\'EXTRA\'', + ), + 'types' => + array ( + 0 => + PHPStan\Type\Constant\ConstantIntegerType::__set_state(array( + 'value' => 0, + )), + 1 => + PHPStan\Type\Constant\ConstantIntegerType::__set_state(array( + 'value' => 1, + )), + 2 => + PHPStan\Type\Constant\ConstantIntegerType::__set_state(array( + 'value' => 2, + )), + 3 => + PHPStan\Type\Constant\ConstantStringType::__set_state(array( + 'objectType' => NULL, + 'arrayKeyType' => NULL, + 'value' => 'COLUMN_NAME', + 'isClassString' => false, + )), + 4 => + PHPStan\Type\Constant\ConstantStringType::__set_state(array( + 'objectType' => NULL, + 'arrayKeyType' => NULL, + 'value' => 'COLUMN_TYPE', + 'isClassString' => false, + )), + 5 => + PHPStan\Type\Constant\ConstantStringType::__set_state(array( + 'objectType' => NULL, + 'arrayKeyType' => NULL, + 'value' => 'EXTRA', + 'isClassString' => false, + )), + ), + 'normalized' => false, + )), + 'itemType' => + PHPStan\Type\StringType::__set_state(array( + )), 'allArrays' => NULL, 'nextAutoIndexes' => array ( @@ -80,12 +128,38 @@ array ( ), 'isList' => false, + )), + ), + ), + 'SELECT + MD5( + GROUP_CONCAT( + CONCAT( + COALESCE(COLUMN_NAME, ""), + COALESCE(EXTRA, ""), + COLUMN_TYPE, + IS_NULLABLE + ) + ) + ) AS dbsignature, + 1 AS grouper + FROM + information_schema.columns + WHERE + table_schema = DATABASE() + GROUP BY + grouper' => + array ( + 'result' => + array ( + 5 => + PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'keyType' => PHPStan\Type\UnionType::__set_state(array( 'sortedTypes' => true, 'cachedDescriptions' => array ( - 2 => '0|1|2|\'COLUMN_NAME\'|\'COLUMN_TYPE\'|\'EXTRA\'', + 2 => '0|1|\'dbsignature\'|\'grouper\'', ), 'types' => array ( @@ -98,62 +172,44 @@ 'value' => 1, )), 2 => - PHPStan\Type\Constant\ConstantIntegerType::__set_state(array( - 'value' => 2, - )), - 3 => PHPStan\Type\Constant\ConstantStringType::__set_state(array( 'objectType' => NULL, 'arrayKeyType' => NULL, - 'value' => 'COLUMN_NAME', - 'isClassString' => false, - )), - 4 => - PHPStan\Type\Constant\ConstantStringType::__set_state(array( - 'objectType' => NULL, - 'arrayKeyType' => NULL, - 'value' => 'COLUMN_TYPE', + 'value' => 'dbsignature', 'isClassString' => false, )), - 5 => + 3 => PHPStan\Type\Constant\ConstantStringType::__set_state(array( 'objectType' => NULL, 'arrayKeyType' => NULL, - 'value' => 'EXTRA', + 'value' => 'grouper', 'isClassString' => false, )), ), 'normalized' => false, )), 'itemType' => - PHPStan\Type\StringType::__set_state(array( + PHPStan\Type\UnionType::__set_state(array( + 'sortedTypes' => false, + 'cachedDescriptions' => + array ( + ), + 'types' => + array ( + 0 => + PHPStan\Type\StringType::__set_state(array( + )), + 1 => + PHPStan\Type\IntegerRangeType::__set_state(array( + 'min' => -128, + 'max' => 127, + )), + 2 => + PHPStan\Type\NullType::__set_state(array( + )), + ), + 'normalized' => true, )), - )), - ), - ), - 'SELECT - MD5( - GROUP_CONCAT( - CONCAT( - COALESCE(COLUMN_NAME, ""), - COALESCE(EXTRA, ""), - COLUMN_TYPE, - IS_NULLABLE - ) - ) - ) AS dbsignature, - 1 AS grouper - FROM - information_schema.columns - WHERE - table_schema = DATABASE() - GROUP BY - grouper' => - array ( - 'result' => - array ( - 5 => - PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, 'nextAutoIndexes' => array ( @@ -188,12 +244,9 @@ array ( 0 => PHPStan\Type\UnionType::__set_state(array( - 'sortedTypes' => true, + 'sortedTypes' => false, 'cachedDescriptions' => array ( - 4 => 'string|null', - 2 => 'string|null', - 3 => 'string|null', ), 'types' => array ( @@ -208,12 +261,9 @@ )), 1 => PHPStan\Type\UnionType::__set_state(array( - 'sortedTypes' => true, + 'sortedTypes' => false, 'cachedDescriptions' => array ( - 4 => 'string|null', - 2 => 'string|null', - 3 => 'string|null', ), 'types' => array ( @@ -241,32 +291,26 @@ array ( ), 'isList' => false, + )), + 3 => + PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'keyType' => PHPStan\Type\UnionType::__set_state(array( 'sortedTypes' => true, 'cachedDescriptions' => array ( - 2 => '0|1|\'dbsignature\'|\'grouper\'', - 1 => 'int|string', + 2 => '\'dbsignature\'|\'grouper\'', ), 'types' => array ( 0 => - PHPStan\Type\Constant\ConstantIntegerType::__set_state(array( - 'value' => 0, - )), - 1 => - PHPStan\Type\Constant\ConstantIntegerType::__set_state(array( - 'value' => 1, - )), - 2 => PHPStan\Type\Constant\ConstantStringType::__set_state(array( 'objectType' => NULL, 'arrayKeyType' => NULL, 'value' => 'dbsignature', 'isClassString' => false, )), - 3 => + 1 => PHPStan\Type\Constant\ConstantStringType::__set_state(array( 'objectType' => NULL, 'arrayKeyType' => NULL, @@ -278,30 +322,26 @@ )), 'itemType' => PHPStan\Type\UnionType::__set_state(array( - 'sortedTypes' => true, + 'sortedTypes' => false, 'cachedDescriptions' => array ( - 1 => 'int<-128, 127>|string|null', ), 'types' => array ( 0 => + PHPStan\Type\StringType::__set_state(array( + )), + 1 => PHPStan\Type\IntegerRangeType::__set_state(array( 'min' => -128, 'max' => 127, )), - 1 => - PHPStan\Type\StringType::__set_state(array( - )), 2 => PHPStan\Type\NullType::__set_state(array( )), ), 'normalized' => true, )), - )), - 3 => - PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, 'nextAutoIndexes' => array ( @@ -328,11 +368,9 @@ array ( 0 => PHPStan\Type\UnionType::__set_state(array( - 'sortedTypes' => true, + 'sortedTypes' => false, 'cachedDescriptions' => array ( - 4 => 'string|null', - 3 => 'string|null', ), 'types' => array ( @@ -355,28 +393,57 @@ array ( ), 'isList' => false, + )), + ), + ), + 'SELECT column_name, column_default, is_nullable +FROM information_schema.columns +WHERE table_name = \'1970-01-01\'' => + array ( + 'result' => + array ( + 5 => + PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'keyType' => PHPStan\Type\UnionType::__set_state(array( 'sortedTypes' => true, 'cachedDescriptions' => array ( - 2 => '\'dbsignature\'|\'grouper\'', - 1 => 'string', + 2 => '0|1|2|\'column_default\'|\'column_name\'|\'is_nullable\'', ), 'types' => array ( 0 => + PHPStan\Type\Constant\ConstantIntegerType::__set_state(array( + 'value' => 0, + )), + 1 => + PHPStan\Type\Constant\ConstantIntegerType::__set_state(array( + 'value' => 1, + )), + 2 => + PHPStan\Type\Constant\ConstantIntegerType::__set_state(array( + 'value' => 2, + )), + 3 => PHPStan\Type\Constant\ConstantStringType::__set_state(array( 'objectType' => NULL, 'arrayKeyType' => NULL, - 'value' => 'dbsignature', + 'value' => 'column_default', 'isClassString' => false, )), - 1 => + 4 => PHPStan\Type\Constant\ConstantStringType::__set_state(array( 'objectType' => NULL, 'arrayKeyType' => NULL, - 'value' => 'grouper', + 'value' => 'column_name', + 'isClassString' => false, + )), + 5 => + PHPStan\Type\Constant\ConstantStringType::__set_state(array( + 'objectType' => NULL, + 'arrayKeyType' => NULL, + 'value' => 'is_nullable', 'isClassString' => false, )), ), @@ -384,38 +451,21 @@ )), 'itemType' => PHPStan\Type\UnionType::__set_state(array( - 'sortedTypes' => true, + 'sortedTypes' => false, 'cachedDescriptions' => array ( - 1 => 'int<-128, 127>|string|null', ), 'types' => array ( 0 => - PHPStan\Type\IntegerRangeType::__set_state(array( - 'min' => -128, - 'max' => 127, - )), - 1 => PHPStan\Type\StringType::__set_state(array( )), - 2 => + 1 => PHPStan\Type\NullType::__set_state(array( )), ), 'normalized' => true, )), - )), - ), - ), - 'SELECT column_name, column_default, is_nullable -FROM information_schema.columns -WHERE table_name = \'1970-01-01\'' => - array ( - 'result' => - array ( - 5 => - PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, 'nextAutoIndexes' => array ( @@ -426,13 +476,7 @@ WHERE table_name = \'1970-01-01\'' => 0 => PHPStan\Type\Constant\ConstantStringType::__set_state(array( 'objectType' => NULL, - 'arrayKeyType' => - PHPStan\Type\Constant\ConstantStringType::__set_state(array( - 'objectType' => NULL, - 'arrayKeyType' => NULL, - 'value' => 'column_name', - 'isClassString' => false, - )), + 'arrayKeyType' => NULL, 'value' => 'column_name', 'isClassString' => false, )), @@ -443,13 +487,7 @@ WHERE table_name = \'1970-01-01\'' => 2 => PHPStan\Type\Constant\ConstantStringType::__set_state(array( 'objectType' => NULL, - 'arrayKeyType' => - PHPStan\Type\Constant\ConstantStringType::__set_state(array( - 'objectType' => NULL, - 'arrayKeyType' => NULL, - 'value' => 'column_default', - 'isClassString' => false, - )), + 'arrayKeyType' => NULL, 'value' => 'column_default', 'isClassString' => false, )), @@ -460,13 +498,7 @@ WHERE table_name = \'1970-01-01\'' => 4 => PHPStan\Type\Constant\ConstantStringType::__set_state(array( 'objectType' => NULL, - 'arrayKeyType' => - PHPStan\Type\Constant\ConstantStringType::__set_state(array( - 'objectType' => NULL, - 'arrayKeyType' => NULL, - 'value' => 'is_nullable', - 'isClassString' => false, - )), + 'arrayKeyType' => NULL, 'value' => 'is_nullable', 'isClassString' => false, )), @@ -485,10 +517,9 @@ WHERE table_name = \'1970-01-01\'' => )), 2 => PHPStan\Type\UnionType::__set_state(array( - 'sortedTypes' => true, + 'sortedTypes' => false, 'cachedDescriptions' => array ( - 4 => 'string|null', ), 'types' => array ( @@ -503,10 +534,9 @@ WHERE table_name = \'1970-01-01\'' => )), 3 => PHPStan\Type\UnionType::__set_state(array( - 'sortedTypes' => true, + 'sortedTypes' => false, 'cachedDescriptions' => array ( - 4 => 'string|null', ), 'types' => array ( @@ -530,88 +560,6 @@ WHERE table_name = \'1970-01-01\'' => array ( ), 'isList' => false, - 'keyType' => - PHPStan\Type\UnionType::__set_state(array( - 'sortedTypes' => true, - 'cachedDescriptions' => - array ( - 2 => '0|1|2|\'column_default\'|\'column_name\'|\'is_nullable\'', - 1 => 'int|string', - ), - 'types' => - array ( - 0 => - PHPStan\Type\Constant\ConstantIntegerType::__set_state(array( - 'value' => 0, - )), - 1 => - PHPStan\Type\Constant\ConstantIntegerType::__set_state(array( - 'value' => 1, - )), - 2 => - PHPStan\Type\Constant\ConstantIntegerType::__set_state(array( - 'value' => 2, - )), - 3 => - PHPStan\Type\Constant\ConstantStringType::__set_state(array( - 'objectType' => NULL, - 'arrayKeyType' => - PHPStan\Type\Constant\ConstantStringType::__set_state(array( - 'objectType' => NULL, - 'arrayKeyType' => NULL, - 'value' => 'column_default', - 'isClassString' => false, - )), - 'value' => 'column_default', - 'isClassString' => false, - )), - 4 => - PHPStan\Type\Constant\ConstantStringType::__set_state(array( - 'objectType' => NULL, - 'arrayKeyType' => - PHPStan\Type\Constant\ConstantStringType::__set_state(array( - 'objectType' => NULL, - 'arrayKeyType' => NULL, - 'value' => 'column_name', - 'isClassString' => false, - )), - 'value' => 'column_name', - 'isClassString' => false, - )), - 5 => - PHPStan\Type\Constant\ConstantStringType::__set_state(array( - 'objectType' => NULL, - 'arrayKeyType' => - PHPStan\Type\Constant\ConstantStringType::__set_state(array( - 'objectType' => NULL, - 'arrayKeyType' => NULL, - 'value' => 'is_nullable', - 'isClassString' => false, - )), - 'value' => 'is_nullable', - 'isClassString' => false, - )), - ), - 'normalized' => false, - )), - 'itemType' => - PHPStan\Type\UnionType::__set_state(array( - 'sortedTypes' => true, - 'cachedDescriptions' => - array ( - 1 => 'string|null', - ), - 'types' => - array ( - 0 => - PHPStan\Type\StringType::__set_state(array( - )), - 1 => - PHPStan\Type\NullType::__set_state(array( - )), - ), - 'normalized' => true, - )), )), ), ), diff --git a/vendor/staabm/phpstan-dba/README.md b/vendor/staabm/phpstan-dba/README.md index b293b9402..b8ad8fb9e 100644 --- a/vendor/staabm/phpstan-dba/README.md +++ b/vendor/staabm/phpstan-dba/README.md @@ -57,7 +57,6 @@ $config = new RuntimeConfiguration(); // $config->debugMode(true); // $config->stringifyTypes(true); // $config->analyzeQueryPlans(true); -// $config->analyzeWriteQueries(true); // requires transaction support in db schema and db driver // TODO: Put your database credentials here $mysqli = new mysqli('hostname', 'username', 'password', 'database'); diff --git a/vendor/staabm/phpstan-dba/docs/configuration.md b/vendor/staabm/phpstan-dba/docs/configuration.md index 109ed6c3e..7a336f2ac 100644 --- a/vendor/staabm/phpstan-dba/docs/configuration.md +++ b/vendor/staabm/phpstan-dba/docs/configuration.md @@ -8,4 +8,4 @@ If not configured otherwise, the following defaults are used: - when analyzing a php8+ codebase, [`PDO::ERRMODE_EXCEPTION` error handling](https://www.php.net/manual/en/pdo.error-handling.php) is assumed. - when analyzing a php8.1+ codebase, [`mysqli_report(\MYSQLI_REPORT_ERROR | \MYSQLI_REPORT_STRICT);` error handling](https://www.php.net/mysqli_report) is assumed. - the fetch mode defaults to `QueryReflector::FETCH_TYPE_BOTH`, but can be configured using the [`defaultFetchMode`](https://github.com/staabm/phpstan-dba/tree/main/src/QueryReflection/RuntimeConfiguration.php) option. -- only readable queries are analyzed per default. In case your database schema and database driver support transactions, you may consider enabled writable queries using the [`analyzeWriteQueries`](https://github.com/staabm/phpstan-dba/tree/main/src/QueryReflection/RuntimeConfiguration.php) option. +- read and write queries are analyzed per default. you may consider disable write query analysis using the [`analyzeWriteQueries`](https://github.com/staabm/phpstan-dba/tree/main/src/QueryReflection/RuntimeConfiguration.php) option. diff --git a/vendor/staabm/phpstan-dba/src/Analyzer/QueryPlanAnalyzerMysql.php b/vendor/staabm/phpstan-dba/src/Analyzer/QueryPlanAnalyzerMysql.php index f13f56f4f..2dc7a8da2 100644 --- a/vendor/staabm/phpstan-dba/src/Analyzer/QueryPlanAnalyzerMysql.php +++ b/vendor/staabm/phpstan-dba/src/Analyzer/QueryPlanAnalyzerMysql.php @@ -62,7 +62,7 @@ public function analyze(string $query): QueryPlanResult $this->connection->rollBack(); } } else { - $this->connection->begin_transaction(); + $this->connection->begin_transaction(\MYSQLI_TRANS_START_READ_ONLY); try { $result = $this->connection->query($simulatedQuery); diff --git a/vendor/staabm/phpstan-dba/src/DbSchema/SchemaHasherMysql.php b/vendor/staabm/phpstan-dba/src/DbSchema/SchemaHasherMysql.php index acaa600fc..6054a2a82 100644 --- a/vendor/staabm/phpstan-dba/src/DbSchema/SchemaHasherMysql.php +++ b/vendor/staabm/phpstan-dba/src/DbSchema/SchemaHasherMysql.php @@ -72,7 +72,7 @@ public function hashDb(): string $this->connection->rollBack(); } } else { - $this->connection->begin_transaction(); + $this->connection->begin_transaction(\MYSQLI_TRANS_START_READ_ONLY); try { $result = $this->connection->query($query); diff --git a/vendor/staabm/phpstan-dba/src/QueryReflection/QueryReflection.php b/vendor/staabm/phpstan-dba/src/QueryReflection/QueryReflection.php index 068ac9226..1da5fd091 100644 --- a/vendor/staabm/phpstan-dba/src/QueryReflection/QueryReflection.php +++ b/vendor/staabm/phpstan-dba/src/QueryReflection/QueryReflection.php @@ -59,18 +59,22 @@ public static function setupReflector(QueryReflector $reflector, RuntimeConfigur public function validateQueryString(string $queryString): ?Error { + $queryType = self::getQueryType($queryString); + if (self::getRuntimeConfiguration()->isAnalyzingWriteQueries()) { - if (!\in_array(self::getQueryType($queryString), [ - 'SELECT', + if (\in_array($queryType, [ 'INSERT', 'DELETE', 'UPDATE', 'REPLACE', ], true)) { + // turn write queries into explain, so we don't need to execute a query which might modify data + $queryString = 'EXPLAIN '.$queryString; + } elseif ('SELECT' !== $queryType) { return null; } } else { - if ('SELECT' !== self::getQueryType($queryString)) { + if ('SELECT' !== $queryType) { return null; } } diff --git a/vendor/staabm/phpstan-dba/src/QueryReflection/RuntimeConfiguration.php b/vendor/staabm/phpstan-dba/src/QueryReflection/RuntimeConfiguration.php index 7ff8a321d..6e55c9551 100644 --- a/vendor/staabm/phpstan-dba/src/QueryReflection/RuntimeConfiguration.php +++ b/vendor/staabm/phpstan-dba/src/QueryReflection/RuntimeConfiguration.php @@ -46,7 +46,7 @@ final class RuntimeConfiguration /** * @var bool */ - private $writableQueries = false; + private $writableQueries = true; /** * @var bool|0|positive-int */