Skip to content

Commit 0e8fa09

Browse files
Fix PHPstan
1 parent 6ac58f2 commit 0e8fa09

File tree

4 files changed

+1
-13
lines changed

4 files changed

+1
-13
lines changed

phpstan.neon.dist

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,3 @@ parameters:
77
- src
88
tmpDir: build/phpstan
99
reportUnmatchedIgnoredErrors: true
10-
checkMissingIterableValueType: true

src/Transformers/EnumTransformer.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,6 @@ public function __construct(protected TypeScriptTransformerConfig $config)
1616

1717
public function transform(ReflectionClass $class, string $name): ?TransformedType
1818
{
19-
// If we're not on PHP >= 8.1, we don't support native enums.
20-
if (! method_exists($class, 'isEnum')) {
21-
return null;
22-
}
23-
2419
if (! $class->isEnum()) {
2520
return null;
2621
}

tests/Collectors/EnumCollectorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@
2323
"'foo' | 'bar'",
2424
$transformedType->transformed,
2525
);
26-
})->skip(version_compare(PHP_VERSION, '8.1', '<'), 'Enums are a PHP 8.1+ feature.');
26+
});

tests/Transformers/EnumTransformerTest.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,6 @@
1515
use Spatie\TypeScriptTransformer\TypeScriptTransformerConfig;
1616
use UnitEnum;
1717

18-
beforeEach(function () {
19-
if (\PHP_VERSION_ID < 80100) {
20-
test()->markTestSkipped('Native enums not supported before PHP 8.1');
21-
}
22-
});
23-
2418
it('will only convert enums', function () {
2519
$transformer = new EnumTransformer(
2620
TypeScriptTransformerConfig::create()->transformToNativeEnums(false)

0 commit comments

Comments
 (0)