Skip to content

Changed default as true - enableLogMethodLevelRule, enableContextTypeRule#93

Merged
sasezaki merged 5 commits intostruggle-for-php:1.0.xfrom
sasezaki:default-enable-changes-insteadof-stub
Oct 19, 2025
Merged

Changed default as true - enableLogMethodLevelRule, enableContextTypeRule#93
sasezaki merged 5 commits intostruggle-for-php:1.0.xfrom
sasezaki:default-enable-changes-insteadof-stub

Conversation

@sasezaki
Copy link
Copy Markdown
Member

@sasezaki sasezaki commented Oct 19, 2025


  • 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
  • Improved error messages - In ContextTypeRule.php:93-106, added tips (reasons) to type error messages
  • Cleaned up README - Removed 37-line stub-related documentation section for simpler documentation

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.type

After

 ------ -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  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.logMethodLevel

@sasezaki sasezaki self-assigned this Oct 19, 2025
@sasezaki sasezaki changed the title Changed default as true - enableLogMethodLevelRule, enableContextType… Changed default as true - enableLogMethodLevelRule, enableContextTypeRule Oct 19, 2025
@sasezaki sasezaki changed the title Changed default as true - enableLogMethodLevelRule, enableContextTypeRule Changed default as true - enableLogMethodLevelRule, enableContextTypeRule Oct 19, 2025
@sasezaki sasezaki added this to the 1.0.0 milestone Oct 19, 2025
@sasezaki sasezaki merged commit ebe1946 into struggle-for-php:1.0.x Oct 19, 2025
24 checks passed
@sasezaki sasezaki mentioned this pull request Oct 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error on analyse reported in struggle-for-php/sfp-stubs-psr-log/stubs-for-throwable/LoggerInterface.phpstub

1 participant