PackageTrack
Sign in Get early access

thecodingmachine/phpstan-safe-rule

A PHPStan rule to detect safety issues. Must be used in conjunction with thecodingmachine/safe

v1.4.7 11M downloads/mo #1684 most downloaded on Packagist thecodingmachine/phpstan-safe-rule

What this package is like to depend on

Last release 2 months ago

21 Jun 2026

Ships unpredictably

gaps range from 4 weeks to 2.9 years

Some releases are documented

notes for 8 of 17 stable releases

Nothing withdrawn

no release was ever pulled

8 years old

18 releases · first in 2018

3 releases in the last 12 months

see the full history below

Release timeline

18 releases · Sep 2018 to Jun 2026
2019 2020 2021 2022 2023 2024 2025 2026
Release Pre-release

Releases

latest 18
  1. v1.4.7 21 Jun 2026
    Release notes

    What's Changed

    • ReplaceSafeFunctionsDynamicReturnTypeExtension: fix typo by @staabm in #71

    Full Changelog: v.1.4.5...v1.4.7

    Open source →
  2. v1.4.4 21 Jun 2026
    Release notes

    What's Changed

    • Sync preg_match extensions with PHPStan upstream + expose identity-check narrowing bug by @mvhirsch in #65
    • work on fixing CI, fixes #66 by @shish in #67
    • Improve ReplaceSafeFunctions type inference by @staabm in #70

    New Contributors

    Full Changelog: v1.4.3...v1.4.4

    Open source →
  3. v1.4.3 21 Nov 2025
    Release notes

    What's Changed

    Full Changelog: v1.4.2...v1.4.3

    Open source →
  4. v1.4.2 17 Aug 2025
    Release notes

    What's Changed

    • feat: infer preg_replace_callback return type by @mRoca in #60
    • Add json decode return type extension by @Khartir in #61

    New Contributors

    Full Changelog: v1.4.1...v1.4.2

    Open source →
  5. v1.4.1 09 Apr 2025
    Release notes

    What's Changed

    • Consider named argument flags: JSON_THROW_ON_ERROR for json_ functions as "Safe" by @shish in #56
    • Fix tests with latest dependencies by @spawnia in #59
    • Handle FuncCall nodes that represent first class callables by @spawnia in #32

    New Contributors

    Full Changelog: v1.4.0...v1.4.1

    Open source →
  6. v1.4.0 11 Feb 2025
    Release notes

    What's Changed (tl;dr)

    • Drop support for EOL'ed PHP versions - 8.1 is the new minimum
    • Fix "unsafe function" error ID code
    • Port phpstan's special-case support for preg_match so that it also applies to Safe\preg_match (ie, the $matches array is now accurately typed to match the regex pattern used, rather than being a generic ?array)

    What's Changed (Full)

    • flag this rule as compatible with thecodingmachine/safe v3 by @shish in #39
    • fix error identifier by @shish in #41
    • add composer test command by @shish in #42
    • drop support for long-dead php versions by @shish in #44
    • Type hints for Safe\preg_match, fixes #40 by @shish in #43
    • enable formatting in tests/ by @shish in #45
    • additional magic for preg_match, fixes #46 by @shish in #47
    • consistently use phpstan's testing framework to test phpstan bits by @shish in #48
    • More formatting by @shish in #50
    • Require safe ^1.2 by @shish in #51
    • Bump phpunit to be less-deprecated by @shish in #49

    New Contributors

    • @shish made their first contribution in #39

    Full Changelog: v1.3.1...v1.4.0

    Open source →
  7. v1.3.1 09 Feb 2025
    Release notes

    Same as v1.3.0, but marked compatible with Safe v3.0.0

    Open source →
  8. v1.3.0 02 Dec 2024
    Release notes

    What's Changed

    This new release brings support for PHPStan 2.0 (and drops support for PHPStan 1.0)

    New Contributors

    Full Changelog: v1.2.0...v1.3.0

    Open source →
  9. v1.2.0 17 Jan 2022

    Nothing published for this version

  10. v1.1.0 17 Nov 2021

    Nothing published for this version

  11. v1.0.1 30 Aug 2020

    Nothing published for this version

  12. v1.0.0 02 Jan 2020

    Nothing published for this version

  13. v1.0.0-beta1 04 Dec 2019 pre-release

    Nothing published for this version

  14. v0.1.4 15 Jul 2019

    Nothing published for this version

  15. v0.1.3 07 Mar 2019

    Nothing published for this version

  16. v0.1.2 21 Jan 2019

    Nothing published for this version

  17. v0.1.1 18 Jan 2019

    Nothing published for this version

  18. v0.1.0 06 Sep 2018

    Nothing published for this version

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive