struggle-for-php/sfp-phpstan-psr-log
Extra strict and opinionated psr/log (psr-3) rules for PHPStan
1.1.0
365K downloads/mo
#4726 most downloaded on Packagist
struggle-for-php/sfp-phpstan-psr-log
What this package is like to depend on
Last release 2 months ago
28 May 2026
Ships fairly regularly
a new release about every 3 months
Some releases are documented
notes for 10 of 33 stable releases
Nothing withdrawn
no release was ever pulled
6 years old
33 releases · first in 2020
3 releases in the last 12 months
see the full history below
Release timeline
32 releases · Mar 2020 to May 2026Releases
latest 33-
1.1.028 May 2026Release notes
Open source →Release Notes for 1.1.0
This release includes fixes related to the Unsealed Array Shapes feature introduced in PHPStan 2.2.
For more information about Unsealed Array Shapes, please refer to the PHPStan article below:
https://phpstan.org/blog/phpstan-2-2-unsealed-array-shapes-safer-array-keysAs of this version (1.1.0), installation with PHPStan 2.1 is still supported;
however, we recommend upgrading to PHPStan 2.2.1.1.0
- Total issues resolved: 0
- Total pull requests resolved: 3
- Total contributors: 3
Improvements 🔧
-
101: Additional fixes related to #99(unsealed array support) thanks to @sasezaki
-
99: Return unsealed context shapes for PHPStan 2.2 compatibility thanks to @robotomarvin
-
98: Merge release 1.0.1 into 1.1.x thanks to @github-actions[bot]
-
1.0.109 Nov 2025Release notes
Open source →Release Notes for 1.0.1
1.0.x bugfix release (patch)
1.0.1
- Total issues resolved: 0
- Total pull requests resolved: 1
- Total contributors: 1
Bugfixes 🐛
-
1.0.008 Nov 2025Release notes
Open source →Release Notes for 1.0.0
Backwards incompatible release (major)
UPGRADING guide
composer require --dev struggle-for-php/sfp-phpstan-psr-log:^1
- Since version 1,
struggle-for-php/sfp-stubs-psr-logis no longer requried.
If you already installed 0.* version, please remove extension.neon line from your
phpstan.neonconfig.- - vendor/struggle-for-php/sfp-phpstan-psr-log/extension.neonPHP, PHPStan version requirements
- requires PHP 7.4 or newer to run
- dropped support for PHP 7.2, 7.3
- requires PHPStan
2.1.23or newer- dropped support for PHPStan 1.12
End User impacted changes
- Removed stub dependency - Removed struggle-for-php/sfp-stubs-psr-log from composer.json and all references to extension.neon
- Changed default configuration - In rules.neon
- enableLogMethodLevelRule: false → true
- enableContextTypeRule: false → true
So, this changes will affect error message & error identifier
Before
------ ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Line Example.php ------ ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 26 Parameter #2 $context of method Psr\Log\LoggerInterface::notice() expects array{exception?: Throwable}, array{exception: string} given. 🪪 argument.type 💡 Offset 'exception' (Throwable) does not accept type string. 27 Parameter #1 $level of method Psr\Log\LoggerInterface::log() expects 'alert'|'critical'|'debug'|'emergency'|'error'|'info'|'notice'|'warning', 'panic' given. 🪪 argument.typeAfter
------ ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Line Example.php ------ ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 26 Parameter #2 $context of method Psr\Log\LoggerInterface::notice() expects array{exception?: Throwable}, array{exception: string} given. 🪪 sfpPsrLog.contextType 💡 Offset 'exception' (Throwable) does not accept type string. 27 Parameter #1 $level of method Psr\Log\LoggerInterface::log() expects ('alert' | 'critical' | 'debug' | 'emergency' | 'error' | 'info' | 'notice' | 'warning'), 'panic' given. 🪪 sfpPsrLog.logMethodLevel1.0.0
- Total issues resolved: 1
- Total pull requests resolved: 8
- Total contributors: 2
Improvements 🔧
- 96: docs: Document ContextTypeRule and LogMethodLevelRule in README thanks to @sasezaki
- 95: Removed extension.neon thanks to @sasezaki
- 92: Rename phpstan-type-mapping-from-bigquery to
sfp-phpstan-psr-log-bigquery-schema-convertthanks to @sasezaki - 89: Add support for PHP 8.5 (drop support PHP 7.2, 7.3) thanks to @sasezaki
Internals 🔍
- 94: Refactor to use acceptsReasonsTip() for consistent error message handling thanks to @sasezaki
- 91: Missing add psalm.xml thanks to @sasezaki
- 90: Update codebase to PHP 7.4 thanks to @sasezaki
Major new features 🚀
- Since version 1,
-
0.24.024 Apr 2025Release notes
Open source →Release Notes for 0.24.0
Important
include psr/log stub be planned to dropped in comming release.
To try out the changes in the comming version,
DELETE
vendor/struggle-for-php/sfp-phpstan-psr-log/extension.neonline from yourphpstan.neonincludes: - vendor/struggle-for-php/sfp-phpstan-psr-log/extension.neon
and, set parameters
enableLogMethodLevelRuleandenableContextTypeRuleparameters: sfpPsrLog: enableLogMethodLevelRule: true # default:false enableContextTypeRule: true # default:false
0.24.0
- Total issues resolved: 0
- Total pull requests resolved: 3
- Total contributors: 1
Improvements 🔧
Major new features 🚀
-
0.23.011 Nov 2024Release notes
Open source →Release Notes for 0.23.0
Feature release (minor)
0.23.0
- Total issues resolved: 0
- Total pull requests resolved: 1
- Total contributors: 1
Improvements 🔧
- 85: Support PHPStan 2 thanks to @sasezaki
-
0.22.025 Sep 2024Release notes
Open source →Release Notes for 0.22.0
Feature release (minor)
0.22.0
- Total issues resolved: 0
- Total pull requests resolved: 1
- Total contributors: 1
enhancement
- 84: Add support for PHP 8.4 thanks to @sasezaki
-
0.21.013 May 2024Release notes
Open source →Release Notes for 0.21.0
This release is aimed to support PHPStan 1.11.
If you use struggle-for-php/sfp-phpstan-psr-log 0.20 or under with phpstan 1.11, would be met identifier error. So please update phpstan to 1.11 & struggle-for-php/sfp-phpstan-psr-log to 0.21.0.21.0
- Total issues resolved: 0
- Total pull requests resolved: 2
- Total contributors: 1
Bugfixes 🐛
Internals 🔍
- 80: Refactor around test case thanks to @sasezaki
-
0.20.010 Feb 2024Release notes
Open source →Release Notes for 0.20.0
Important
Since
0.20.0, changed default rule settings.- MessageStaticStringRule is enabled by default.
- ContextRequireExceptionKeyRule is disabled by default.
see #71
Feature release (minor)
0.20.0
- Total issues resolved: 0
- Total pull requests resolved: 4
- Total contributors: 1
Internals 🔍
- 79: Use phpstan-strict-rules thanks to @sasezaki
Bugfixes 🐛
-
78: missing export-ignore for psalm-baseline.xml thanks to @sasezaki
-
76: merge 0.19.x thanks to @sasezaki
Major new features 🚀
- 72: Change default enable rules thanks to @sasezaki
-
0.19.103 Feb 2024Release notes
Open source →Release Notes for 0.19.1
0.19.x bugfix release (patch)
0.19.1
- Total issues resolved: 0
- Total pull requests resolved: 1
- Total contributors: 1
Bugfixes 🐛
-
0.19.003 Feb 2024Release notes
Open source →Important
It is planned to change default rule settings.
- MessageStaticStringRule would be enabled by default.
- ContextRequireExceptionKeyRule would be disabled by default.
Recommendation
- write these parameters to your project's
phpstan.neon
parameters: sfpPsrLog: enableMessageStaticStringRule: true enableContextRequireExceptionKeyRule: true reportContextExceptionLogLevel: 'info' contextKeyOriginalPattern: '#\A[A-Za-z0-9-_]+\z#'
see #71
Release Notes for 0.19.0
Feature release (minor)
0.19.0
- Total issues resolved: 0
- Total pull requests resolved: 5
- Total contributors: 1
Internals 🔍
- 74: Enable phpstan bleedingEdge thanks to @sasezaki
- 69: Add
.editorconfigas export-ignore thanks to @sasezaki
Bugfixes 🐛
Improvements 🔧
-
0.18.006 Nov 2023Nothing published for this version
-
0.17.015 Oct 2023Nothing published for this version
-
0.16.114 Oct 2023Nothing published for this version
-
0.16.014 Oct 2023Nothing published for this version
-
0.15.014 Oct 2023Nothing published for this version
-
0.14.018 Sep 2023Nothing published for this version
-
0.13.028 May 2023Nothing published for this version
-
0.12.018 May 2023Nothing published for this version
-
0.11.101 May 2023Nothing published for this version
-
0.11.001 May 2023Nothing published for this version
-
0.10.030 Apr 2023Nothing published for this version
-
0.9.030 Apr 2023Nothing published for this version
-
0.8.009 Apr 2023Nothing published for this version
-
0.7.025 Mar 2023Nothing published for this version
-
0.6.122 Mar 2023Nothing published for this version
-
0.6.021 Mar 2023Nothing published for this version
-
0.5.121 Mar 2023Nothing published for this version
-
0.5.021 Mar 2023Nothing published for this version
-
0.4.021 Mar 2023Nothing published for this version
-
0.3.0no dateNothing published for this version
-
0.2.029 Apr 2020Nothing published for this version
-
0.1.315 Mar 2020Nothing published for this version
-
0.1.114 Mar 2020Nothing published for this version