diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml index e8605273..56715b5a 100644 --- a/.github/workflows/phpunit.yml +++ b/.github/workflows/phpunit.yml @@ -16,7 +16,7 @@ jobs: - "lowest" - "highest" php-version: - - "8.1" + - "8.2" operating-system: - "ubuntu-latest" diff --git a/composer.json b/composer.json index 1026c3fd..79563e18 100644 --- a/composer.json +++ b/composer.json @@ -22,11 +22,11 @@ } }, "require": { - "php": ">=8.1", + "php": ">=8.2", "nikic/php-parser": "^4.0" }, "require-dev": { - "phpunit/phpunit": "^10.5.7", + "phpunit/phpunit": "^10.5.8", "tracy/tracy": "^2.10" }, "extra": { diff --git a/src/ReflectionParameter.php b/src/ReflectionParameter.php index 4d70a91f..c6805f61 100644 --- a/src/ReflectionParameter.php +++ b/src/ReflectionParameter.php @@ -320,6 +320,10 @@ public function getType(): ?\ReflectionType return null; } + if ($parameterType === 'iterable') { + $parameterType = 'Traversable|array'; + } + return new ReflectionNamedType($parameterType, $allowsNull, $isBuiltin); } diff --git a/src/Traits/ReflectionFunctionLikeTrait.php b/src/Traits/ReflectionFunctionLikeTrait.php index 8d0977cd..7044ed76 100644 --- a/src/Traits/ReflectionFunctionLikeTrait.php +++ b/src/Traits/ReflectionFunctionLikeTrait.php @@ -198,6 +198,10 @@ public function getReturnType(): ?\ReflectionType return null; } + if ($returnType === 'iterable') { + $returnType = 'Traversable|array'; + } + return new ReflectionNamedType($returnType, $isNullable, $isBuiltin); }