From adc9dec13615ee71684e7e1d7fdd0ac99f780ca9 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Fri, 22 Apr 2022 14:42:06 +0200 Subject: [PATCH] placeholder count is not correct when quotes involved (#337) Co-authored-by: Markus Staab --- .phpstan-dba-mysqli.cache | 221 ++++++- .phpstan-dba-pdo.cache | 30 +- src/QueryReflection/QueryReflection.php | 4 +- .../default/config/.phpstan-dba-mysqli.cache | 542 +++++++++++++++-- tests/default/config/.phpstan-dba-pdo.cache | 542 +++++++++++++++-- .../config/.phpunit-phpstan-dba-mysqli.cache | 552 ++++++++++++++++-- .../config/.phpunit-phpstan-dba-pdo.cache | 542 +++++++++++++++-- .../config/.phpstan-dba-mysqli.cache | 10 +- .../config/.phpstan-dba-pdo.cache | 10 +- .../config/.phpunit-phpstan-dba-mysqli.cache | 10 +- .../config/.phpunit-phpstan-dba-pdo.cache | 10 +- .../config/.phpstan-dba-mysqli.cache | 10 +- .../config/.phpstan-dba-pdo.cache | 10 +- .../config/.phpunit-phpstan-dba-mysqli.cache | 10 +- .../config/.phpunit-phpstan-dba-pdo.cache | 10 +- tests/rules/config/.phpstan-dba-mysqli.cache | 340 ++++++++++- tests/rules/config/.phpstan-dba-pdo.cache | 340 ++++++++++- .../config/.phpunit-phpstan-dba-mysqli.cache | 4 + .../config/.phpunit-phpstan-dba-pdo.cache | 4 + tests/rules/data/pdo-stmt-execute-error.php | 26 + .../config/.phpstan-dba-mysqli.cache | 5 +- tests/stringify/config/.phpstan-dba-pdo.cache | 5 +- .../config/.phpunit-phpstan-dba-mysqli.cache | 5 +- .../config/.phpunit-phpstan-dba-pdo.cache | 5 +- 24 files changed, 2995 insertions(+), 252 deletions(-) diff --git a/.phpstan-dba-mysqli.cache b/.phpstan-dba-mysqli.cache index 2050257ac..410a2b6da 100644 --- a/.phpstan-dba-mysqli.cache +++ b/.phpstan-dba-mysqli.cache @@ -28,6 +28,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 2, + ), 'keyTypes' => array ( 0 => @@ -82,7 +86,6 @@ PHPStan\Type\IntegerType::__set_state(array( )), ), - 'nextAutoIndex' => 2, 'optionalKeys' => array ( ), @@ -129,6 +132,211 @@ 3 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 0, + ), + 'keyTypes' => + array ( + 0 => + PHPStan\Type\Constant\ConstantStringType::__set_state(array( + 'value' => 'dbsignature', + 'isClassString' => false, + )), + 1 => + PHPStan\Type\Constant\ConstantStringType::__set_state(array( + 'value' => 'grouper', + 'isClassString' => false, + )), + ), + 'valueTypes' => + array ( + 0 => + PHPStan\Type\UnionType::__set_state(array( + 'types' => + array ( + 0 => + PHPStan\Type\StringType::__set_state(array( + )), + 1 => + PHPStan\Type\NullType::__set_state(array( + )), + ), + )), + 1 => + PHPStan\Type\IntegerType::__set_state(array( + )), + ), + 'optionalKeys' => + array ( + ), + 'keyType' => + PHPStan\Type\UnionType::__set_state(array( + 'types' => + array ( + 0 => + PHPStan\Type\Constant\ConstantStringType::__set_state(array( + 'value' => 'dbsignature', + 'isClassString' => false, + )), + 1 => + PHPStan\Type\Constant\ConstantStringType::__set_state(array( + 'value' => 'grouper', + 'isClassString' => false, + )), + ), + )), + 'itemType' => + PHPStan\Type\UnionType::__set_state(array( + 'types' => + array ( + 0 => + PHPStan\Type\IntegerType::__set_state(array( + )), + 1 => + PHPStan\Type\StringType::__set_state(array( + )), + 2 => + PHPStan\Type\NullType::__set_state(array( + )), + ), + )), + )), + ), + ), + ' + 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 ( + 0 => 2, + ), + 'keyTypes' => + array ( + 0 => + PHPStan\Type\Constant\ConstantStringType::__set_state(array( + 'value' => 'dbsignature', + 'isClassString' => false, + )), + 1 => + PHPStan\Type\Constant\ConstantIntegerType::__set_state(array( + 'value' => 0, + )), + 2 => + PHPStan\Type\Constant\ConstantStringType::__set_state(array( + 'value' => 'grouper', + 'isClassString' => false, + )), + 3 => + PHPStan\Type\Constant\ConstantIntegerType::__set_state(array( + 'value' => 1, + )), + ), + 'valueTypes' => + array ( + 0 => + PHPStan\Type\UnionType::__set_state(array( + 'types' => + array ( + 0 => + PHPStan\Type\StringType::__set_state(array( + )), + 1 => + PHPStan\Type\NullType::__set_state(array( + )), + ), + )), + 1 => + PHPStan\Type\UnionType::__set_state(array( + 'types' => + array ( + 0 => + PHPStan\Type\StringType::__set_state(array( + )), + 1 => + PHPStan\Type\NullType::__set_state(array( + )), + ), + )), + 2 => + PHPStan\Type\IntegerType::__set_state(array( + )), + 3 => + PHPStan\Type\IntegerType::__set_state(array( + )), + ), + 'optionalKeys' => + array ( + ), + 'keyType' => + PHPStan\Type\UnionType::__set_state(array( + '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( + 'value' => 'dbsignature', + 'isClassString' => false, + )), + 3 => + PHPStan\Type\Constant\ConstantStringType::__set_state(array( + 'value' => 'grouper', + 'isClassString' => false, + )), + ), + )), + 'itemType' => + PHPStan\Type\UnionType::__set_state(array( + 'types' => + array ( + 0 => + PHPStan\Type\IntegerType::__set_state(array( + )), + 1 => + PHPStan\Type\StringType::__set_state(array( + )), + 2 => + PHPStan\Type\NullType::__set_state(array( + )), + ), + )), + )), + 3 => + PHPStan\Type\Constant\ConstantArrayType::__set_state(array( + 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 0, + ), 'keyTypes' => array ( 0 => @@ -160,7 +368,6 @@ PHPStan\Type\IntegerType::__set_state(array( )), ), - 'nextAutoIndex' => 0, 'optionalKeys' => array ( ), @@ -210,6 +417,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 3, + ), 'keyTypes' => array ( 0 => @@ -261,7 +472,6 @@ PHPStan\Type\StringType::__set_state(array( )), ), - 'nextAutoIndex' => 3, 'optionalKeys' => array ( ), @@ -323,6 +533,10 @@ 3 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 0, + ), 'keyTypes' => array ( 0 => @@ -367,7 +581,6 @@ 'max' => 127, )), ), - 'nextAutoIndex' => 0, 'optionalKeys' => array ( ), diff --git a/.phpstan-dba-pdo.cache b/.phpstan-dba-pdo.cache index 6d08df52d..9989e9981 100644 --- a/.phpstan-dba-pdo.cache +++ b/.phpstan-dba-pdo.cache @@ -28,6 +28,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 2, + ), 'keyTypes' => array ( 0 => @@ -82,7 +86,6 @@ PHPStan\Type\IntegerType::__set_state(array( )), ), - 'nextAutoIndex' => 2, 'optionalKeys' => array ( ), @@ -129,6 +132,10 @@ 3 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 0, + ), 'keyTypes' => array ( 0 => @@ -160,7 +167,6 @@ PHPStan\Type\IntegerType::__set_state(array( )), ), - 'nextAutoIndex' => 0, 'optionalKeys' => array ( ), @@ -223,6 +229,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 2, + ), 'keyTypes' => array ( 0 => @@ -277,7 +287,6 @@ PHPStan\Type\IntegerType::__set_state(array( )), ), - 'nextAutoIndex' => 2, 'optionalKeys' => array ( ), @@ -324,6 +333,10 @@ 3 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 0, + ), 'keyTypes' => array ( 0 => @@ -355,7 +368,6 @@ PHPStan\Type\IntegerType::__set_state(array( )), ), - 'nextAutoIndex' => 0, 'optionalKeys' => array ( ), @@ -405,6 +417,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 3, + ), 'keyTypes' => array ( 0 => @@ -456,7 +472,6 @@ PHPStan\Type\StringType::__set_state(array( )), ), - 'nextAutoIndex' => 3, 'optionalKeys' => array ( ), @@ -523,6 +538,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 3, + ), 'keyTypes' => array ( 0 => @@ -574,7 +593,6 @@ PHPStan\Type\StringType::__set_state(array( )), ), - 'nextAutoIndex' => 3, 'optionalKeys' => array ( ), diff --git a/src/QueryReflection/QueryReflection.php b/src/QueryReflection/QueryReflection.php index 38a6662bb..a83eb1201 100644 --- a/src/QueryReflection/QueryReflection.php +++ b/src/QueryReflection/QueryReflection.php @@ -24,8 +24,8 @@ final class QueryReflection // see https://github.com/php/php-src/blob/01b3fc03c30c6cb85038250bb5640be3a09c6a32/ext/pdo/pdo_sql_parser.re#L48 private const NAMED_PATTERN = ':[a-zA-Z0-9_]+'; - private const REGEX_UNNAMED_PLACEHOLDER = '{(["\'])([^"\']+\1)|('.self::UNNAMED_PATTERN.')}'; - private const REGEX_NAMED_PLACEHOLDER = '{(["\'])([^"\']+\1)|('.self::NAMED_PATTERN.')}'; + private const REGEX_UNNAMED_PLACEHOLDER = '{(["\'])([^"\']*\1)|('.self::UNNAMED_PATTERN.')}'; + private const REGEX_NAMED_PLACEHOLDER = '{(["\'])([^"\']*\1)|('.self::NAMED_PATTERN.')}'; /** * @var QueryReflector|null diff --git a/tests/default/config/.phpstan-dba-mysqli.cache b/tests/default/config/.phpstan-dba-mysqli.cache index 1f09a6bc8..e740a23cb 100644 --- a/tests/default/config/.phpstan-dba-mysqli.cache +++ b/tests/default/config/.phpstan-dba-mysqli.cache @@ -10,6 +10,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 35, + ), 'keyTypes' => array ( 0 => @@ -805,7 +809,6 @@ 'max' => NULL, )), ), - 'nextAutoIndex' => 35, 'optionalKeys' => array ( ), @@ -1158,6 +1161,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 4, + ), 'keyTypes' => array ( 0 => @@ -1286,7 +1293,6 @@ ), )), ), - 'nextAutoIndex' => 4, 'optionalKeys' => array ( ), @@ -1357,6 +1363,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 1, + ), 'keyTypes' => array ( 0 => @@ -1382,7 +1392,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 1, 'optionalKeys' => array ( ), @@ -1410,6 +1419,10 @@ 3 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 0, + ), 'keyTypes' => array ( 0 => @@ -1426,7 +1439,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 0, 'optionalKeys' => array ( ), @@ -1450,6 +1462,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 1, + ), 'keyTypes' => array ( 0 => @@ -1475,7 +1491,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 1, 'optionalKeys' => array ( ), @@ -1509,6 +1524,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 1, + ), 'keyTypes' => array ( 0 => @@ -1534,7 +1553,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 1, 'optionalKeys' => array ( ), @@ -1568,6 +1586,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 1, + ), 'keyTypes' => array ( 0 => @@ -1593,7 +1615,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 1, 'optionalKeys' => array ( ), @@ -1627,6 +1648,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 1, + ), 'keyTypes' => array ( 0 => @@ -1652,7 +1677,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 1, 'optionalKeys' => array ( ), @@ -1686,6 +1710,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 1, + ), 'keyTypes' => array ( 0 => @@ -1711,7 +1739,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 1, 'optionalKeys' => array ( ), @@ -1745,6 +1772,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 1, + ), 'keyTypes' => array ( 0 => @@ -1770,7 +1801,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 1, 'optionalKeys' => array ( ), @@ -1825,6 +1855,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 1, + ), 'keyTypes' => array ( 0 => @@ -1850,7 +1884,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 1, 'optionalKeys' => array ( ), @@ -1884,6 +1917,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 1, + ), 'keyTypes' => array ( 0 => @@ -1909,7 +1946,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 1, 'optionalKeys' => array ( ), @@ -1943,6 +1979,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 1, + ), 'keyTypes' => array ( 0 => @@ -1968,7 +2008,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 1, 'optionalKeys' => array ( ), @@ -2002,6 +2041,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 1, + ), 'keyTypes' => array ( 0 => @@ -2027,7 +2070,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 1, 'optionalKeys' => array ( ), @@ -2061,6 +2103,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 1, + ), 'keyTypes' => array ( 0 => @@ -2086,7 +2132,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 1, 'optionalKeys' => array ( ), @@ -2120,6 +2165,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 1, + ), 'keyTypes' => array ( 0 => @@ -2145,7 +2194,6 @@ 'max' => 2147483647, )), ), - 'nextAutoIndex' => 1, 'optionalKeys' => array ( ), @@ -2179,6 +2227,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 1, + ), 'keyTypes' => array ( 0 => @@ -2204,7 +2256,6 @@ 'max' => 2147483647, )), ), - 'nextAutoIndex' => 1, 'optionalKeys' => array ( ), @@ -2238,6 +2289,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 1, + ), 'keyTypes' => array ( 0 => @@ -2259,7 +2314,6 @@ PHPStan\Type\IntegerType::__set_state(array( )), ), - 'nextAutoIndex' => 1, 'optionalKeys' => array ( ), @@ -2291,6 +2345,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 1, + ), 'keyTypes' => array ( 0 => @@ -2312,7 +2370,6 @@ PHPStan\Type\IntegerType::__set_state(array( )), ), - 'nextAutoIndex' => 1, 'optionalKeys' => array ( ), @@ -2344,6 +2401,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 1, + ), 'keyTypes' => array ( 0 => @@ -2387,7 +2448,6 @@ ), )), ), - 'nextAutoIndex' => 1, 'optionalKeys' => array ( ), @@ -2430,6 +2490,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 1, + ), 'keyTypes' => array ( 0 => @@ -2451,7 +2515,6 @@ PHPStan\Type\StringType::__set_state(array( )), ), - 'nextAutoIndex' => 1, 'optionalKeys' => array ( ), @@ -2477,6 +2540,10 @@ 3 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 0, + ), 'keyTypes' => array ( 0 => @@ -2491,7 +2558,6 @@ PHPStan\Type\StringType::__set_state(array( )), ), - 'nextAutoIndex' => 0, 'optionalKeys' => array ( ), @@ -2520,6 +2586,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 2, + ), 'keyTypes' => array ( 0 => @@ -2560,7 +2630,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 2, 'optionalKeys' => array ( ), @@ -2606,6 +2675,10 @@ 3 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 0, + ), 'keyTypes' => array ( 0 => @@ -2630,7 +2703,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 0, 'optionalKeys' => array ( ), @@ -2674,6 +2746,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 2, + ), 'keyTypes' => array ( 0 => @@ -2714,7 +2790,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 2, 'optionalKeys' => array ( ), @@ -2766,6 +2841,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 2, + ), 'keyTypes' => array ( 0 => @@ -2806,7 +2885,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 2, 'optionalKeys' => array ( ), @@ -2858,6 +2936,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 2, + ), 'keyTypes' => array ( 0 => @@ -2898,7 +2980,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 2, 'optionalKeys' => array ( ), @@ -2950,6 +3031,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 2, + ), 'keyTypes' => array ( 0 => @@ -2990,7 +3075,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 2, 'optionalKeys' => array ( ), @@ -3042,6 +3126,200 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 2, + ), + 'keyTypes' => + array ( + 0 => + PHPStan\Type\Constant\ConstantStringType::__set_state(array( + 'value' => 'email', + 'isClassString' => false, + )), + 1 => + PHPStan\Type\Constant\ConstantIntegerType::__set_state(array( + 'value' => 0, + )), + 2 => + PHPStan\Type\Constant\ConstantStringType::__set_state(array( + 'value' => 'adaid', + 'isClassString' => false, + )), + 3 => + PHPStan\Type\Constant\ConstantIntegerType::__set_state(array( + 'value' => 1, + )), + ), + 'valueTypes' => + array ( + 0 => + PHPStan\Type\StringType::__set_state(array( + )), + 1 => + PHPStan\Type\StringType::__set_state(array( + )), + 2 => + PHPStan\Type\IntegerRangeType::__set_state(array( + 'min' => -32768, + 'max' => 32767, + )), + 3 => + PHPStan\Type\IntegerRangeType::__set_state(array( + 'min' => -32768, + 'max' => 32767, + )), + ), + 'optionalKeys' => + array ( + ), + 'keyType' => + PHPStan\Type\UnionType::__set_state(array( + '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( + 'value' => 'adaid', + 'isClassString' => false, + )), + 3 => + PHPStan\Type\Constant\ConstantStringType::__set_state(array( + 'value' => 'email', + 'isClassString' => false, + )), + ), + )), + 'itemType' => + PHPStan\Type\UnionType::__set_state(array( + 'types' => + array ( + 0 => + PHPStan\Type\IntegerRangeType::__set_state(array( + 'min' => -32768, + 'max' => 32767, + )), + 1 => + PHPStan\Type\StringType::__set_state(array( + )), + ), + )), + )), + ), + ), + 'SELECT email, adaid FROM ada WHERE adaid = 2' => + array ( + 'result' => + array ( + 5 => + PHPStan\Type\Constant\ConstantArrayType::__set_state(array( + 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 2, + ), + 'keyTypes' => + array ( + 0 => + PHPStan\Type\Constant\ConstantStringType::__set_state(array( + 'value' => 'email', + 'isClassString' => false, + )), + 1 => + PHPStan\Type\Constant\ConstantIntegerType::__set_state(array( + 'value' => 0, + )), + 2 => + PHPStan\Type\Constant\ConstantStringType::__set_state(array( + 'value' => 'adaid', + 'isClassString' => false, + )), + 3 => + PHPStan\Type\Constant\ConstantIntegerType::__set_state(array( + 'value' => 1, + )), + ), + 'valueTypes' => + array ( + 0 => + PHPStan\Type\StringType::__set_state(array( + )), + 1 => + PHPStan\Type\StringType::__set_state(array( + )), + 2 => + PHPStan\Type\IntegerRangeType::__set_state(array( + 'min' => -32768, + 'max' => 32767, + )), + 3 => + PHPStan\Type\IntegerRangeType::__set_state(array( + 'min' => -32768, + 'max' => 32767, + )), + ), + 'optionalKeys' => + array ( + ), + 'keyType' => + PHPStan\Type\UnionType::__set_state(array( + '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( + 'value' => 'adaid', + 'isClassString' => false, + )), + 3 => + PHPStan\Type\Constant\ConstantStringType::__set_state(array( + 'value' => 'email', + 'isClassString' => false, + )), + ), + )), + 'itemType' => + PHPStan\Type\UnionType::__set_state(array( + 'types' => + array ( + 0 => + PHPStan\Type\IntegerRangeType::__set_state(array( + 'min' => -32768, + 'max' => 32767, + )), + 1 => + PHPStan\Type\StringType::__set_state(array( + )), + ), + )), + )), + ), + ), + 'SELECT email, adaid FROM ada WHERE adaid = 3' => + array ( + 'result' => + array ( + 5 => + PHPStan\Type\Constant\ConstantArrayType::__set_state(array( + 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 2, + ), 'keyTypes' => array ( 0 => @@ -3082,7 +3360,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 2, 'optionalKeys' => array ( ), @@ -3155,6 +3432,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 2, + ), 'keyTypes' => array ( 0 => @@ -3195,7 +3476,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 2, 'optionalKeys' => array ( ), @@ -3240,6 +3520,13 @@ )), ), ), + 'SELECT email, adaid FROM ada WHERE adaid=' => + array ( + 'result' => + array ( + 5 => NULL, + ), + ), 'SELECT email, adaid FROM ada WHERE adaid=1' => array ( 'result' => @@ -3247,6 +3534,10 @@ 3 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 0, + ), 'keyTypes' => array ( 0 => @@ -3271,7 +3562,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 0, 'optionalKeys' => array ( ), @@ -3309,6 +3599,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 2, + ), 'keyTypes' => array ( 0 => @@ -3349,7 +3643,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 2, 'optionalKeys' => array ( ), @@ -3401,6 +3694,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 2, + ), 'keyTypes' => array ( 0 => @@ -3441,7 +3738,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 2, 'optionalKeys' => array ( ), @@ -3500,6 +3796,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 2, + ), 'keyTypes' => array ( 0 => @@ -3540,7 +3840,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 2, 'optionalKeys' => array ( ), @@ -3592,6 +3891,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 2, + ), 'keyTypes' => array ( 0 => @@ -3632,7 +3935,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 2, 'optionalKeys' => array ( ), @@ -3684,6 +3986,105 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 2, + ), + 'keyTypes' => + array ( + 0 => + PHPStan\Type\Constant\ConstantStringType::__set_state(array( + 'value' => 'email', + 'isClassString' => false, + )), + 1 => + PHPStan\Type\Constant\ConstantIntegerType::__set_state(array( + 'value' => 0, + )), + 2 => + PHPStan\Type\Constant\ConstantStringType::__set_state(array( + 'value' => 'adaid', + 'isClassString' => false, + )), + 3 => + PHPStan\Type\Constant\ConstantIntegerType::__set_state(array( + 'value' => 1, + )), + ), + 'valueTypes' => + array ( + 0 => + PHPStan\Type\StringType::__set_state(array( + )), + 1 => + PHPStan\Type\StringType::__set_state(array( + )), + 2 => + PHPStan\Type\IntegerRangeType::__set_state(array( + 'min' => -32768, + 'max' => 32767, + )), + 3 => + PHPStan\Type\IntegerRangeType::__set_state(array( + 'min' => -32768, + 'max' => 32767, + )), + ), + 'optionalKeys' => + array ( + ), + 'keyType' => + PHPStan\Type\UnionType::__set_state(array( + '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( + 'value' => 'adaid', + 'isClassString' => false, + )), + 3 => + PHPStan\Type\Constant\ConstantStringType::__set_state(array( + 'value' => 'email', + 'isClassString' => false, + )), + ), + )), + 'itemType' => + PHPStan\Type\UnionType::__set_state(array( + 'types' => + array ( + 0 => + PHPStan\Type\IntegerRangeType::__set_state(array( + 'min' => -32768, + 'max' => 32767, + )), + 1 => + PHPStan\Type\StringType::__set_state(array( + )), + ), + )), + )), + ), + ), + 'SELECT email, adaid FROM ada WHERE email = \'webmaster@example.org\'' => + array ( + 'result' => + array ( + 5 => + PHPStan\Type\Constant\ConstantArrayType::__set_state(array( + 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 2, + ), 'keyTypes' => array ( 0 => @@ -3724,7 +4125,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 2, 'optionalKeys' => array ( ), @@ -3797,6 +4197,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 2, + ), 'keyTypes' => array ( 0 => @@ -3837,7 +4241,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 2, 'optionalKeys' => array ( ), @@ -3889,6 +4292,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 2, + ), 'keyTypes' => array ( 0 => @@ -3929,7 +4336,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 2, 'optionalKeys' => array ( ), @@ -3981,6 +4387,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 2, + ), 'keyTypes' => array ( 0 => @@ -4021,7 +4431,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 2, 'optionalKeys' => array ( ), @@ -4073,6 +4482,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 4, + ), 'keyTypes' => array ( 0 => @@ -4151,7 +4564,6 @@ 'max' => 127, )), ), - 'nextAutoIndex' => 4, 'optionalKeys' => array ( ), @@ -4221,6 +4633,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 4, + ), 'keyTypes' => array ( 0 => @@ -4299,7 +4715,6 @@ 'max' => 127, )), ), - 'nextAutoIndex' => 4, 'optionalKeys' => array ( ), @@ -4369,6 +4784,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 4, + ), 'keyTypes' => array ( 0 => @@ -4447,7 +4866,6 @@ 'max' => 127, )), ), - 'nextAutoIndex' => 4, 'optionalKeys' => array ( ), @@ -4517,6 +4935,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 4, + ), 'keyTypes' => array ( 0 => @@ -4595,7 +5017,6 @@ 'max' => 127, )), ), - 'nextAutoIndex' => 4, 'optionalKeys' => array ( ), @@ -4665,6 +5086,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 4, + ), 'keyTypes' => array ( 0 => @@ -4743,7 +5168,6 @@ 'max' => 127, )), ), - 'nextAutoIndex' => 4, 'optionalKeys' => array ( ), @@ -4820,6 +5244,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 4, + ), 'keyTypes' => array ( 0 => @@ -4898,7 +5326,6 @@ 'max' => 127, )), ), - 'nextAutoIndex' => 4, 'optionalKeys' => array ( ), @@ -4968,6 +5395,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 4, + ), 'keyTypes' => array ( 0 => @@ -5046,7 +5477,6 @@ 'max' => 127, )), ), - 'nextAutoIndex' => 4, 'optionalKeys' => array ( ), @@ -5116,6 +5546,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 4, + ), 'keyTypes' => array ( 0 => @@ -5194,7 +5628,6 @@ 'max' => 127, )), ), - 'nextAutoIndex' => 4, 'optionalKeys' => array ( ), @@ -5264,6 +5697,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 4, + ), 'keyTypes' => array ( 0 => @@ -5342,7 +5779,6 @@ 'max' => 127, )), ), - 'nextAutoIndex' => 4, 'optionalKeys' => array ( ), @@ -5412,6 +5848,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 4, + ), 'keyTypes' => array ( 0 => @@ -5490,7 +5930,6 @@ 'max' => 127, )), ), - 'nextAutoIndex' => 4, 'optionalKeys' => array ( ), @@ -5560,6 +5999,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 4, + ), 'keyTypes' => array ( 0 => @@ -5638,7 +6081,6 @@ 'max' => 127, )), ), - 'nextAutoIndex' => 4, 'optionalKeys' => array ( ), diff --git a/tests/default/config/.phpstan-dba-pdo.cache b/tests/default/config/.phpstan-dba-pdo.cache index 1f09a6bc8..e740a23cb 100644 --- a/tests/default/config/.phpstan-dba-pdo.cache +++ b/tests/default/config/.phpstan-dba-pdo.cache @@ -10,6 +10,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 35, + ), 'keyTypes' => array ( 0 => @@ -805,7 +809,6 @@ 'max' => NULL, )), ), - 'nextAutoIndex' => 35, 'optionalKeys' => array ( ), @@ -1158,6 +1161,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 4, + ), 'keyTypes' => array ( 0 => @@ -1286,7 +1293,6 @@ ), )), ), - 'nextAutoIndex' => 4, 'optionalKeys' => array ( ), @@ -1357,6 +1363,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 1, + ), 'keyTypes' => array ( 0 => @@ -1382,7 +1392,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 1, 'optionalKeys' => array ( ), @@ -1410,6 +1419,10 @@ 3 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 0, + ), 'keyTypes' => array ( 0 => @@ -1426,7 +1439,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 0, 'optionalKeys' => array ( ), @@ -1450,6 +1462,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 1, + ), 'keyTypes' => array ( 0 => @@ -1475,7 +1491,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 1, 'optionalKeys' => array ( ), @@ -1509,6 +1524,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 1, + ), 'keyTypes' => array ( 0 => @@ -1534,7 +1553,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 1, 'optionalKeys' => array ( ), @@ -1568,6 +1586,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 1, + ), 'keyTypes' => array ( 0 => @@ -1593,7 +1615,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 1, 'optionalKeys' => array ( ), @@ -1627,6 +1648,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 1, + ), 'keyTypes' => array ( 0 => @@ -1652,7 +1677,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 1, 'optionalKeys' => array ( ), @@ -1686,6 +1710,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 1, + ), 'keyTypes' => array ( 0 => @@ -1711,7 +1739,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 1, 'optionalKeys' => array ( ), @@ -1745,6 +1772,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 1, + ), 'keyTypes' => array ( 0 => @@ -1770,7 +1801,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 1, 'optionalKeys' => array ( ), @@ -1825,6 +1855,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 1, + ), 'keyTypes' => array ( 0 => @@ -1850,7 +1884,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 1, 'optionalKeys' => array ( ), @@ -1884,6 +1917,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 1, + ), 'keyTypes' => array ( 0 => @@ -1909,7 +1946,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 1, 'optionalKeys' => array ( ), @@ -1943,6 +1979,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 1, + ), 'keyTypes' => array ( 0 => @@ -1968,7 +2008,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 1, 'optionalKeys' => array ( ), @@ -2002,6 +2041,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 1, + ), 'keyTypes' => array ( 0 => @@ -2027,7 +2070,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 1, 'optionalKeys' => array ( ), @@ -2061,6 +2103,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 1, + ), 'keyTypes' => array ( 0 => @@ -2086,7 +2132,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 1, 'optionalKeys' => array ( ), @@ -2120,6 +2165,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 1, + ), 'keyTypes' => array ( 0 => @@ -2145,7 +2194,6 @@ 'max' => 2147483647, )), ), - 'nextAutoIndex' => 1, 'optionalKeys' => array ( ), @@ -2179,6 +2227,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 1, + ), 'keyTypes' => array ( 0 => @@ -2204,7 +2256,6 @@ 'max' => 2147483647, )), ), - 'nextAutoIndex' => 1, 'optionalKeys' => array ( ), @@ -2238,6 +2289,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 1, + ), 'keyTypes' => array ( 0 => @@ -2259,7 +2314,6 @@ PHPStan\Type\IntegerType::__set_state(array( )), ), - 'nextAutoIndex' => 1, 'optionalKeys' => array ( ), @@ -2291,6 +2345,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 1, + ), 'keyTypes' => array ( 0 => @@ -2312,7 +2370,6 @@ PHPStan\Type\IntegerType::__set_state(array( )), ), - 'nextAutoIndex' => 1, 'optionalKeys' => array ( ), @@ -2344,6 +2401,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 1, + ), 'keyTypes' => array ( 0 => @@ -2387,7 +2448,6 @@ ), )), ), - 'nextAutoIndex' => 1, 'optionalKeys' => array ( ), @@ -2430,6 +2490,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 1, + ), 'keyTypes' => array ( 0 => @@ -2451,7 +2515,6 @@ PHPStan\Type\StringType::__set_state(array( )), ), - 'nextAutoIndex' => 1, 'optionalKeys' => array ( ), @@ -2477,6 +2540,10 @@ 3 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 0, + ), 'keyTypes' => array ( 0 => @@ -2491,7 +2558,6 @@ PHPStan\Type\StringType::__set_state(array( )), ), - 'nextAutoIndex' => 0, 'optionalKeys' => array ( ), @@ -2520,6 +2586,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 2, + ), 'keyTypes' => array ( 0 => @@ -2560,7 +2630,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 2, 'optionalKeys' => array ( ), @@ -2606,6 +2675,10 @@ 3 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 0, + ), 'keyTypes' => array ( 0 => @@ -2630,7 +2703,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 0, 'optionalKeys' => array ( ), @@ -2674,6 +2746,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 2, + ), 'keyTypes' => array ( 0 => @@ -2714,7 +2790,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 2, 'optionalKeys' => array ( ), @@ -2766,6 +2841,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 2, + ), 'keyTypes' => array ( 0 => @@ -2806,7 +2885,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 2, 'optionalKeys' => array ( ), @@ -2858,6 +2936,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 2, + ), 'keyTypes' => array ( 0 => @@ -2898,7 +2980,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 2, 'optionalKeys' => array ( ), @@ -2950,6 +3031,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 2, + ), 'keyTypes' => array ( 0 => @@ -2990,7 +3075,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 2, 'optionalKeys' => array ( ), @@ -3042,6 +3126,200 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 2, + ), + 'keyTypes' => + array ( + 0 => + PHPStan\Type\Constant\ConstantStringType::__set_state(array( + 'value' => 'email', + 'isClassString' => false, + )), + 1 => + PHPStan\Type\Constant\ConstantIntegerType::__set_state(array( + 'value' => 0, + )), + 2 => + PHPStan\Type\Constant\ConstantStringType::__set_state(array( + 'value' => 'adaid', + 'isClassString' => false, + )), + 3 => + PHPStan\Type\Constant\ConstantIntegerType::__set_state(array( + 'value' => 1, + )), + ), + 'valueTypes' => + array ( + 0 => + PHPStan\Type\StringType::__set_state(array( + )), + 1 => + PHPStan\Type\StringType::__set_state(array( + )), + 2 => + PHPStan\Type\IntegerRangeType::__set_state(array( + 'min' => -32768, + 'max' => 32767, + )), + 3 => + PHPStan\Type\IntegerRangeType::__set_state(array( + 'min' => -32768, + 'max' => 32767, + )), + ), + 'optionalKeys' => + array ( + ), + 'keyType' => + PHPStan\Type\UnionType::__set_state(array( + '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( + 'value' => 'adaid', + 'isClassString' => false, + )), + 3 => + PHPStan\Type\Constant\ConstantStringType::__set_state(array( + 'value' => 'email', + 'isClassString' => false, + )), + ), + )), + 'itemType' => + PHPStan\Type\UnionType::__set_state(array( + 'types' => + array ( + 0 => + PHPStan\Type\IntegerRangeType::__set_state(array( + 'min' => -32768, + 'max' => 32767, + )), + 1 => + PHPStan\Type\StringType::__set_state(array( + )), + ), + )), + )), + ), + ), + 'SELECT email, adaid FROM ada WHERE adaid = 2' => + array ( + 'result' => + array ( + 5 => + PHPStan\Type\Constant\ConstantArrayType::__set_state(array( + 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 2, + ), + 'keyTypes' => + array ( + 0 => + PHPStan\Type\Constant\ConstantStringType::__set_state(array( + 'value' => 'email', + 'isClassString' => false, + )), + 1 => + PHPStan\Type\Constant\ConstantIntegerType::__set_state(array( + 'value' => 0, + )), + 2 => + PHPStan\Type\Constant\ConstantStringType::__set_state(array( + 'value' => 'adaid', + 'isClassString' => false, + )), + 3 => + PHPStan\Type\Constant\ConstantIntegerType::__set_state(array( + 'value' => 1, + )), + ), + 'valueTypes' => + array ( + 0 => + PHPStan\Type\StringType::__set_state(array( + )), + 1 => + PHPStan\Type\StringType::__set_state(array( + )), + 2 => + PHPStan\Type\IntegerRangeType::__set_state(array( + 'min' => -32768, + 'max' => 32767, + )), + 3 => + PHPStan\Type\IntegerRangeType::__set_state(array( + 'min' => -32768, + 'max' => 32767, + )), + ), + 'optionalKeys' => + array ( + ), + 'keyType' => + PHPStan\Type\UnionType::__set_state(array( + '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( + 'value' => 'adaid', + 'isClassString' => false, + )), + 3 => + PHPStan\Type\Constant\ConstantStringType::__set_state(array( + 'value' => 'email', + 'isClassString' => false, + )), + ), + )), + 'itemType' => + PHPStan\Type\UnionType::__set_state(array( + 'types' => + array ( + 0 => + PHPStan\Type\IntegerRangeType::__set_state(array( + 'min' => -32768, + 'max' => 32767, + )), + 1 => + PHPStan\Type\StringType::__set_state(array( + )), + ), + )), + )), + ), + ), + 'SELECT email, adaid FROM ada WHERE adaid = 3' => + array ( + 'result' => + array ( + 5 => + PHPStan\Type\Constant\ConstantArrayType::__set_state(array( + 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 2, + ), 'keyTypes' => array ( 0 => @@ -3082,7 +3360,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 2, 'optionalKeys' => array ( ), @@ -3155,6 +3432,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 2, + ), 'keyTypes' => array ( 0 => @@ -3195,7 +3476,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 2, 'optionalKeys' => array ( ), @@ -3240,6 +3520,13 @@ )), ), ), + 'SELECT email, adaid FROM ada WHERE adaid=' => + array ( + 'result' => + array ( + 5 => NULL, + ), + ), 'SELECT email, adaid FROM ada WHERE adaid=1' => array ( 'result' => @@ -3247,6 +3534,10 @@ 3 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 0, + ), 'keyTypes' => array ( 0 => @@ -3271,7 +3562,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 0, 'optionalKeys' => array ( ), @@ -3309,6 +3599,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 2, + ), 'keyTypes' => array ( 0 => @@ -3349,7 +3643,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 2, 'optionalKeys' => array ( ), @@ -3401,6 +3694,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 2, + ), 'keyTypes' => array ( 0 => @@ -3441,7 +3738,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 2, 'optionalKeys' => array ( ), @@ -3500,6 +3796,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 2, + ), 'keyTypes' => array ( 0 => @@ -3540,7 +3840,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 2, 'optionalKeys' => array ( ), @@ -3592,6 +3891,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 2, + ), 'keyTypes' => array ( 0 => @@ -3632,7 +3935,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 2, 'optionalKeys' => array ( ), @@ -3684,6 +3986,105 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 2, + ), + 'keyTypes' => + array ( + 0 => + PHPStan\Type\Constant\ConstantStringType::__set_state(array( + 'value' => 'email', + 'isClassString' => false, + )), + 1 => + PHPStan\Type\Constant\ConstantIntegerType::__set_state(array( + 'value' => 0, + )), + 2 => + PHPStan\Type\Constant\ConstantStringType::__set_state(array( + 'value' => 'adaid', + 'isClassString' => false, + )), + 3 => + PHPStan\Type\Constant\ConstantIntegerType::__set_state(array( + 'value' => 1, + )), + ), + 'valueTypes' => + array ( + 0 => + PHPStan\Type\StringType::__set_state(array( + )), + 1 => + PHPStan\Type\StringType::__set_state(array( + )), + 2 => + PHPStan\Type\IntegerRangeType::__set_state(array( + 'min' => -32768, + 'max' => 32767, + )), + 3 => + PHPStan\Type\IntegerRangeType::__set_state(array( + 'min' => -32768, + 'max' => 32767, + )), + ), + 'optionalKeys' => + array ( + ), + 'keyType' => + PHPStan\Type\UnionType::__set_state(array( + '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( + 'value' => 'adaid', + 'isClassString' => false, + )), + 3 => + PHPStan\Type\Constant\ConstantStringType::__set_state(array( + 'value' => 'email', + 'isClassString' => false, + )), + ), + )), + 'itemType' => + PHPStan\Type\UnionType::__set_state(array( + 'types' => + array ( + 0 => + PHPStan\Type\IntegerRangeType::__set_state(array( + 'min' => -32768, + 'max' => 32767, + )), + 1 => + PHPStan\Type\StringType::__set_state(array( + )), + ), + )), + )), + ), + ), + 'SELECT email, adaid FROM ada WHERE email = \'webmaster@example.org\'' => + array ( + 'result' => + array ( + 5 => + PHPStan\Type\Constant\ConstantArrayType::__set_state(array( + 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 2, + ), 'keyTypes' => array ( 0 => @@ -3724,7 +4125,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 2, 'optionalKeys' => array ( ), @@ -3797,6 +4197,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 2, + ), 'keyTypes' => array ( 0 => @@ -3837,7 +4241,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 2, 'optionalKeys' => array ( ), @@ -3889,6 +4292,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 2, + ), 'keyTypes' => array ( 0 => @@ -3929,7 +4336,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 2, 'optionalKeys' => array ( ), @@ -3981,6 +4387,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 2, + ), 'keyTypes' => array ( 0 => @@ -4021,7 +4431,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 2, 'optionalKeys' => array ( ), @@ -4073,6 +4482,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 4, + ), 'keyTypes' => array ( 0 => @@ -4151,7 +4564,6 @@ 'max' => 127, )), ), - 'nextAutoIndex' => 4, 'optionalKeys' => array ( ), @@ -4221,6 +4633,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 4, + ), 'keyTypes' => array ( 0 => @@ -4299,7 +4715,6 @@ 'max' => 127, )), ), - 'nextAutoIndex' => 4, 'optionalKeys' => array ( ), @@ -4369,6 +4784,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 4, + ), 'keyTypes' => array ( 0 => @@ -4447,7 +4866,6 @@ 'max' => 127, )), ), - 'nextAutoIndex' => 4, 'optionalKeys' => array ( ), @@ -4517,6 +4935,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 4, + ), 'keyTypes' => array ( 0 => @@ -4595,7 +5017,6 @@ 'max' => 127, )), ), - 'nextAutoIndex' => 4, 'optionalKeys' => array ( ), @@ -4665,6 +5086,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 4, + ), 'keyTypes' => array ( 0 => @@ -4743,7 +5168,6 @@ 'max' => 127, )), ), - 'nextAutoIndex' => 4, 'optionalKeys' => array ( ), @@ -4820,6 +5244,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 4, + ), 'keyTypes' => array ( 0 => @@ -4898,7 +5326,6 @@ 'max' => 127, )), ), - 'nextAutoIndex' => 4, 'optionalKeys' => array ( ), @@ -4968,6 +5395,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 4, + ), 'keyTypes' => array ( 0 => @@ -5046,7 +5477,6 @@ 'max' => 127, )), ), - 'nextAutoIndex' => 4, 'optionalKeys' => array ( ), @@ -5116,6 +5546,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 4, + ), 'keyTypes' => array ( 0 => @@ -5194,7 +5628,6 @@ 'max' => 127, )), ), - 'nextAutoIndex' => 4, 'optionalKeys' => array ( ), @@ -5264,6 +5697,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 4, + ), 'keyTypes' => array ( 0 => @@ -5342,7 +5779,6 @@ 'max' => 127, )), ), - 'nextAutoIndex' => 4, 'optionalKeys' => array ( ), @@ -5412,6 +5848,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 4, + ), 'keyTypes' => array ( 0 => @@ -5490,7 +5930,6 @@ 'max' => 127, )), ), - 'nextAutoIndex' => 4, 'optionalKeys' => array ( ), @@ -5560,6 +5999,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 4, + ), 'keyTypes' => array ( 0 => @@ -5638,7 +6081,6 @@ 'max' => 127, )), ), - 'nextAutoIndex' => 4, 'optionalKeys' => array ( ), diff --git a/tests/default/config/.phpunit-phpstan-dba-mysqli.cache b/tests/default/config/.phpunit-phpstan-dba-mysqli.cache index 5513496d7..5bedd7d59 100644 --- a/tests/default/config/.phpunit-phpstan-dba-mysqli.cache +++ b/tests/default/config/.phpunit-phpstan-dba-mysqli.cache @@ -10,6 +10,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 35, + ), 'keyTypes' => array ( 0 => @@ -805,7 +809,6 @@ 'max' => NULL, )), ), - 'nextAutoIndex' => 35, 'optionalKeys' => array ( ), @@ -1158,6 +1161,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 4, + ), 'keyTypes' => array ( 0 => @@ -1286,7 +1293,6 @@ ), )), ), - 'nextAutoIndex' => 4, 'optionalKeys' => array ( ), @@ -1357,6 +1363,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 2, + ), 'keyTypes' => array ( 0 => @@ -1415,7 +1425,6 @@ ), )), ), - 'nextAutoIndex' => 2, 'optionalKeys' => array ( ), @@ -1470,6 +1479,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 3, + ), 'keyTypes' => array ( 0 => @@ -1565,7 +1578,6 @@ ), )), ), - 'nextAutoIndex' => 3, 'optionalKeys' => array ( ), @@ -1629,6 +1641,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 1, + ), 'keyTypes' => array ( 0 => @@ -1654,7 +1670,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 1, 'optionalKeys' => array ( ), @@ -1682,6 +1697,10 @@ 3 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 0, + ), 'keyTypes' => array ( 0 => @@ -1698,7 +1717,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 0, 'optionalKeys' => array ( ), @@ -1722,6 +1740,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 1, + ), 'keyTypes' => array ( 0 => @@ -1747,7 +1769,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 1, 'optionalKeys' => array ( ), @@ -1781,6 +1802,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 1, + ), 'keyTypes' => array ( 0 => @@ -1806,7 +1831,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 1, 'optionalKeys' => array ( ), @@ -1840,6 +1864,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 1, + ), 'keyTypes' => array ( 0 => @@ -1865,7 +1893,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 1, 'optionalKeys' => array ( ), @@ -1899,6 +1926,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 1, + ), 'keyTypes' => array ( 0 => @@ -1924,7 +1955,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 1, 'optionalKeys' => array ( ), @@ -1958,6 +1988,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 1, + ), 'keyTypes' => array ( 0 => @@ -1983,7 +2017,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 1, 'optionalKeys' => array ( ), @@ -2017,6 +2050,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 1, + ), 'keyTypes' => array ( 0 => @@ -2042,7 +2079,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 1, 'optionalKeys' => array ( ), @@ -2097,6 +2133,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 1, + ), 'keyTypes' => array ( 0 => @@ -2122,7 +2162,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 1, 'optionalKeys' => array ( ), @@ -2156,6 +2195,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 1, + ), 'keyTypes' => array ( 0 => @@ -2181,7 +2224,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 1, 'optionalKeys' => array ( ), @@ -2215,6 +2257,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 1, + ), 'keyTypes' => array ( 0 => @@ -2240,7 +2286,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 1, 'optionalKeys' => array ( ), @@ -2274,6 +2319,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 1, + ), 'keyTypes' => array ( 0 => @@ -2299,7 +2348,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 1, 'optionalKeys' => array ( ), @@ -2333,6 +2381,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 1, + ), 'keyTypes' => array ( 0 => @@ -2358,7 +2410,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 1, 'optionalKeys' => array ( ), @@ -2392,6 +2443,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 1, + ), 'keyTypes' => array ( 0 => @@ -2417,7 +2472,6 @@ 'max' => 2147483647, )), ), - 'nextAutoIndex' => 1, 'optionalKeys' => array ( ), @@ -2451,6 +2505,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 1, + ), 'keyTypes' => array ( 0 => @@ -2476,7 +2534,6 @@ 'max' => 2147483647, )), ), - 'nextAutoIndex' => 1, 'optionalKeys' => array ( ), @@ -2510,6 +2567,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 1, + ), 'keyTypes' => array ( 0 => @@ -2531,7 +2592,6 @@ PHPStan\Type\IntegerType::__set_state(array( )), ), - 'nextAutoIndex' => 1, 'optionalKeys' => array ( ), @@ -2563,6 +2623,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 1, + ), 'keyTypes' => array ( 0 => @@ -2584,7 +2648,6 @@ PHPStan\Type\IntegerType::__set_state(array( )), ), - 'nextAutoIndex' => 1, 'optionalKeys' => array ( ), @@ -2616,6 +2679,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 1, + ), 'keyTypes' => array ( 0 => @@ -2659,7 +2726,6 @@ ), )), ), - 'nextAutoIndex' => 1, 'optionalKeys' => array ( ), @@ -2702,6 +2768,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 1, + ), 'keyTypes' => array ( 0 => @@ -2723,7 +2793,6 @@ PHPStan\Type\StringType::__set_state(array( )), ), - 'nextAutoIndex' => 1, 'optionalKeys' => array ( ), @@ -2749,6 +2818,10 @@ 3 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 0, + ), 'keyTypes' => array ( 0 => @@ -2763,7 +2836,6 @@ PHPStan\Type\StringType::__set_state(array( )), ), - 'nextAutoIndex' => 0, 'optionalKeys' => array ( ), @@ -2792,6 +2864,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 2, + ), 'keyTypes' => array ( 0 => @@ -2832,7 +2908,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 2, 'optionalKeys' => array ( ), @@ -2878,6 +2953,10 @@ 3 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 0, + ), 'keyTypes' => array ( 0 => @@ -2902,7 +2981,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 0, 'optionalKeys' => array ( ), @@ -2946,6 +3024,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 2, + ), 'keyTypes' => array ( 0 => @@ -2986,7 +3068,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 2, 'optionalKeys' => array ( ), @@ -3038,6 +3119,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 2, + ), 'keyTypes' => array ( 0 => @@ -3078,7 +3163,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 2, 'optionalKeys' => array ( ), @@ -3130,6 +3214,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 2, + ), 'keyTypes' => array ( 0 => @@ -3170,7 +3258,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 2, 'optionalKeys' => array ( ), @@ -3222,6 +3309,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 2, + ), 'keyTypes' => array ( 0 => @@ -3262,7 +3353,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 2, 'optionalKeys' => array ( ), @@ -3314,6 +3404,200 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 2, + ), + 'keyTypes' => + array ( + 0 => + PHPStan\Type\Constant\ConstantStringType::__set_state(array( + 'value' => 'email', + 'isClassString' => false, + )), + 1 => + PHPStan\Type\Constant\ConstantIntegerType::__set_state(array( + 'value' => 0, + )), + 2 => + PHPStan\Type\Constant\ConstantStringType::__set_state(array( + 'value' => 'adaid', + 'isClassString' => false, + )), + 3 => + PHPStan\Type\Constant\ConstantIntegerType::__set_state(array( + 'value' => 1, + )), + ), + 'valueTypes' => + array ( + 0 => + PHPStan\Type\StringType::__set_state(array( + )), + 1 => + PHPStan\Type\StringType::__set_state(array( + )), + 2 => + PHPStan\Type\IntegerRangeType::__set_state(array( + 'min' => -32768, + 'max' => 32767, + )), + 3 => + PHPStan\Type\IntegerRangeType::__set_state(array( + 'min' => -32768, + 'max' => 32767, + )), + ), + 'optionalKeys' => + array ( + ), + 'keyType' => + PHPStan\Type\UnionType::__set_state(array( + '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( + 'value' => 'adaid', + 'isClassString' => false, + )), + 3 => + PHPStan\Type\Constant\ConstantStringType::__set_state(array( + 'value' => 'email', + 'isClassString' => false, + )), + ), + )), + 'itemType' => + PHPStan\Type\UnionType::__set_state(array( + 'types' => + array ( + 0 => + PHPStan\Type\IntegerRangeType::__set_state(array( + 'min' => -32768, + 'max' => 32767, + )), + 1 => + PHPStan\Type\StringType::__set_state(array( + )), + ), + )), + )), + ), + ), + 'SELECT email, adaid FROM ada WHERE adaid = 2' => + array ( + 'result' => + array ( + 5 => + PHPStan\Type\Constant\ConstantArrayType::__set_state(array( + 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 2, + ), + 'keyTypes' => + array ( + 0 => + PHPStan\Type\Constant\ConstantStringType::__set_state(array( + 'value' => 'email', + 'isClassString' => false, + )), + 1 => + PHPStan\Type\Constant\ConstantIntegerType::__set_state(array( + 'value' => 0, + )), + 2 => + PHPStan\Type\Constant\ConstantStringType::__set_state(array( + 'value' => 'adaid', + 'isClassString' => false, + )), + 3 => + PHPStan\Type\Constant\ConstantIntegerType::__set_state(array( + 'value' => 1, + )), + ), + 'valueTypes' => + array ( + 0 => + PHPStan\Type\StringType::__set_state(array( + )), + 1 => + PHPStan\Type\StringType::__set_state(array( + )), + 2 => + PHPStan\Type\IntegerRangeType::__set_state(array( + 'min' => -32768, + 'max' => 32767, + )), + 3 => + PHPStan\Type\IntegerRangeType::__set_state(array( + 'min' => -32768, + 'max' => 32767, + )), + ), + 'optionalKeys' => + array ( + ), + 'keyType' => + PHPStan\Type\UnionType::__set_state(array( + '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( + 'value' => 'adaid', + 'isClassString' => false, + )), + 3 => + PHPStan\Type\Constant\ConstantStringType::__set_state(array( + 'value' => 'email', + 'isClassString' => false, + )), + ), + )), + 'itemType' => + PHPStan\Type\UnionType::__set_state(array( + 'types' => + array ( + 0 => + PHPStan\Type\IntegerRangeType::__set_state(array( + 'min' => -32768, + 'max' => 32767, + )), + 1 => + PHPStan\Type\StringType::__set_state(array( + )), + ), + )), + )), + ), + ), + 'SELECT email, adaid FROM ada WHERE adaid = 3' => + array ( + 'result' => + array ( + 5 => + PHPStan\Type\Constant\ConstantArrayType::__set_state(array( + 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 2, + ), 'keyTypes' => array ( 0 => @@ -3354,7 +3638,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 2, 'optionalKeys' => array ( ), @@ -3427,6 +3710,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 2, + ), 'keyTypes' => array ( 0 => @@ -3467,7 +3754,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 2, 'optionalKeys' => array ( ), @@ -3512,6 +3798,13 @@ )), ), ), + 'SELECT email, adaid FROM ada WHERE adaid=' => + array ( + 'result' => + array ( + 5 => NULL, + ), + ), 'SELECT email, adaid FROM ada WHERE adaid=1' => array ( 'result' => @@ -3519,6 +3812,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 2, + ), 'keyTypes' => array ( 0 => @@ -3559,7 +3856,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 2, 'optionalKeys' => array ( ), @@ -3605,6 +3901,10 @@ 3 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 0, + ), 'keyTypes' => array ( 0 => @@ -3629,7 +3929,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 0, 'optionalKeys' => array ( ), @@ -3673,6 +3972,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 2, + ), 'keyTypes' => array ( 0 => @@ -3713,7 +4016,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 2, 'optionalKeys' => array ( ), @@ -3772,6 +4074,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 2, + ), 'keyTypes' => array ( 0 => @@ -3812,7 +4118,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 2, 'optionalKeys' => array ( ), @@ -3864,6 +4169,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 2, + ), 'keyTypes' => array ( 0 => @@ -3904,7 +4213,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 2, 'optionalKeys' => array ( ), @@ -3956,6 +4264,105 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 2, + ), + 'keyTypes' => + array ( + 0 => + PHPStan\Type\Constant\ConstantStringType::__set_state(array( + 'value' => 'email', + 'isClassString' => false, + )), + 1 => + PHPStan\Type\Constant\ConstantIntegerType::__set_state(array( + 'value' => 0, + )), + 2 => + PHPStan\Type\Constant\ConstantStringType::__set_state(array( + 'value' => 'adaid', + 'isClassString' => false, + )), + 3 => + PHPStan\Type\Constant\ConstantIntegerType::__set_state(array( + 'value' => 1, + )), + ), + 'valueTypes' => + array ( + 0 => + PHPStan\Type\StringType::__set_state(array( + )), + 1 => + PHPStan\Type\StringType::__set_state(array( + )), + 2 => + PHPStan\Type\IntegerRangeType::__set_state(array( + 'min' => -32768, + 'max' => 32767, + )), + 3 => + PHPStan\Type\IntegerRangeType::__set_state(array( + 'min' => -32768, + 'max' => 32767, + )), + ), + 'optionalKeys' => + array ( + ), + 'keyType' => + PHPStan\Type\UnionType::__set_state(array( + '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( + 'value' => 'adaid', + 'isClassString' => false, + )), + 3 => + PHPStan\Type\Constant\ConstantStringType::__set_state(array( + 'value' => 'email', + 'isClassString' => false, + )), + ), + )), + 'itemType' => + PHPStan\Type\UnionType::__set_state(array( + 'types' => + array ( + 0 => + PHPStan\Type\IntegerRangeType::__set_state(array( + 'min' => -32768, + 'max' => 32767, + )), + 1 => + PHPStan\Type\StringType::__set_state(array( + )), + ), + )), + )), + ), + ), + 'SELECT email, adaid FROM ada WHERE email = \'webmaster@example.org\'' => + array ( + 'result' => + array ( + 5 => + PHPStan\Type\Constant\ConstantArrayType::__set_state(array( + 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 2, + ), 'keyTypes' => array ( 0 => @@ -3996,7 +4403,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 2, 'optionalKeys' => array ( ), @@ -4069,6 +4475,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 2, + ), 'keyTypes' => array ( 0 => @@ -4109,7 +4519,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 2, 'optionalKeys' => array ( ), @@ -4161,6 +4570,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 2, + ), 'keyTypes' => array ( 0 => @@ -4201,7 +4614,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 2, 'optionalKeys' => array ( ), @@ -4253,6 +4665,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 2, + ), 'keyTypes' => array ( 0 => @@ -4293,7 +4709,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 2, 'optionalKeys' => array ( ), @@ -4345,6 +4760,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 4, + ), 'keyTypes' => array ( 0 => @@ -4423,7 +4842,6 @@ 'max' => 127, )), ), - 'nextAutoIndex' => 4, 'optionalKeys' => array ( ), @@ -4493,6 +4911,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 4, + ), 'keyTypes' => array ( 0 => @@ -4571,7 +4993,6 @@ 'max' => 127, )), ), - 'nextAutoIndex' => 4, 'optionalKeys' => array ( ), @@ -4641,6 +5062,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 4, + ), 'keyTypes' => array ( 0 => @@ -4719,7 +5144,6 @@ 'max' => 127, )), ), - 'nextAutoIndex' => 4, 'optionalKeys' => array ( ), @@ -4789,6 +5213,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 4, + ), 'keyTypes' => array ( 0 => @@ -4867,7 +5295,6 @@ 'max' => 127, )), ), - 'nextAutoIndex' => 4, 'optionalKeys' => array ( ), @@ -4937,6 +5364,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 4, + ), 'keyTypes' => array ( 0 => @@ -5015,7 +5446,6 @@ 'max' => 127, )), ), - 'nextAutoIndex' => 4, 'optionalKeys' => array ( ), @@ -5092,6 +5522,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 4, + ), 'keyTypes' => array ( 0 => @@ -5170,7 +5604,6 @@ 'max' => 127, )), ), - 'nextAutoIndex' => 4, 'optionalKeys' => array ( ), @@ -5240,6 +5673,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 4, + ), 'keyTypes' => array ( 0 => @@ -5318,7 +5755,6 @@ 'max' => 127, )), ), - 'nextAutoIndex' => 4, 'optionalKeys' => array ( ), @@ -5388,6 +5824,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 4, + ), 'keyTypes' => array ( 0 => @@ -5466,7 +5906,6 @@ 'max' => 127, )), ), - 'nextAutoIndex' => 4, 'optionalKeys' => array ( ), @@ -5536,6 +5975,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 4, + ), 'keyTypes' => array ( 0 => @@ -5614,7 +6057,6 @@ 'max' => 127, )), ), - 'nextAutoIndex' => 4, 'optionalKeys' => array ( ), @@ -5684,6 +6126,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 4, + ), 'keyTypes' => array ( 0 => @@ -5762,7 +6208,6 @@ 'max' => 127, )), ), - 'nextAutoIndex' => 4, 'optionalKeys' => array ( ), @@ -5832,6 +6277,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 4, + ), 'keyTypes' => array ( 0 => @@ -5910,7 +6359,6 @@ 'max' => 127, )), ), - 'nextAutoIndex' => 4, 'optionalKeys' => array ( ), diff --git a/tests/default/config/.phpunit-phpstan-dba-pdo.cache b/tests/default/config/.phpunit-phpstan-dba-pdo.cache index feeba65c6..8a7c494ef 100644 --- a/tests/default/config/.phpunit-phpstan-dba-pdo.cache +++ b/tests/default/config/.phpunit-phpstan-dba-pdo.cache @@ -10,6 +10,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 35, + ), 'keyTypes' => array ( 0 => @@ -805,7 +809,6 @@ 'max' => NULL, )), ), - 'nextAutoIndex' => 35, 'optionalKeys' => array ( ), @@ -1158,6 +1161,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 4, + ), 'keyTypes' => array ( 0 => @@ -1286,7 +1293,6 @@ ), )), ), - 'nextAutoIndex' => 4, 'optionalKeys' => array ( ), @@ -1357,6 +1363,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 1, + ), 'keyTypes' => array ( 0 => @@ -1382,7 +1392,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 1, 'optionalKeys' => array ( ), @@ -1410,6 +1419,10 @@ 3 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 0, + ), 'keyTypes' => array ( 0 => @@ -1426,7 +1439,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 0, 'optionalKeys' => array ( ), @@ -1450,6 +1462,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 1, + ), 'keyTypes' => array ( 0 => @@ -1475,7 +1491,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 1, 'optionalKeys' => array ( ), @@ -1509,6 +1524,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 1, + ), 'keyTypes' => array ( 0 => @@ -1534,7 +1553,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 1, 'optionalKeys' => array ( ), @@ -1568,6 +1586,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 1, + ), 'keyTypes' => array ( 0 => @@ -1593,7 +1615,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 1, 'optionalKeys' => array ( ), @@ -1627,6 +1648,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 1, + ), 'keyTypes' => array ( 0 => @@ -1652,7 +1677,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 1, 'optionalKeys' => array ( ), @@ -1686,6 +1710,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 1, + ), 'keyTypes' => array ( 0 => @@ -1711,7 +1739,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 1, 'optionalKeys' => array ( ), @@ -1745,6 +1772,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 1, + ), 'keyTypes' => array ( 0 => @@ -1770,7 +1801,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 1, 'optionalKeys' => array ( ), @@ -1825,6 +1855,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 1, + ), 'keyTypes' => array ( 0 => @@ -1850,7 +1884,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 1, 'optionalKeys' => array ( ), @@ -1884,6 +1917,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 1, + ), 'keyTypes' => array ( 0 => @@ -1909,7 +1946,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 1, 'optionalKeys' => array ( ), @@ -1943,6 +1979,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 1, + ), 'keyTypes' => array ( 0 => @@ -1968,7 +2008,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 1, 'optionalKeys' => array ( ), @@ -2002,6 +2041,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 1, + ), 'keyTypes' => array ( 0 => @@ -2027,7 +2070,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 1, 'optionalKeys' => array ( ), @@ -2061,6 +2103,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 1, + ), 'keyTypes' => array ( 0 => @@ -2086,7 +2132,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 1, 'optionalKeys' => array ( ), @@ -2120,6 +2165,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 1, + ), 'keyTypes' => array ( 0 => @@ -2145,7 +2194,6 @@ 'max' => 2147483647, )), ), - 'nextAutoIndex' => 1, 'optionalKeys' => array ( ), @@ -2179,6 +2227,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 1, + ), 'keyTypes' => array ( 0 => @@ -2204,7 +2256,6 @@ 'max' => 2147483647, )), ), - 'nextAutoIndex' => 1, 'optionalKeys' => array ( ), @@ -2238,6 +2289,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 1, + ), 'keyTypes' => array ( 0 => @@ -2259,7 +2314,6 @@ PHPStan\Type\IntegerType::__set_state(array( )), ), - 'nextAutoIndex' => 1, 'optionalKeys' => array ( ), @@ -2291,6 +2345,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 1, + ), 'keyTypes' => array ( 0 => @@ -2312,7 +2370,6 @@ PHPStan\Type\IntegerType::__set_state(array( )), ), - 'nextAutoIndex' => 1, 'optionalKeys' => array ( ), @@ -2344,6 +2401,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 1, + ), 'keyTypes' => array ( 0 => @@ -2387,7 +2448,6 @@ ), )), ), - 'nextAutoIndex' => 1, 'optionalKeys' => array ( ), @@ -2430,6 +2490,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 1, + ), 'keyTypes' => array ( 0 => @@ -2451,7 +2515,6 @@ PHPStan\Type\StringType::__set_state(array( )), ), - 'nextAutoIndex' => 1, 'optionalKeys' => array ( ), @@ -2477,6 +2540,10 @@ 3 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 0, + ), 'keyTypes' => array ( 0 => @@ -2491,7 +2558,6 @@ PHPStan\Type\StringType::__set_state(array( )), ), - 'nextAutoIndex' => 0, 'optionalKeys' => array ( ), @@ -2520,6 +2586,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 2, + ), 'keyTypes' => array ( 0 => @@ -2560,7 +2630,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 2, 'optionalKeys' => array ( ), @@ -2606,6 +2675,10 @@ 3 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 0, + ), 'keyTypes' => array ( 0 => @@ -2630,7 +2703,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 0, 'optionalKeys' => array ( ), @@ -2674,6 +2746,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 2, + ), 'keyTypes' => array ( 0 => @@ -2714,7 +2790,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 2, 'optionalKeys' => array ( ), @@ -2766,6 +2841,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 2, + ), 'keyTypes' => array ( 0 => @@ -2806,7 +2885,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 2, 'optionalKeys' => array ( ), @@ -2858,6 +2936,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 2, + ), 'keyTypes' => array ( 0 => @@ -2898,7 +2980,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 2, 'optionalKeys' => array ( ), @@ -2950,6 +3031,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 2, + ), 'keyTypes' => array ( 0 => @@ -2990,7 +3075,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 2, 'optionalKeys' => array ( ), @@ -3042,6 +3126,200 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 2, + ), + 'keyTypes' => + array ( + 0 => + PHPStan\Type\Constant\ConstantStringType::__set_state(array( + 'value' => 'email', + 'isClassString' => false, + )), + 1 => + PHPStan\Type\Constant\ConstantIntegerType::__set_state(array( + 'value' => 0, + )), + 2 => + PHPStan\Type\Constant\ConstantStringType::__set_state(array( + 'value' => 'adaid', + 'isClassString' => false, + )), + 3 => + PHPStan\Type\Constant\ConstantIntegerType::__set_state(array( + 'value' => 1, + )), + ), + 'valueTypes' => + array ( + 0 => + PHPStan\Type\StringType::__set_state(array( + )), + 1 => + PHPStan\Type\StringType::__set_state(array( + )), + 2 => + PHPStan\Type\IntegerRangeType::__set_state(array( + 'min' => -32768, + 'max' => 32767, + )), + 3 => + PHPStan\Type\IntegerRangeType::__set_state(array( + 'min' => -32768, + 'max' => 32767, + )), + ), + 'optionalKeys' => + array ( + ), + 'keyType' => + PHPStan\Type\UnionType::__set_state(array( + '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( + 'value' => 'adaid', + 'isClassString' => false, + )), + 3 => + PHPStan\Type\Constant\ConstantStringType::__set_state(array( + 'value' => 'email', + 'isClassString' => false, + )), + ), + )), + 'itemType' => + PHPStan\Type\UnionType::__set_state(array( + 'types' => + array ( + 0 => + PHPStan\Type\IntegerRangeType::__set_state(array( + 'min' => -32768, + 'max' => 32767, + )), + 1 => + PHPStan\Type\StringType::__set_state(array( + )), + ), + )), + )), + ), + ), + 'SELECT email, adaid FROM ada WHERE adaid = 2' => + array ( + 'result' => + array ( + 5 => + PHPStan\Type\Constant\ConstantArrayType::__set_state(array( + 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 2, + ), + 'keyTypes' => + array ( + 0 => + PHPStan\Type\Constant\ConstantStringType::__set_state(array( + 'value' => 'email', + 'isClassString' => false, + )), + 1 => + PHPStan\Type\Constant\ConstantIntegerType::__set_state(array( + 'value' => 0, + )), + 2 => + PHPStan\Type\Constant\ConstantStringType::__set_state(array( + 'value' => 'adaid', + 'isClassString' => false, + )), + 3 => + PHPStan\Type\Constant\ConstantIntegerType::__set_state(array( + 'value' => 1, + )), + ), + 'valueTypes' => + array ( + 0 => + PHPStan\Type\StringType::__set_state(array( + )), + 1 => + PHPStan\Type\StringType::__set_state(array( + )), + 2 => + PHPStan\Type\IntegerRangeType::__set_state(array( + 'min' => -32768, + 'max' => 32767, + )), + 3 => + PHPStan\Type\IntegerRangeType::__set_state(array( + 'min' => -32768, + 'max' => 32767, + )), + ), + 'optionalKeys' => + array ( + ), + 'keyType' => + PHPStan\Type\UnionType::__set_state(array( + '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( + 'value' => 'adaid', + 'isClassString' => false, + )), + 3 => + PHPStan\Type\Constant\ConstantStringType::__set_state(array( + 'value' => 'email', + 'isClassString' => false, + )), + ), + )), + 'itemType' => + PHPStan\Type\UnionType::__set_state(array( + 'types' => + array ( + 0 => + PHPStan\Type\IntegerRangeType::__set_state(array( + 'min' => -32768, + 'max' => 32767, + )), + 1 => + PHPStan\Type\StringType::__set_state(array( + )), + ), + )), + )), + ), + ), + 'SELECT email, adaid FROM ada WHERE adaid = 3' => + array ( + 'result' => + array ( + 5 => + PHPStan\Type\Constant\ConstantArrayType::__set_state(array( + 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 2, + ), 'keyTypes' => array ( 0 => @@ -3082,7 +3360,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 2, 'optionalKeys' => array ( ), @@ -3155,6 +3432,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 2, + ), 'keyTypes' => array ( 0 => @@ -3195,7 +3476,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 2, 'optionalKeys' => array ( ), @@ -3240,6 +3520,13 @@ )), ), ), + 'SELECT email, adaid FROM ada WHERE adaid=' => + array ( + 'result' => + array ( + 5 => NULL, + ), + ), 'SELECT email, adaid FROM ada WHERE adaid=1' => array ( 'result' => @@ -3247,6 +3534,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 2, + ), 'keyTypes' => array ( 0 => @@ -3287,7 +3578,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 2, 'optionalKeys' => array ( ), @@ -3333,6 +3623,10 @@ 3 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 0, + ), 'keyTypes' => array ( 0 => @@ -3357,7 +3651,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 0, 'optionalKeys' => array ( ), @@ -3401,6 +3694,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 2, + ), 'keyTypes' => array ( 0 => @@ -3441,7 +3738,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 2, 'optionalKeys' => array ( ), @@ -3500,6 +3796,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 2, + ), 'keyTypes' => array ( 0 => @@ -3540,7 +3840,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 2, 'optionalKeys' => array ( ), @@ -3592,6 +3891,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 2, + ), 'keyTypes' => array ( 0 => @@ -3632,7 +3935,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 2, 'optionalKeys' => array ( ), @@ -3684,6 +3986,105 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 2, + ), + 'keyTypes' => + array ( + 0 => + PHPStan\Type\Constant\ConstantStringType::__set_state(array( + 'value' => 'email', + 'isClassString' => false, + )), + 1 => + PHPStan\Type\Constant\ConstantIntegerType::__set_state(array( + 'value' => 0, + )), + 2 => + PHPStan\Type\Constant\ConstantStringType::__set_state(array( + 'value' => 'adaid', + 'isClassString' => false, + )), + 3 => + PHPStan\Type\Constant\ConstantIntegerType::__set_state(array( + 'value' => 1, + )), + ), + 'valueTypes' => + array ( + 0 => + PHPStan\Type\StringType::__set_state(array( + )), + 1 => + PHPStan\Type\StringType::__set_state(array( + )), + 2 => + PHPStan\Type\IntegerRangeType::__set_state(array( + 'min' => -32768, + 'max' => 32767, + )), + 3 => + PHPStan\Type\IntegerRangeType::__set_state(array( + 'min' => -32768, + 'max' => 32767, + )), + ), + 'optionalKeys' => + array ( + ), + 'keyType' => + PHPStan\Type\UnionType::__set_state(array( + '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( + 'value' => 'adaid', + 'isClassString' => false, + )), + 3 => + PHPStan\Type\Constant\ConstantStringType::__set_state(array( + 'value' => 'email', + 'isClassString' => false, + )), + ), + )), + 'itemType' => + PHPStan\Type\UnionType::__set_state(array( + 'types' => + array ( + 0 => + PHPStan\Type\IntegerRangeType::__set_state(array( + 'min' => -32768, + 'max' => 32767, + )), + 1 => + PHPStan\Type\StringType::__set_state(array( + )), + ), + )), + )), + ), + ), + 'SELECT email, adaid FROM ada WHERE email = \'webmaster@example.org\'' => + array ( + 'result' => + array ( + 5 => + PHPStan\Type\Constant\ConstantArrayType::__set_state(array( + 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 2, + ), 'keyTypes' => array ( 0 => @@ -3724,7 +4125,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 2, 'optionalKeys' => array ( ), @@ -3797,6 +4197,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 2, + ), 'keyTypes' => array ( 0 => @@ -3837,7 +4241,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 2, 'optionalKeys' => array ( ), @@ -3889,6 +4292,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 2, + ), 'keyTypes' => array ( 0 => @@ -3929,7 +4336,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 2, 'optionalKeys' => array ( ), @@ -3981,6 +4387,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 2, + ), 'keyTypes' => array ( 0 => @@ -4021,7 +4431,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 2, 'optionalKeys' => array ( ), @@ -4073,6 +4482,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 4, + ), 'keyTypes' => array ( 0 => @@ -4151,7 +4564,6 @@ 'max' => 127, )), ), - 'nextAutoIndex' => 4, 'optionalKeys' => array ( ), @@ -4221,6 +4633,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 4, + ), 'keyTypes' => array ( 0 => @@ -4299,7 +4715,6 @@ 'max' => 127, )), ), - 'nextAutoIndex' => 4, 'optionalKeys' => array ( ), @@ -4369,6 +4784,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 4, + ), 'keyTypes' => array ( 0 => @@ -4447,7 +4866,6 @@ 'max' => 127, )), ), - 'nextAutoIndex' => 4, 'optionalKeys' => array ( ), @@ -4517,6 +4935,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 4, + ), 'keyTypes' => array ( 0 => @@ -4595,7 +5017,6 @@ 'max' => 127, )), ), - 'nextAutoIndex' => 4, 'optionalKeys' => array ( ), @@ -4665,6 +5086,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 4, + ), 'keyTypes' => array ( 0 => @@ -4743,7 +5168,6 @@ 'max' => 127, )), ), - 'nextAutoIndex' => 4, 'optionalKeys' => array ( ), @@ -4820,6 +5244,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 4, + ), 'keyTypes' => array ( 0 => @@ -4898,7 +5326,6 @@ 'max' => 127, )), ), - 'nextAutoIndex' => 4, 'optionalKeys' => array ( ), @@ -4968,6 +5395,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 4, + ), 'keyTypes' => array ( 0 => @@ -5046,7 +5477,6 @@ 'max' => 127, )), ), - 'nextAutoIndex' => 4, 'optionalKeys' => array ( ), @@ -5116,6 +5546,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 4, + ), 'keyTypes' => array ( 0 => @@ -5194,7 +5628,6 @@ 'max' => 127, )), ), - 'nextAutoIndex' => 4, 'optionalKeys' => array ( ), @@ -5264,6 +5697,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 4, + ), 'keyTypes' => array ( 0 => @@ -5342,7 +5779,6 @@ 'max' => 127, )), ), - 'nextAutoIndex' => 4, 'optionalKeys' => array ( ), @@ -5412,6 +5848,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 4, + ), 'keyTypes' => array ( 0 => @@ -5490,7 +5930,6 @@ 'max' => 127, )), ), - 'nextAutoIndex' => 4, 'optionalKeys' => array ( ), @@ -5560,6 +5999,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 4, + ), 'keyTypes' => array ( 0 => @@ -5638,7 +6081,6 @@ 'max' => 127, )), ), - 'nextAutoIndex' => 4, 'optionalKeys' => array ( ), diff --git a/tests/defaultFetchAssoc/config/.phpstan-dba-mysqli.cache b/tests/defaultFetchAssoc/config/.phpstan-dba-mysqli.cache index 5c52e09fd..3e8f4505d 100644 --- a/tests/defaultFetchAssoc/config/.phpstan-dba-mysqli.cache +++ b/tests/defaultFetchAssoc/config/.phpstan-dba-mysqli.cache @@ -10,6 +10,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 2, + ), 'keyTypes' => array ( 0 => @@ -50,7 +54,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 2, 'optionalKeys' => array ( ), @@ -102,6 +105,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 4, + ), 'keyTypes' => array ( 0 => @@ -180,7 +187,6 @@ 'max' => 127, )), ), - 'nextAutoIndex' => 4, 'optionalKeys' => array ( ), diff --git a/tests/defaultFetchAssoc/config/.phpstan-dba-pdo.cache b/tests/defaultFetchAssoc/config/.phpstan-dba-pdo.cache index 5c52e09fd..3e8f4505d 100644 --- a/tests/defaultFetchAssoc/config/.phpstan-dba-pdo.cache +++ b/tests/defaultFetchAssoc/config/.phpstan-dba-pdo.cache @@ -10,6 +10,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 2, + ), 'keyTypes' => array ( 0 => @@ -50,7 +54,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 2, 'optionalKeys' => array ( ), @@ -102,6 +105,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 4, + ), 'keyTypes' => array ( 0 => @@ -180,7 +187,6 @@ 'max' => 127, )), ), - 'nextAutoIndex' => 4, 'optionalKeys' => array ( ), diff --git a/tests/defaultFetchAssoc/config/.phpunit-phpstan-dba-mysqli.cache b/tests/defaultFetchAssoc/config/.phpunit-phpstan-dba-mysqli.cache index 5c52e09fd..3e8f4505d 100644 --- a/tests/defaultFetchAssoc/config/.phpunit-phpstan-dba-mysqli.cache +++ b/tests/defaultFetchAssoc/config/.phpunit-phpstan-dba-mysqli.cache @@ -10,6 +10,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 2, + ), 'keyTypes' => array ( 0 => @@ -50,7 +54,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 2, 'optionalKeys' => array ( ), @@ -102,6 +105,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 4, + ), 'keyTypes' => array ( 0 => @@ -180,7 +187,6 @@ 'max' => 127, )), ), - 'nextAutoIndex' => 4, 'optionalKeys' => array ( ), diff --git a/tests/defaultFetchAssoc/config/.phpunit-phpstan-dba-pdo.cache b/tests/defaultFetchAssoc/config/.phpunit-phpstan-dba-pdo.cache index 5c52e09fd..3e8f4505d 100644 --- a/tests/defaultFetchAssoc/config/.phpunit-phpstan-dba-pdo.cache +++ b/tests/defaultFetchAssoc/config/.phpunit-phpstan-dba-pdo.cache @@ -10,6 +10,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 2, + ), 'keyTypes' => array ( 0 => @@ -50,7 +54,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 2, 'optionalKeys' => array ( ), @@ -102,6 +105,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 4, + ), 'keyTypes' => array ( 0 => @@ -180,7 +187,6 @@ 'max' => 127, )), ), - 'nextAutoIndex' => 4, 'optionalKeys' => array ( ), diff --git a/tests/defaultFetchNumeric/config/.phpstan-dba-mysqli.cache b/tests/defaultFetchNumeric/config/.phpstan-dba-mysqli.cache index 5c52e09fd..3e8f4505d 100644 --- a/tests/defaultFetchNumeric/config/.phpstan-dba-mysqli.cache +++ b/tests/defaultFetchNumeric/config/.phpstan-dba-mysqli.cache @@ -10,6 +10,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 2, + ), 'keyTypes' => array ( 0 => @@ -50,7 +54,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 2, 'optionalKeys' => array ( ), @@ -102,6 +105,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 4, + ), 'keyTypes' => array ( 0 => @@ -180,7 +187,6 @@ 'max' => 127, )), ), - 'nextAutoIndex' => 4, 'optionalKeys' => array ( ), diff --git a/tests/defaultFetchNumeric/config/.phpstan-dba-pdo.cache b/tests/defaultFetchNumeric/config/.phpstan-dba-pdo.cache index 5c52e09fd..3e8f4505d 100644 --- a/tests/defaultFetchNumeric/config/.phpstan-dba-pdo.cache +++ b/tests/defaultFetchNumeric/config/.phpstan-dba-pdo.cache @@ -10,6 +10,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 2, + ), 'keyTypes' => array ( 0 => @@ -50,7 +54,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 2, 'optionalKeys' => array ( ), @@ -102,6 +105,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 4, + ), 'keyTypes' => array ( 0 => @@ -180,7 +187,6 @@ 'max' => 127, )), ), - 'nextAutoIndex' => 4, 'optionalKeys' => array ( ), diff --git a/tests/defaultFetchNumeric/config/.phpunit-phpstan-dba-mysqli.cache b/tests/defaultFetchNumeric/config/.phpunit-phpstan-dba-mysqli.cache index 5c52e09fd..3e8f4505d 100644 --- a/tests/defaultFetchNumeric/config/.phpunit-phpstan-dba-mysqli.cache +++ b/tests/defaultFetchNumeric/config/.phpunit-phpstan-dba-mysqli.cache @@ -10,6 +10,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 2, + ), 'keyTypes' => array ( 0 => @@ -50,7 +54,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 2, 'optionalKeys' => array ( ), @@ -102,6 +105,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 4, + ), 'keyTypes' => array ( 0 => @@ -180,7 +187,6 @@ 'max' => 127, )), ), - 'nextAutoIndex' => 4, 'optionalKeys' => array ( ), diff --git a/tests/defaultFetchNumeric/config/.phpunit-phpstan-dba-pdo.cache b/tests/defaultFetchNumeric/config/.phpunit-phpstan-dba-pdo.cache index 5c52e09fd..3e8f4505d 100644 --- a/tests/defaultFetchNumeric/config/.phpunit-phpstan-dba-pdo.cache +++ b/tests/defaultFetchNumeric/config/.phpunit-phpstan-dba-pdo.cache @@ -10,6 +10,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 2, + ), 'keyTypes' => array ( 0 => @@ -50,7 +54,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 2, 'optionalKeys' => array ( ), @@ -102,6 +105,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 4, + ), 'keyTypes' => array ( 0 => @@ -180,7 +187,6 @@ 'max' => 127, )), ), - 'nextAutoIndex' => 4, 'optionalKeys' => array ( ), diff --git a/tests/rules/config/.phpstan-dba-mysqli.cache b/tests/rules/config/.phpstan-dba-mysqli.cache index 268cdde2b..64c025972 100644 --- a/tests/rules/config/.phpstan-dba-mysqli.cache +++ b/tests/rules/config/.phpstan-dba-mysqli.cache @@ -3,6 +3,48 @@ 'schemaHash' => NULL, 'records' => array ( + ' + SELECT + ada.*, + COALESCE(NULLIF(email, ""), email) AS email + FROM ada + INNER JOIN ak ON (ak.adaid = ada.adaid AND ak.akid = \'1\') + WHERE adaid = 1 ORDER BY COALESCE(NULLIF(email, ""), email) ASC + ' => + array ( + 'result' => + array ( + 5 => NULL, + ), + ), + ' + SELECT + ada.*, + COALESCE(NULLIF(email, ""), email) AS email + FROM ada + INNER JOIN ak ON (ak.adaid = ada.adaid AND ak.akid = :akid) + WHERE adaid = 1 ORDER BY COALESCE(NULLIF(email, ""), email) ASC + ' => + array ( + 'result' => + array ( + 5 => NULL, + ), + ), + ' + SELECT + ada.*, + COALESCE(NULLIF(email, ""), email) AS email + FROM ada + INNER JOIN ak ON (ak.adaid = ada.adaid AND ak.akid = ?) + WHERE adaid = 1 ORDER BY COALESCE(NULLIF(email, ""), email) ASC + ' => + array ( + 'result' => + array ( + 5 => NULL, + ), + ), 'SELECT * FROM ada GROUP BY doesNotExist' => array ( 'result' => @@ -38,6 +80,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 1, + ), 'keyTypes' => array ( 0 => @@ -63,7 +109,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 1, 'optionalKeys' => array ( ), @@ -118,6 +163,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 1, + ), 'keyTypes' => array ( 0 => @@ -139,7 +188,6 @@ PHPStan\Type\StringType::__set_state(array( )), ), - 'nextAutoIndex' => 1, 'optionalKeys' => array ( ), @@ -194,6 +242,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 2, + ), 'keyTypes' => array ( 0 => @@ -234,7 +286,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 2, 'optionalKeys' => array ( ), @@ -321,6 +372,101 @@ 5 => NULL, ), ), + 'SELECT email, adaid FROM ada WHERE email=\'my_other_table\' LIMIT 1' => + array ( + 'result' => + array ( + 5 => + PHPStan\Type\Constant\ConstantArrayType::__set_state(array( + 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 2, + ), + 'keyTypes' => + array ( + 0 => + PHPStan\Type\Constant\ConstantStringType::__set_state(array( + 'value' => 'email', + 'isClassString' => false, + )), + 1 => + PHPStan\Type\Constant\ConstantIntegerType::__set_state(array( + 'value' => 0, + )), + 2 => + PHPStan\Type\Constant\ConstantStringType::__set_state(array( + 'value' => 'adaid', + 'isClassString' => false, + )), + 3 => + PHPStan\Type\Constant\ConstantIntegerType::__set_state(array( + 'value' => 1, + )), + ), + 'valueTypes' => + array ( + 0 => + PHPStan\Type\StringType::__set_state(array( + )), + 1 => + PHPStan\Type\StringType::__set_state(array( + )), + 2 => + PHPStan\Type\IntegerRangeType::__set_state(array( + 'min' => -32768, + 'max' => 32767, + )), + 3 => + PHPStan\Type\IntegerRangeType::__set_state(array( + 'min' => -32768, + 'max' => 32767, + )), + ), + 'optionalKeys' => + array ( + ), + 'keyType' => + PHPStan\Type\UnionType::__set_state(array( + '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( + 'value' => 'adaid', + 'isClassString' => false, + )), + 3 => + PHPStan\Type\Constant\ConstantStringType::__set_state(array( + 'value' => 'email', + 'isClassString' => false, + )), + ), + )), + 'itemType' => + PHPStan\Type\UnionType::__set_state(array( + 'types' => + array ( + 0 => + PHPStan\Type\IntegerRangeType::__set_state(array( + 'min' => -32768, + 'max' => 32767, + )), + 1 => + PHPStan\Type\StringType::__set_state(array( + )), + ), + )), + )), + ), + ), 'SELECT email, adaid GROUP BY xy FROM ada LIMIT 1' => array ( 'result' => @@ -328,6 +474,13 @@ 5 => NULL, ), ), + 'SELECT email, adaid GROUP BY xy FROM ada WHERE email=\'my_other_table\' LIMIT 1' => + array ( + 'result' => + array ( + 5 => NULL, + ), + ), 'SELECT email, adaid, gesperrt, freigabe1u1 FROM ada' => array ( 'result' => @@ -335,6 +488,10 @@ 4 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 4, + ), 'keyTypes' => array ( 0 => @@ -375,7 +532,6 @@ 'max' => 127, )), ), - 'nextAutoIndex' => 4, 'optionalKeys' => array ( ), @@ -419,6 +575,10 @@ 3 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 0, + ), 'keyTypes' => array ( 0 => @@ -463,7 +623,6 @@ 'max' => 127, )), ), - 'nextAutoIndex' => 0, 'optionalKeys' => array ( ), @@ -511,6 +670,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 4, + ), 'keyTypes' => array ( 0 => @@ -589,7 +752,6 @@ 'max' => 127, )), ), - 'nextAutoIndex' => 4, 'optionalKeys' => array ( ), @@ -659,6 +821,161 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 4, + ), + 'keyTypes' => + array ( + 0 => + PHPStan\Type\Constant\ConstantStringType::__set_state(array( + 'value' => 'email', + 'isClassString' => false, + )), + 1 => + PHPStan\Type\Constant\ConstantIntegerType::__set_state(array( + 'value' => 0, + )), + 2 => + PHPStan\Type\Constant\ConstantStringType::__set_state(array( + 'value' => 'adaid', + 'isClassString' => false, + )), + 3 => + PHPStan\Type\Constant\ConstantIntegerType::__set_state(array( + 'value' => 1, + )), + 4 => + PHPStan\Type\Constant\ConstantStringType::__set_state(array( + 'value' => 'gesperrt', + 'isClassString' => false, + )), + 5 => + PHPStan\Type\Constant\ConstantIntegerType::__set_state(array( + 'value' => 2, + )), + 6 => + PHPStan\Type\Constant\ConstantStringType::__set_state(array( + 'value' => 'freigabe1u1', + 'isClassString' => false, + )), + 7 => + PHPStan\Type\Constant\ConstantIntegerType::__set_state(array( + 'value' => 3, + )), + ), + 'valueTypes' => + array ( + 0 => + PHPStan\Type\StringType::__set_state(array( + )), + 1 => + PHPStan\Type\StringType::__set_state(array( + )), + 2 => + PHPStan\Type\IntegerRangeType::__set_state(array( + 'min' => -32768, + 'max' => 32767, + )), + 3 => + PHPStan\Type\IntegerRangeType::__set_state(array( + 'min' => -32768, + 'max' => 32767, + )), + 4 => + PHPStan\Type\IntegerRangeType::__set_state(array( + 'min' => -128, + 'max' => 127, + )), + 5 => + PHPStan\Type\IntegerRangeType::__set_state(array( + 'min' => -128, + 'max' => 127, + )), + 6 => + PHPStan\Type\IntegerRangeType::__set_state(array( + 'min' => -128, + 'max' => 127, + )), + 7 => + PHPStan\Type\IntegerRangeType::__set_state(array( + 'min' => -128, + 'max' => 127, + )), + ), + 'optionalKeys' => + array ( + ), + 'keyType' => + PHPStan\Type\UnionType::__set_state(array( + '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\ConstantIntegerType::__set_state(array( + 'value' => 3, + )), + 4 => + PHPStan\Type\Constant\ConstantStringType::__set_state(array( + 'value' => 'adaid', + 'isClassString' => false, + )), + 5 => + PHPStan\Type\Constant\ConstantStringType::__set_state(array( + 'value' => 'email', + 'isClassString' => false, + )), + 6 => + PHPStan\Type\Constant\ConstantStringType::__set_state(array( + 'value' => 'freigabe1u1', + 'isClassString' => false, + )), + 7 => + PHPStan\Type\Constant\ConstantStringType::__set_state(array( + 'value' => 'gesperrt', + 'isClassString' => false, + )), + ), + )), + 'itemType' => + PHPStan\Type\UnionType::__set_state(array( + 'types' => + array ( + 0 => + PHPStan\Type\IntegerRangeType::__set_state(array( + 'min' => -32768, + 'max' => 32767, + )), + 1 => + PHPStan\Type\StringType::__set_state(array( + )), + ), + )), + )), + ), + ), + 'SELECT email, adaid, gesperrt, freigabe1u1 FROM ada WHERE email=\'my_other_table\' LIMIT 1' => + array ( + 'result' => + array ( + 5 => + PHPStan\Type\Constant\ConstantArrayType::__set_state(array( + 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 4, + ), 'keyTypes' => array ( 0 => @@ -737,7 +1054,6 @@ 'max' => 127, )), ), - 'nextAutoIndex' => 4, 'optionalKeys' => array ( ), @@ -807,6 +1123,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 4, + ), 'keyTypes' => array ( 0 => @@ -885,7 +1205,6 @@ 'max' => 127, )), ), - 'nextAutoIndex' => 4, 'optionalKeys' => array ( ), @@ -984,6 +1303,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 4, + ), 'keyTypes' => array ( 0 => @@ -1062,7 +1385,6 @@ 'max' => 127, )), ), - 'nextAutoIndex' => 4, 'optionalKeys' => array ( ), diff --git a/tests/rules/config/.phpstan-dba-pdo.cache b/tests/rules/config/.phpstan-dba-pdo.cache index 268cdde2b..64c025972 100644 --- a/tests/rules/config/.phpstan-dba-pdo.cache +++ b/tests/rules/config/.phpstan-dba-pdo.cache @@ -3,6 +3,48 @@ 'schemaHash' => NULL, 'records' => array ( + ' + SELECT + ada.*, + COALESCE(NULLIF(email, ""), email) AS email + FROM ada + INNER JOIN ak ON (ak.adaid = ada.adaid AND ak.akid = \'1\') + WHERE adaid = 1 ORDER BY COALESCE(NULLIF(email, ""), email) ASC + ' => + array ( + 'result' => + array ( + 5 => NULL, + ), + ), + ' + SELECT + ada.*, + COALESCE(NULLIF(email, ""), email) AS email + FROM ada + INNER JOIN ak ON (ak.adaid = ada.adaid AND ak.akid = :akid) + WHERE adaid = 1 ORDER BY COALESCE(NULLIF(email, ""), email) ASC + ' => + array ( + 'result' => + array ( + 5 => NULL, + ), + ), + ' + SELECT + ada.*, + COALESCE(NULLIF(email, ""), email) AS email + FROM ada + INNER JOIN ak ON (ak.adaid = ada.adaid AND ak.akid = ?) + WHERE adaid = 1 ORDER BY COALESCE(NULLIF(email, ""), email) ASC + ' => + array ( + 'result' => + array ( + 5 => NULL, + ), + ), 'SELECT * FROM ada GROUP BY doesNotExist' => array ( 'result' => @@ -38,6 +80,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 1, + ), 'keyTypes' => array ( 0 => @@ -63,7 +109,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 1, 'optionalKeys' => array ( ), @@ -118,6 +163,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 1, + ), 'keyTypes' => array ( 0 => @@ -139,7 +188,6 @@ PHPStan\Type\StringType::__set_state(array( )), ), - 'nextAutoIndex' => 1, 'optionalKeys' => array ( ), @@ -194,6 +242,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 2, + ), 'keyTypes' => array ( 0 => @@ -234,7 +286,6 @@ 'max' => 32767, )), ), - 'nextAutoIndex' => 2, 'optionalKeys' => array ( ), @@ -321,6 +372,101 @@ 5 => NULL, ), ), + 'SELECT email, adaid FROM ada WHERE email=\'my_other_table\' LIMIT 1' => + array ( + 'result' => + array ( + 5 => + PHPStan\Type\Constant\ConstantArrayType::__set_state(array( + 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 2, + ), + 'keyTypes' => + array ( + 0 => + PHPStan\Type\Constant\ConstantStringType::__set_state(array( + 'value' => 'email', + 'isClassString' => false, + )), + 1 => + PHPStan\Type\Constant\ConstantIntegerType::__set_state(array( + 'value' => 0, + )), + 2 => + PHPStan\Type\Constant\ConstantStringType::__set_state(array( + 'value' => 'adaid', + 'isClassString' => false, + )), + 3 => + PHPStan\Type\Constant\ConstantIntegerType::__set_state(array( + 'value' => 1, + )), + ), + 'valueTypes' => + array ( + 0 => + PHPStan\Type\StringType::__set_state(array( + )), + 1 => + PHPStan\Type\StringType::__set_state(array( + )), + 2 => + PHPStan\Type\IntegerRangeType::__set_state(array( + 'min' => -32768, + 'max' => 32767, + )), + 3 => + PHPStan\Type\IntegerRangeType::__set_state(array( + 'min' => -32768, + 'max' => 32767, + )), + ), + 'optionalKeys' => + array ( + ), + 'keyType' => + PHPStan\Type\UnionType::__set_state(array( + '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( + 'value' => 'adaid', + 'isClassString' => false, + )), + 3 => + PHPStan\Type\Constant\ConstantStringType::__set_state(array( + 'value' => 'email', + 'isClassString' => false, + )), + ), + )), + 'itemType' => + PHPStan\Type\UnionType::__set_state(array( + 'types' => + array ( + 0 => + PHPStan\Type\IntegerRangeType::__set_state(array( + 'min' => -32768, + 'max' => 32767, + )), + 1 => + PHPStan\Type\StringType::__set_state(array( + )), + ), + )), + )), + ), + ), 'SELECT email, adaid GROUP BY xy FROM ada LIMIT 1' => array ( 'result' => @@ -328,6 +474,13 @@ 5 => NULL, ), ), + 'SELECT email, adaid GROUP BY xy FROM ada WHERE email=\'my_other_table\' LIMIT 1' => + array ( + 'result' => + array ( + 5 => NULL, + ), + ), 'SELECT email, adaid, gesperrt, freigabe1u1 FROM ada' => array ( 'result' => @@ -335,6 +488,10 @@ 4 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 4, + ), 'keyTypes' => array ( 0 => @@ -375,7 +532,6 @@ 'max' => 127, )), ), - 'nextAutoIndex' => 4, 'optionalKeys' => array ( ), @@ -419,6 +575,10 @@ 3 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 0, + ), 'keyTypes' => array ( 0 => @@ -463,7 +623,6 @@ 'max' => 127, )), ), - 'nextAutoIndex' => 0, 'optionalKeys' => array ( ), @@ -511,6 +670,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 4, + ), 'keyTypes' => array ( 0 => @@ -589,7 +752,6 @@ 'max' => 127, )), ), - 'nextAutoIndex' => 4, 'optionalKeys' => array ( ), @@ -659,6 +821,161 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 4, + ), + 'keyTypes' => + array ( + 0 => + PHPStan\Type\Constant\ConstantStringType::__set_state(array( + 'value' => 'email', + 'isClassString' => false, + )), + 1 => + PHPStan\Type\Constant\ConstantIntegerType::__set_state(array( + 'value' => 0, + )), + 2 => + PHPStan\Type\Constant\ConstantStringType::__set_state(array( + 'value' => 'adaid', + 'isClassString' => false, + )), + 3 => + PHPStan\Type\Constant\ConstantIntegerType::__set_state(array( + 'value' => 1, + )), + 4 => + PHPStan\Type\Constant\ConstantStringType::__set_state(array( + 'value' => 'gesperrt', + 'isClassString' => false, + )), + 5 => + PHPStan\Type\Constant\ConstantIntegerType::__set_state(array( + 'value' => 2, + )), + 6 => + PHPStan\Type\Constant\ConstantStringType::__set_state(array( + 'value' => 'freigabe1u1', + 'isClassString' => false, + )), + 7 => + PHPStan\Type\Constant\ConstantIntegerType::__set_state(array( + 'value' => 3, + )), + ), + 'valueTypes' => + array ( + 0 => + PHPStan\Type\StringType::__set_state(array( + )), + 1 => + PHPStan\Type\StringType::__set_state(array( + )), + 2 => + PHPStan\Type\IntegerRangeType::__set_state(array( + 'min' => -32768, + 'max' => 32767, + )), + 3 => + PHPStan\Type\IntegerRangeType::__set_state(array( + 'min' => -32768, + 'max' => 32767, + )), + 4 => + PHPStan\Type\IntegerRangeType::__set_state(array( + 'min' => -128, + 'max' => 127, + )), + 5 => + PHPStan\Type\IntegerRangeType::__set_state(array( + 'min' => -128, + 'max' => 127, + )), + 6 => + PHPStan\Type\IntegerRangeType::__set_state(array( + 'min' => -128, + 'max' => 127, + )), + 7 => + PHPStan\Type\IntegerRangeType::__set_state(array( + 'min' => -128, + 'max' => 127, + )), + ), + 'optionalKeys' => + array ( + ), + 'keyType' => + PHPStan\Type\UnionType::__set_state(array( + '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\ConstantIntegerType::__set_state(array( + 'value' => 3, + )), + 4 => + PHPStan\Type\Constant\ConstantStringType::__set_state(array( + 'value' => 'adaid', + 'isClassString' => false, + )), + 5 => + PHPStan\Type\Constant\ConstantStringType::__set_state(array( + 'value' => 'email', + 'isClassString' => false, + )), + 6 => + PHPStan\Type\Constant\ConstantStringType::__set_state(array( + 'value' => 'freigabe1u1', + 'isClassString' => false, + )), + 7 => + PHPStan\Type\Constant\ConstantStringType::__set_state(array( + 'value' => 'gesperrt', + 'isClassString' => false, + )), + ), + )), + 'itemType' => + PHPStan\Type\UnionType::__set_state(array( + 'types' => + array ( + 0 => + PHPStan\Type\IntegerRangeType::__set_state(array( + 'min' => -32768, + 'max' => 32767, + )), + 1 => + PHPStan\Type\StringType::__set_state(array( + )), + ), + )), + )), + ), + ), + 'SELECT email, adaid, gesperrt, freigabe1u1 FROM ada WHERE email=\'my_other_table\' LIMIT 1' => + array ( + 'result' => + array ( + 5 => + PHPStan\Type\Constant\ConstantArrayType::__set_state(array( + 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 4, + ), 'keyTypes' => array ( 0 => @@ -737,7 +1054,6 @@ 'max' => 127, )), ), - 'nextAutoIndex' => 4, 'optionalKeys' => array ( ), @@ -807,6 +1123,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 4, + ), 'keyTypes' => array ( 0 => @@ -885,7 +1205,6 @@ 'max' => 127, )), ), - 'nextAutoIndex' => 4, 'optionalKeys' => array ( ), @@ -984,6 +1303,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 4, + ), 'keyTypes' => array ( 0 => @@ -1062,7 +1385,6 @@ 'max' => 127, )), ), - 'nextAutoIndex' => 4, 'optionalKeys' => array ( ), diff --git a/tests/rules/config/.phpunit-phpstan-dba-mysqli.cache b/tests/rules/config/.phpunit-phpstan-dba-mysqli.cache index 587c1c994..292bd2111 100644 --- a/tests/rules/config/.phpunit-phpstan-dba-mysqli.cache +++ b/tests/rules/config/.phpunit-phpstan-dba-mysqli.cache @@ -367,6 +367,10 @@ array ( 'error' => NULL, ), + 'SELECT email, adaid, gesperrt, freigabe1u1 FROM ada WHERE email=\'my_other_table\' LIMIT 1' => + array ( + 'error' => NULL, + ), 'SELECT email, adaid, gesperrt, freigabe1u1 FROM ada WHERE asdsa=\'1\'' => array ( 'error' => diff --git a/tests/rules/config/.phpunit-phpstan-dba-pdo.cache b/tests/rules/config/.phpunit-phpstan-dba-pdo.cache index 941c1a36d..f9c65a432 100644 --- a/tests/rules/config/.phpunit-phpstan-dba-pdo.cache +++ b/tests/rules/config/.phpunit-phpstan-dba-pdo.cache @@ -367,6 +367,10 @@ array ( 'error' => NULL, ), + 'SELECT email, adaid, gesperrt, freigabe1u1 FROM ada WHERE email=\'my_other_table\' LIMIT 1' => + array ( + 'error' => NULL, + ), 'SELECT email, adaid, gesperrt, freigabe1u1 FROM ada WHERE asdsa=\'1\'' => array ( 'error' => diff --git a/tests/rules/data/pdo-stmt-execute-error.php b/tests/rules/data/pdo-stmt-execute-error.php index c4fe548a7..69eb2b007 100644 --- a/tests/rules/data/pdo-stmt-execute-error.php +++ b/tests/rules/data/pdo-stmt-execute-error.php @@ -72,4 +72,30 @@ public function errorsBind(PDO $pdo) $stmt->bindValue(':email', 'email@example.org'); $stmt->execute(); // wrong number of parameters } + + public function bug336(PDO $pdo) + { + $stmt = $pdo->prepare(' + SELECT + ada.*, + COALESCE(NULLIF(email, ""), email) AS email + FROM ada + INNER JOIN ak ON (ak.adaid = ada.adaid AND ak.akid = ?) + WHERE adaid = 1 ORDER BY COALESCE(NULLIF(email, ""), email) ASC + '); + $stmt->execute([1]); // everything fine + } + + public function bug336Named(PDO $pdo) + { + $stmt = $pdo->prepare(' + SELECT + ada.*, + COALESCE(NULLIF(email, ""), email) AS email + FROM ada + INNER JOIN ak ON (ak.adaid = ada.adaid AND ak.akid = :akid) + WHERE adaid = 1 ORDER BY COALESCE(NULLIF(email, ""), email) ASC + '); + $stmt->execute([':akid' => 1]); // everything fine + } } diff --git a/tests/stringify/config/.phpstan-dba-mysqli.cache b/tests/stringify/config/.phpstan-dba-mysqli.cache index 5f95a8356..2e46eb669 100644 --- a/tests/stringify/config/.phpstan-dba-mysqli.cache +++ b/tests/stringify/config/.phpstan-dba-mysqli.cache @@ -10,6 +10,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 4, + ), 'keyTypes' => array ( 0 => @@ -130,7 +134,6 @@ ), )), ), - 'nextAutoIndex' => 4, 'optionalKeys' => array ( ), diff --git a/tests/stringify/config/.phpstan-dba-pdo.cache b/tests/stringify/config/.phpstan-dba-pdo.cache index 5f95a8356..2e46eb669 100644 --- a/tests/stringify/config/.phpstan-dba-pdo.cache +++ b/tests/stringify/config/.phpstan-dba-pdo.cache @@ -10,6 +10,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 4, + ), 'keyTypes' => array ( 0 => @@ -130,7 +134,6 @@ ), )), ), - 'nextAutoIndex' => 4, 'optionalKeys' => array ( ), diff --git a/tests/stringify/config/.phpunit-phpstan-dba-mysqli.cache b/tests/stringify/config/.phpunit-phpstan-dba-mysqli.cache index 5f95a8356..2e46eb669 100644 --- a/tests/stringify/config/.phpunit-phpstan-dba-mysqli.cache +++ b/tests/stringify/config/.phpunit-phpstan-dba-mysqli.cache @@ -10,6 +10,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 4, + ), 'keyTypes' => array ( 0 => @@ -130,7 +134,6 @@ ), )), ), - 'nextAutoIndex' => 4, 'optionalKeys' => array ( ), diff --git a/tests/stringify/config/.phpunit-phpstan-dba-pdo.cache b/tests/stringify/config/.phpunit-phpstan-dba-pdo.cache index 5f95a8356..2e46eb669 100644 --- a/tests/stringify/config/.phpunit-phpstan-dba-pdo.cache +++ b/tests/stringify/config/.phpunit-phpstan-dba-pdo.cache @@ -10,6 +10,10 @@ 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, + 'nextAutoIndexes' => + array ( + 0 => 4, + ), 'keyTypes' => array ( 0 => @@ -130,7 +134,6 @@ ), )), ), - 'nextAutoIndex' => 4, 'optionalKeys' => array ( ),