Suppress false-positive static analysis issues
MODIFY
psalm.xml
psalm.xml
</errorLevel>
</InvalidThrow>
+ <!-- suppress errors related to Symfony return types including enums -->
+ <UndefinedDocblockClass>
+ <errorLevel type="suppress">
+ <referencedClass name="UnitEnum" />
+ </errorLevel>
+ </UndefinedDocblockClass>
+
<!-- Suppress errors related to legacy PHPUnit classes -->
<UndefinedClass>
<errorLevel type="suppress">

MODIFY
src/Behat/Behat/Definition/Context/Attribute/DefinitionAttributeReader.php
src/Behat/Behat/Definition/Context/Attribute/DefinitionAttributeReader.php
@@ -58,6 +58,9 @@ final class DefinitionAttributeReader implements AttributeReader
return [];
}
+ /**
+ * @psalm-suppress UndefinedClass (ReflectionAttribute is PHP 8.0 only)
+ */
$attributes = $method->getAttributes(Definition::class, \ReflectionAttribute::IS_INSTANCEOF);
$callees = [];

MODIFY
src/Behat/Behat/Hook/Context/Attribute/HookAttributeReader.php
src/Behat/Behat/Hook/Context/Attribute/HookAttributeReader.php
@@ -59,6 +59,9 @@ final class HookAttributeReader implements AttributeReader
return [];
}
+ /**
+ * @psalm-suppress UndefinedClass (ReflectionAttribute is PHP 8.0 only)
+ */
$attributes = $method->getAttributes(Hook::class, \ReflectionAttribute::IS_INSTANCEOF);
$callees = [];

MODIFY
src/Behat/Testwork/Argument/MixedArgumentOrganiser.php
src/Behat/Testwork/Argument/MixedArgumentOrganiser.php
@@ -241,6 +241,9 @@ final class MixedArgumentOrganiser implements ArgumentOrganiser
$type = $parameter->getType();
+ /**
+ * @psalm-suppress UndefinedClass (ReflectionUnionType)
+ */
if ($type instanceof \ReflectionNamedType) {
$types = [$type];
}

MODIFY
src/Behat/Testwork/EventDispatcher/Cli/SigintController.php
src/Behat/Testwork/EventDispatcher/Cli/SigintController.php
@@ -55,6 +55,10 @@ final class SigintController implements Controller
{
if (function_exists('pcntl_signal')) {
pcntl_async_signals(true);
+
+ /**
+ * @psalm-suppress UndefinedConstant (SIGINT is defined in pcntl)
+ */
pcntl_signal(SIGINT, array($this, 'abortExercise'));
}
}

Suppress false-positive static analysis issues