Skip to content

Commit

Permalink
Merge pull request #128 from samsonasik/step5-php82
Browse files Browse the repository at this point in the history
[Step 5 Upgrade] Bump requirement to php 8.2
  • Loading branch information
lisachenko authored Jan 23, 2024
2 parents bd12c88 + 03d5aa8 commit b8e46fa
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- "lowest"
- "highest"
php-version:
- "8.1"
- "8.2"
operating-system:
- "ubuntu-latest"

Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
4 changes: 4 additions & 0 deletions src/ReflectionParameter.php
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,10 @@ public function getType(): ?\ReflectionType
return null;
}

if ($parameterType === 'iterable') {
$parameterType = 'Traversable|array';
}

return new ReflectionNamedType($parameterType, $allowsNull, $isBuiltin);
}

Expand Down
4 changes: 4 additions & 0 deletions src/Traits/ReflectionFunctionLikeTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,10 @@ public function getReturnType(): ?\ReflectionType
return null;
}

if ($returnType === 'iterable') {
$returnType = 'Traversable|array';
}

return new ReflectionNamedType($returnType, $isNullable, $isBuiltin);
}

Expand Down

0 comments on commit b8e46fa

Please sign in to comment.