salient/phpstan

The PHPStan component of the Salient toolkit

v0.99.77 2025-03-03 13:59 UTC

README

The PHPStan component of the Salient toolkit

Latest Stable Version License CI Status Code Coverage

salient/phpstan provides PHPStan extensions for development with the Salient toolkit.

Extensions

Dynamic return type

Extension Method
ArrExtendReturnTypeExtension Arr::extend()
ArrFlattenReturnTypeExtension Arr::flatten()
ArrWhereNotEmptyReturnTypeExtension Arr::whereNotEmpty()
ArrWhereNotNullReturnTypeExtension Arr::whereNotNull()
GetCoalesceReturnTypeExtension Get::coalesce()
StrCoalesceReturnTypeExtension Str::coalesce()

Custom rule

Extension Description Error identifiers
ContainerRule Checks calls to ContainerInterface methods salient.service.type
GetCoalesceRule Checks for unnecessary use of Get::coalesce() salient.needless.coalesce
ImmutableTraitRule Checks calls to ImmutableTrait methods with() and without() salient.property.notFound
salient.property.private
salient.property.type

Always-read and written properties

Extension Description
ImmutableTraitReadWritePropertiesExtension Properties visible to ImmutableTrait methods are always read and written

Documentation

API documentation for salient/phpstan tracks the main branch of the toolkit's GitHub repository, where further documentation can also be found.