Psalm plugin that detects Be Framework runtime errors at static-analysis time.
A Being class constructor parameter that lacks both #[Input] (Ray\InputQuery\Attribute\Input) and #[Inject] (Ray\Di\Di\Inject). At runtime this raises Be\Framework\Exception\MissingParameterAttribute from BecomingArguments.
final readonly class WeightLogged
{
public function __construct(
#[Input] public string $recordedAt,
public StorageInterface $storage, // ← missing attribute, reported
) {}
}A class is treated as a Being when its constructor declares at least one #[Input] parameter.
A Being constructor parameter that carries both #[Input] and #[Inject]. At runtime this raises a conflict error from BecomingArguments.
public function __construct(
#[Input, Inject] public StorageInterface $storage, // ← reported
) {}A #[Validate] method that throws an exception not extending \DomainException. Be\Framework\SemanticVariable\SemanticValidator only catches DomainException, so other types silently bypass validation.
#[Validate]
public function validate(string $value): void
{
if ($value === '') {
throw new \RuntimeException('empty'); // ← reported
}
}Variable throws and ternary/match unions are resolved via Psalm's NodeTypeProvider. When the type cannot be resolved, the plugin stays silent (false-positive avoidance).
composer require --dev be-framework/psalm-pluginRegister the plugin in your psalm.xml:
<plugins>
<pluginClass class="Be\PsalmPlugin\Plugin" />
</plugins>Or use the Psalm plugin installer:
vendor/bin/psalm-plugin enable be-framework/psalm-plugin- PHP 8.3+
- Psalm 6.x
Standard Psalm suppression works at the class or method level:
/** @psalm-suppress MissingBeingParameterAttribute */
final readonly class IntentionallyLoose
{
// ...
}MIT