Skip to content

Commit

Permalink
Set php target 8.2 to analyze code
Browse files Browse the repository at this point in the history
  • Loading branch information
koriym committed Nov 11, 2023
1 parent 2565cac commit 36dfc09
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
parameters:
phpVersion: 80200
level: max
paths:
- sl-src
Expand Down
2 changes: 1 addition & 1 deletion psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config https://psalm.dev/schema/config"
findUnusedBaselineEntry="true"
findUnusedCode="false"
phpVersion="8.2"
>
<projectFiles>
<directory name="sl-src" />
Expand Down
6 changes: 3 additions & 3 deletions src/TypeString.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ private function intersectionTypeToString(ReflectionIntersectionType $intersecti

public function getUnionType(ReflectionUnionType $type): string
{
$types = array_map(/** @param ReflectionNamedType|ReflectionNamedType $t */ static function ($t) {
$types = array_map(/** @param ReflectionNamedType|ReflectionIntersectionType $t */ static function ($t) {
if ($t instanceof ReflectionIntersectionType) {
$intersectionTypes = array_map(/** @param ReflectionNamedType $t */ static function ($t) {
return self::getFqnType($t);
Expand All @@ -73,14 +73,14 @@ public function getUnionType(ReflectionUnionType $type): string
}

return self::getFqnType($t);
}, (array) $type->getTypes());
}, $type->getTypes());

return implode('|', $types);
}

private static function getFqnType(ReflectionNamedType $type): string
{
$isBuiltinOrSelf = $type->isBuiltin() || $type->getName() === 'self';
$isBuiltinOrSelf = $type->isBuiltin();

return $isBuiltinOrSelf ? $type->getName() : '\\' . $type->getName();
}
Expand Down

0 comments on commit 36dfc09

Please sign in to comment.