From f866ff91065e4e0d065011174aee8cf3baabd840 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Wed, 26 Jan 2022 14:43:14 +0100 Subject: [PATCH 1/4] extract METHODS constant --- ...neConnectionFetchDynamicReturnTypeExtension.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/Extensions/DoctrineConnectionFetchDynamicReturnTypeExtension.php b/src/Extensions/DoctrineConnectionFetchDynamicReturnTypeExtension.php index c2149bad2..00141f744 100644 --- a/src/Extensions/DoctrineConnectionFetchDynamicReturnTypeExtension.php +++ b/src/Extensions/DoctrineConnectionFetchDynamicReturnTypeExtension.php @@ -21,6 +21,18 @@ final class DoctrineConnectionFetchDynamicReturnTypeExtension implements DynamicMethodReturnTypeExtension { + private const METHODS = [ + 'fetchone', + 'fetchfirstcolumn', + 'fetchassociative', + 'fetchallassociative', + 'fetchnumeric', + 'fetchallnumeric', + 'iteratecolumn', + 'iterateassociative', + 'iteratenumeric' + ]; + public function getClass(): string { return Connection::class; @@ -28,7 +40,7 @@ public function getClass(): string public function isMethodSupported(MethodReflection $methodReflection): bool { - return \in_array(strtolower($methodReflection->getName()), ['fetchone', 'fetchfirstcolumn', 'fetchassociative', 'fetchallassociative', 'fetchnumeric', 'fetchallnumeric', 'iteratecolumn', 'iterateassociative', 'iteratenumeric'], true); + return \in_array(strtolower($methodReflection->getName()), self::METHODS, true); } public function getTypeFromMethodCall(MethodReflection $methodReflection, MethodCall $methodCall, Scope $scope): Type From 560e89087f9da7623cf21009d1be70db68025ef9 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Wed, 26 Jan 2022 15:03:10 +0100 Subject: [PATCH 2/4] doctrine-dbal: implement `fetchAllKeyValue` & `iterateKeyValue` --- .phpstan-dba.cache | 236 +++--------------- src/DoctrineReflection/DoctrineReflection.php | 19 +- ...nectionFetchDynamicReturnTypeExtension.php | 2 +- ...ctrineResultDynamicReturnTypeExtension.php | 2 + src/QueryReflection/QueryReflector.php | 1 + tests/data/doctrine-dbal.php | 6 + 6 files changed, 58 insertions(+), 208 deletions(-) diff --git a/.phpstan-dba.cache b/.phpstan-dba.cache index 9cba86f9c..82e4a777a 100644 --- a/.phpstan-dba.cache +++ b/.phpstan-dba.cache @@ -3487,7 +3487,7 @@ Simulated query: SELECT email, adaid FROM ada . WHERE email=\'my_other_table\' L 'error' => NULL, 'result' => array ( - 3 => + 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, 'keyTypes' => @@ -3498,10 +3498,18 @@ Simulated query: SELECT email, adaid FROM ada . WHERE email=\'my_other_table\' L '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 ( @@ -3509,12 +3517,20 @@ Simulated query: SELECT email, adaid FROM ada . WHERE email=\'my_other_table\' L PHPStan\Type\StringType::__set_state(array( )), 1 => + PHPStan\Type\StringType::__set_state(array( + )), + 2 => + PHPStan\Type\IntegerRangeType::__set_state(array( + 'min' => 0, + 'max' => 4294967295, + )), + 3 => PHPStan\Type\IntegerRangeType::__set_state(array( 'min' => 0, 'max' => 4294967295, )), ), - 'nextAutoIndex' => 0, + 'nextAutoIndex' => 2, 'optionalKeys' => array ( ), @@ -3523,11 +3539,19 @@ Simulated query: SELECT email, adaid FROM ada . WHERE email=\'my_other_table\' L '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, )), - 1 => + 3 => PHPStan\Type\Constant\ConstantStringType::__set_state(array( 'value' => 'email', 'isClassString' => false, @@ -3549,7 +3573,7 @@ Simulated query: SELECT email, adaid FROM ada . WHERE email=\'my_other_table\' L ), )), )), - 5 => + 3 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, 'keyTypes' => @@ -3560,18 +3584,10 @@ Simulated query: SELECT email, adaid FROM ada . WHERE email=\'my_other_table\' L '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 ( @@ -3579,20 +3595,12 @@ Simulated query: SELECT email, adaid FROM ada . WHERE email=\'my_other_table\' L PHPStan\Type\StringType::__set_state(array( )), 1 => - PHPStan\Type\StringType::__set_state(array( - )), - 2 => - PHPStan\Type\IntegerRangeType::__set_state(array( - 'min' => 0, - 'max' => 4294967295, - )), - 3 => PHPStan\Type\IntegerRangeType::__set_state(array( 'min' => 0, 'max' => 4294967295, )), ), - 'nextAutoIndex' => 2, + 'nextAutoIndex' => 0, 'optionalKeys' => array ( ), @@ -3601,19 +3609,11 @@ Simulated query: SELECT email, adaid FROM ada . WHERE email=\'my_other_table\' L '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 => + 1 => PHPStan\Type\Constant\ConstantStringType::__set_state(array( 'value' => 'email', 'isClassString' => false, @@ -4588,182 +4588,6 @@ Simulated query: SELECT email, adaid FROM ada . WHERE email=\'my_other_table\' L ), )), )), - 3 => - PHPStan\Type\Constant\ConstantArrayType::__set_state(array( - 'allArrays' => NULL, - 'keyTypes' => - array ( - 0 => - PHPStan\Type\Constant\ConstantStringType::__set_state(array( - 'value' => 'email', - 'isClassString' => false, - )), - 1 => - PHPStan\Type\Constant\ConstantStringType::__set_state(array( - 'value' => 'adaid', - 'isClassString' => false, - )), - 2 => - PHPStan\Type\Constant\ConstantStringType::__set_state(array( - 'value' => 'gesperrt', - 'isClassString' => false, - )), - 3 => - PHPStan\Type\Constant\ConstantStringType::__set_state(array( - 'value' => 'freigabe1u1', - 'isClassString' => false, - )), - ), - 'valueTypes' => - array ( - 0 => - PHPStan\Type\StringType::__set_state(array( - )), - 1 => - PHPStan\Type\IntegerRangeType::__set_state(array( - 'min' => 0, - 'max' => 4294967295, - )), - 2 => - PHPStan\Type\IntegerRangeType::__set_state(array( - 'min' => -128, - 'max' => 127, - )), - 3 => - PHPStan\Type\IntegerRangeType::__set_state(array( - 'min' => -128, - 'max' => 127, - )), - ), - 'nextAutoIndex' => 0, - 'optionalKeys' => - array ( - ), - 'keyType' => - PHPStan\Type\UnionType::__set_state(array( - 'types' => - array ( - 0 => - PHPStan\Type\Constant\ConstantStringType::__set_state(array( - 'value' => 'adaid', - 'isClassString' => false, - )), - 1 => - PHPStan\Type\Constant\ConstantStringType::__set_state(array( - 'value' => 'email', - 'isClassString' => false, - )), - 2 => - PHPStan\Type\Constant\ConstantStringType::__set_state(array( - 'value' => 'freigabe1u1', - 'isClassString' => false, - )), - 3 => - 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' => -128, - 'max' => 4294967295, - )), - 1 => - PHPStan\Type\StringType::__set_state(array( - )), - ), - )), - )), - 4 => - PHPStan\Type\Constant\ConstantArrayType::__set_state(array( - 'allArrays' => NULL, - 'keyTypes' => - 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, - )), - ), - 'valueTypes' => - array ( - 0 => - PHPStan\Type\StringType::__set_state(array( - )), - 1 => - PHPStan\Type\IntegerRangeType::__set_state(array( - 'min' => 0, - 'max' => 4294967295, - )), - 2 => - PHPStan\Type\IntegerRangeType::__set_state(array( - 'min' => -128, - 'max' => 127, - )), - 3 => - PHPStan\Type\IntegerRangeType::__set_state(array( - 'min' => -128, - 'max' => 127, - )), - ), - 'nextAutoIndex' => 4, - '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, - )), - ), - )), - 'itemType' => - PHPStan\Type\UnionType::__set_state(array( - 'types' => - array ( - 0 => - PHPStan\Type\IntegerRangeType::__set_state(array( - 'min' => -128, - 'max' => 4294967295, - )), - 1 => - PHPStan\Type\StringType::__set_state(array( - )), - ), - )), - )), ), ), 'SELECT email, adaid, gesperrt, freigabe1u1 FROM ada ' => diff --git a/src/DoctrineReflection/DoctrineReflection.php b/src/DoctrineReflection/DoctrineReflection.php index 497d55c16..f4b032f5e 100644 --- a/src/DoctrineReflection/DoctrineReflection.php +++ b/src/DoctrineReflection/DoctrineReflection.php @@ -26,6 +26,10 @@ public function fetchResultType(MethodReflection $methodReflection, Type $result $usedMethod = strtolower($methodReflection->getName()); switch ($usedMethod) { + case 'fetchallkeyvalue': + case 'iteratekeyvalue': + $fetchType = QueryReflector::FETCH_TYPE_KEY_VALUE; + break; case 'fetchone': $fetchType = QueryReflector::FETCH_TYPE_ONE; break; @@ -47,12 +51,25 @@ public function fetchResultType(MethodReflection $methodReflection, Type $result $fetchType = QueryReflector::FETCH_TYPE_BOTH; } - if ((\in_array($fetchType, [QueryReflector::FETCH_TYPE_ONE, QueryReflector::FETCH_TYPE_FIRST_COL, QueryReflector::FETCH_TYPE_NUMERIC, QueryReflector::FETCH_TYPE_ASSOC])) && $resultRowType instanceof ConstantArrayType) { + if (QueryReflector::FETCH_TYPE_BOTH !== $fetchType && $resultRowType instanceof ConstantArrayType) { $builder = ConstantArrayTypeBuilder::createEmpty(); $keyTypes = $resultRowType->getKeyTypes(); $valueTypes = $resultRowType->getValueTypes(); + if (QueryReflector::FETCH_TYPE_KEY_VALUE === $fetchType) { + // $valueType contain 'BOTH' fetched values + if (\count($valueTypes) < 2) { + return null; + } + + if (\in_array($usedMethod, ['fetchallkeyvalue'], true)) { + return new ArrayType($valueTypes[0], $valueTypes[2]); + } + + return new GenericObjectType(Traversable::class, [$valueTypes[0], $valueTypes[2]]); + } + foreach ($keyTypes as $i => $keyType) { if (QueryReflector::FETCH_TYPE_ONE === $fetchType) { return $valueTypes[$i]; diff --git a/src/Extensions/DoctrineConnectionFetchDynamicReturnTypeExtension.php b/src/Extensions/DoctrineConnectionFetchDynamicReturnTypeExtension.php index 00141f744..4a749134e 100644 --- a/src/Extensions/DoctrineConnectionFetchDynamicReturnTypeExtension.php +++ b/src/Extensions/DoctrineConnectionFetchDynamicReturnTypeExtension.php @@ -30,7 +30,7 @@ final class DoctrineConnectionFetchDynamicReturnTypeExtension implements Dynamic 'fetchallnumeric', 'iteratecolumn', 'iterateassociative', - 'iteratenumeric' + 'iteratenumeric', ]; public function getClass(): string diff --git a/src/Extensions/DoctrineResultDynamicReturnTypeExtension.php b/src/Extensions/DoctrineResultDynamicReturnTypeExtension.php index 09de92c2b..549ac5f6f 100644 --- a/src/Extensions/DoctrineResultDynamicReturnTypeExtension.php +++ b/src/Extensions/DoctrineResultDynamicReturnTypeExtension.php @@ -29,9 +29,11 @@ final class DoctrineResultDynamicReturnTypeExtension implements DynamicMethodRet 'fetchallnumeric', 'fetchassociative', 'fetchallassociative', + 'fetchallkeyvalue', 'iteratenumeric', 'iterateassociative', 'iteratecolumn', + 'iteratekeyvalue', ]; public function getClass(): string diff --git a/src/QueryReflection/QueryReflector.php b/src/QueryReflection/QueryReflector.php index de02d5474..3afdd090a 100644 --- a/src/QueryReflection/QueryReflector.php +++ b/src/QueryReflection/QueryReflector.php @@ -12,6 +12,7 @@ interface QueryReflector public const FETCH_TYPE_ASSOC = 3; public const FETCH_TYPE_NUMERIC = 4; public const FETCH_TYPE_BOTH = 5; + public const FETCH_TYPE_KEY_VALUE = 6; public function validateQueryString(string $queryString): ?Error; diff --git a/tests/data/doctrine-dbal.php b/tests/data/doctrine-dbal.php index bfaddcf53..1059a29d1 100644 --- a/tests/data/doctrine-dbal.php +++ b/tests/data/doctrine-dbal.php @@ -34,6 +34,9 @@ public function foo(Connection $conn) $fetch = $result->fetchAllAssociative(); assertType('array, array{email: string, adaid: int<0, 4294967295>, gesperrt: int<-128, 127>, freigabe1u1: int<-128, 127>}>', $fetch); + $fetch = $result->fetchAllKeyValue(); + assertType('array>', $fetch); + $fetch = $result->iterateNumeric(); assertType('Traversable, int<-128, 127>, int<-128, 127>}>', $fetch); @@ -42,6 +45,9 @@ public function foo(Connection $conn) $fetch = $result->iterateColumn(); assertType('Traversable', $fetch); + + $fetch = $result->iterateKeyValue(); + assertType('Traversable>', $fetch); } public function executeQuery(Connection $conn, array $types, QueryCacheProfile $qcp) From 9ac684562171658c86b61daa268a6a0d4ae866a4 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Wed, 26 Jan 2022 15:04:11 +0100 Subject: [PATCH 3/4] Update DoctrineReflection.php --- src/DoctrineReflection/DoctrineReflection.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/DoctrineReflection/DoctrineReflection.php b/src/DoctrineReflection/DoctrineReflection.php index f4b032f5e..170d060b7 100644 --- a/src/DoctrineReflection/DoctrineReflection.php +++ b/src/DoctrineReflection/DoctrineReflection.php @@ -59,7 +59,7 @@ public function fetchResultType(MethodReflection $methodReflection, Type $result if (QueryReflector::FETCH_TYPE_KEY_VALUE === $fetchType) { // $valueType contain 'BOTH' fetched values - if (\count($valueTypes) < 2) { + if (\count($valueTypes) < 4) { return null; } From 8ea3591f41bf9b3ce5be1216ebe9664c5e4b37bf Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Wed, 26 Jan 2022 16:01:44 +0100 Subject: [PATCH 4/4] Update .phpstan-dba.cache --- .phpstan-dba.cache | 236 +++++++++++++++++++++++++++++++++++++++------ 1 file changed, 206 insertions(+), 30 deletions(-) diff --git a/.phpstan-dba.cache b/.phpstan-dba.cache index 82e4a777a..9cba86f9c 100644 --- a/.phpstan-dba.cache +++ b/.phpstan-dba.cache @@ -3487,7 +3487,7 @@ Simulated query: SELECT email, adaid FROM ada . WHERE email=\'my_other_table\' L 'error' => NULL, 'result' => array ( - 5 => + 3 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, 'keyTypes' => @@ -3498,18 +3498,10 @@ Simulated query: SELECT email, adaid FROM ada . WHERE email=\'my_other_table\' L '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 ( @@ -3517,20 +3509,12 @@ Simulated query: SELECT email, adaid FROM ada . WHERE email=\'my_other_table\' L PHPStan\Type\StringType::__set_state(array( )), 1 => - PHPStan\Type\StringType::__set_state(array( - )), - 2 => - PHPStan\Type\IntegerRangeType::__set_state(array( - 'min' => 0, - 'max' => 4294967295, - )), - 3 => PHPStan\Type\IntegerRangeType::__set_state(array( 'min' => 0, 'max' => 4294967295, )), ), - 'nextAutoIndex' => 2, + 'nextAutoIndex' => 0, 'optionalKeys' => array ( ), @@ -3539,19 +3523,11 @@ Simulated query: SELECT email, adaid FROM ada . WHERE email=\'my_other_table\' L '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 => + 1 => PHPStan\Type\Constant\ConstantStringType::__set_state(array( 'value' => 'email', 'isClassString' => false, @@ -3573,7 +3549,7 @@ Simulated query: SELECT email, adaid FROM ada . WHERE email=\'my_other_table\' L ), )), )), - 3 => + 5 => PHPStan\Type\Constant\ConstantArrayType::__set_state(array( 'allArrays' => NULL, 'keyTypes' => @@ -3584,10 +3560,18 @@ Simulated query: SELECT email, adaid FROM ada . WHERE email=\'my_other_table\' L '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 ( @@ -3595,12 +3579,20 @@ Simulated query: SELECT email, adaid FROM ada . WHERE email=\'my_other_table\' L PHPStan\Type\StringType::__set_state(array( )), 1 => + PHPStan\Type\StringType::__set_state(array( + )), + 2 => + PHPStan\Type\IntegerRangeType::__set_state(array( + 'min' => 0, + 'max' => 4294967295, + )), + 3 => PHPStan\Type\IntegerRangeType::__set_state(array( 'min' => 0, 'max' => 4294967295, )), ), - 'nextAutoIndex' => 0, + 'nextAutoIndex' => 2, 'optionalKeys' => array ( ), @@ -3609,11 +3601,19 @@ Simulated query: SELECT email, adaid FROM ada . WHERE email=\'my_other_table\' L '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, )), - 1 => + 3 => PHPStan\Type\Constant\ConstantStringType::__set_state(array( 'value' => 'email', 'isClassString' => false, @@ -4588,6 +4588,182 @@ Simulated query: SELECT email, adaid FROM ada . WHERE email=\'my_other_table\' L ), )), )), + 3 => + PHPStan\Type\Constant\ConstantArrayType::__set_state(array( + 'allArrays' => NULL, + 'keyTypes' => + array ( + 0 => + PHPStan\Type\Constant\ConstantStringType::__set_state(array( + 'value' => 'email', + 'isClassString' => false, + )), + 1 => + PHPStan\Type\Constant\ConstantStringType::__set_state(array( + 'value' => 'adaid', + 'isClassString' => false, + )), + 2 => + PHPStan\Type\Constant\ConstantStringType::__set_state(array( + 'value' => 'gesperrt', + 'isClassString' => false, + )), + 3 => + PHPStan\Type\Constant\ConstantStringType::__set_state(array( + 'value' => 'freigabe1u1', + 'isClassString' => false, + )), + ), + 'valueTypes' => + array ( + 0 => + PHPStan\Type\StringType::__set_state(array( + )), + 1 => + PHPStan\Type\IntegerRangeType::__set_state(array( + 'min' => 0, + 'max' => 4294967295, + )), + 2 => + PHPStan\Type\IntegerRangeType::__set_state(array( + 'min' => -128, + 'max' => 127, + )), + 3 => + PHPStan\Type\IntegerRangeType::__set_state(array( + 'min' => -128, + 'max' => 127, + )), + ), + 'nextAutoIndex' => 0, + 'optionalKeys' => + array ( + ), + 'keyType' => + PHPStan\Type\UnionType::__set_state(array( + 'types' => + array ( + 0 => + PHPStan\Type\Constant\ConstantStringType::__set_state(array( + 'value' => 'adaid', + 'isClassString' => false, + )), + 1 => + PHPStan\Type\Constant\ConstantStringType::__set_state(array( + 'value' => 'email', + 'isClassString' => false, + )), + 2 => + PHPStan\Type\Constant\ConstantStringType::__set_state(array( + 'value' => 'freigabe1u1', + 'isClassString' => false, + )), + 3 => + 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' => -128, + 'max' => 4294967295, + )), + 1 => + PHPStan\Type\StringType::__set_state(array( + )), + ), + )), + )), + 4 => + PHPStan\Type\Constant\ConstantArrayType::__set_state(array( + 'allArrays' => NULL, + 'keyTypes' => + 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, + )), + ), + 'valueTypes' => + array ( + 0 => + PHPStan\Type\StringType::__set_state(array( + )), + 1 => + PHPStan\Type\IntegerRangeType::__set_state(array( + 'min' => 0, + 'max' => 4294967295, + )), + 2 => + PHPStan\Type\IntegerRangeType::__set_state(array( + 'min' => -128, + 'max' => 127, + )), + 3 => + PHPStan\Type\IntegerRangeType::__set_state(array( + 'min' => -128, + 'max' => 127, + )), + ), + 'nextAutoIndex' => 4, + '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, + )), + ), + )), + 'itemType' => + PHPStan\Type\UnionType::__set_state(array( + 'types' => + array ( + 0 => + PHPStan\Type\IntegerRangeType::__set_state(array( + 'min' => -128, + 'max' => 4294967295, + )), + 1 => + PHPStan\Type\StringType::__set_state(array( + )), + ), + )), + )), ), ), 'SELECT email, adaid, gesperrt, freigabe1u1 FROM ada ' =>