Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Phpstan Rules Laravel Package

shipmonk/phpstan-rules

ShipMonk PHPStan strict rules adds about 40 opinionated, super-strict checks beyond native PHPStan, targeting gaps like unsafe comparisons, casts, and array keys. Install via Composer, include rules.neon, and disable or reconfigure any rule per project.

View on GitHub
Deep Wiki
Context7
4.4.1

Fixes:

  • forbidCheckedExceptionInCallable: resolve static call caller type from expressions (#368, @maryo)
  • requirePreviousExceptionPass: accept exception passed to nested call (#369)
4.4.0

New features

  • allowComparingOnlyComparableTypes: add support for BcMath\Number (#360)

Internal:

Dependencies

  • Requires PHP 8.1+ (#361)
4.3.7

Fixes:

  • forbidVariableTypeOverwriting: fix false positive with fluent $this returns (#350)
  • forbidUnusedException & forbidUnusedMatchResult support remaining edge cases like string concat (#353)
  • forbidUselessNullableReturn: fix false positive with property hooks (https://github.com/shipmonk-rnd/phpstan-rules/pull/355)
4.3.6

Fixes:

  • forbidCheckedExceptionInYieldingMethod: support functions and (immediately-invoked) closures (#345)
  • Add composer.lock to export-ignore (#344)
4.3.5

Fixes:

  • forbidCheckedExceptionInCallable: fix reported file for traits (#342)
4.3.4

Fixes:

  • No crash or false-positives when running with fibers-based PHPStan 2.1.34+ (#340, #337)
4.3.3

Fixes:

4.3.2

Fixes:

  • enforceReadonlyPublicProperty: skip untyped props + add excludePropertyWithDefaultValue option (#334, @devfrey)
4.3.1

Fixes:

enforceReadonlyPublicProperty: skip static properties (#333, @devfrey)

4.3.0

Improvements:

  • enforceReadonlyPublicProperty support asymmetric visibility (#331, @JanTvrdik)
  • forbidArithmeticOperationOnNonNumber add support for BcMath\Number (#321, @JokubasR)

Fixes:

  • enforceNativeReturnTypehint fix false positive for unions with template type (#325, @mspirkov)
  • forbidPhpDocNullabilityMismatchWithNativeTypehint: ignore void methods (#328, @mspirkov)

Dependencies:

  • phpstan/phpstan now requires ^2.1.32 (#331)
4.2.1

Fixes:

  • forbidUselessNullableReturn: no error for overridable methods (#314 by @vrana)
4.2.0

New features:

  • forbidUnusedClosureParameters: report unused trailing params for closures and array functions (#313)
4.1.5

Fixes:

  • enforceNativeReturnTypehint: fix property hook false positive (#309)
4.1.4

Fixes:

  • forbidUnusedMatchResult: fix false positive for usage in arrow function (#305, @maryo)
4.1.3

Fixes:

  • enforceReadonlyPublicProperty: fix false positive with hooked properties (#303)
4.1.2

Fixes:

  • forbidUnusedException: fix ->getException()::class false positive (#299)
4.1.1

Fixes:

  • forbidCast: fix custom blacklist configuration (#297, @forrest79)

Dependencies

  • phpstan/phpstan requires ^2.1.8 (#296)
4.1.0

New features:

  • forbidCustomFunctions now detects even fist class callables, anonymous classes and array/string callables in arguments (#288)
    • e.g. new class extends DeniedParent {}
    • e.g. $this->deniedMethod(...)
    • e.g. array_map([$this, 'deniedMethod'], $a)
    • e.g. array_map('denied_function', $a)
4.0.0

Breaking changes:

  • Dropped uselessPrivatePropertyNullability as it got implemented in native PHPStan (#283)
  • Shrunk function list in forbidEnumInFunctionArguments as most of them are detected by native PHPStan (#278)

Dependencies

  • phpstan/phpstan now requires 2.0.0 (#274)
3.2.1

Fixes:

  • Fix reflection error on unknown symbols (#273)

Dependencies:

  • phpstan/phpstan now requires 1.12.5 (was 1.11.0) (#272)
3.2.0

New features:

  • Ease enabling rules one-by-one (#260)
parameters:
    shipmonkRules:
        enableAllRules: false

        allowComparingOnlyComparableTypes:
            enabled: true
3.1.0

New features:

3.0.0

Breaking changes:

  • forbidAssignmentNotMatchingVarDoc: removed as there is better native replacement when bleedingEdge is enabled (#238)
  • allowNamedArgumentOnlyInAttributes: removed as it was highly opinionated and did not provide any extra strictness (#238)
  • forbidCheckedExceptionInCallable: removed config immediatelyCalledCallables (we now respect native [@param-immediately-invoked-callable](https://github.com/param-immediately-invoked-callable), see docs) (#240)
  • forbidReturnValueInYieldingMethod: option reportRegardlessOfReturnType is now true by default

Improvements

  • All rules accepting classnames in its config checks class existence

Dependencies

  • phpstan/phpstan now requires at least 1.11.0 (was 1.10.51)
    • 1.11.0 comes with error identifiers (which we support since 2.10.0)
2.12.0

New features

  • forbidNotNormalizedType: check invalid Parent|Child even in multi-catch and [@throws](https://github.com/throws) (#231, #232)
2.11.3

Fixes

Dependencies

  • remove nikic/php-parser requirement (#222)
    • it is bundled inside PHPStan's phar anyway
2.11.2

Fixes

  • Fix compatibility with PHPStan >=1.10.51 (#206)

Dependencies

  • phpstan/phpstan now requires at least 1.10.51 (was 1.10.30) (#206)
2.11.1

Fixes:

  • forbidEnumInFunctionArguments:
    • allow array_unique($enums, SORT_REGULAR) (#196)
    • deny also natcasesort (#197)
2.11.0

New features:

2.10.2

Fixes:

2.10.1

Fixes

  • allowComparingOnlyComparableTypes: allow safe tuple comparison (lists of equal size & item types) (#182)
    • example: usort($items, fn ($a, $b) => [$a->updatedAt, $a->id] <=> [$b->updatedAt, $b->id])
2.10.0

New features

2.9.2

Fixes

  • forbidUnusedMatchResult: fix false positive with assign operators, += etc (#171)
2.9.1

Fixes

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
ippanelcom/laravel-sdk
adachsoft/changelog-linter
adachsoft/collection
payerurl/telegrambot-crypto-payment-instant-payout
dskripchenko/laravel-hybrid-search
riorizkyrainey/lara-ced
mehedimi/static-vel
zharp/zharp
nonsapiens/bigquery-model-sync
lgu-bayambang-ict-office/lgu-laravel-development-standards
andydefer/laravel-support
se7enxweb/flysystem
lampwick/laravel
jeslage/statamic-emojis
micahdshackelford/rmap-laravel
draftsmaninc/draftsman
square-bit/laravel-volition
himito/laravel-mailman
htinlynn/genius-helper
maco-studios/hephaestus