Skip to content

feat: add TYPO3-specific PSR and factory patterns reference#21

Merged
CybotTM merged 2 commits intomainfrom
feature/add-typo3-psr-patterns
Mar 27, 2026
Merged

feat: add TYPO3-specific PSR and factory patterns reference#21
CybotTM merged 2 commits intomainfrom
feature/add-typo3-psr-patterns

Conversation

@CybotTM
Copy link
Copy Markdown
Member

@CybotTM CybotTM commented Mar 27, 2026

Summary

  • Add reference typo3-psr-patterns.md with TYPO3-specific implementations of:
    • PSR-3 LoggerAwareInterface with NullLogger default and getLogger() helper
    • PSR-14 event dispatch with try/catch error guard
    • Factory pattern with Imagick/GD capability fallback
    • Services.yaml factory wiring pattern
    • ProcessorInterface for middleware decoupling
    • PHPStan baseline management (target: empty)
  • Add checkpoints PM-26 through PM-28 for automated TYPO3 PSR compliance assessment
  • Update SKILL.md with TYPO3-specific patterns section

Context

During t3x-nr-image-optimize development, these PHP patterns were established but the php-modernization skill only covered generic PSR patterns, not TYPO3-specific implementations.

Test plan

  • Verify reference document is valid markdown
  • Verify code examples compile
  • Verify patterns match established TYPO3 conventions
  • Verify checkpoints PM-26 through PM-28 are valid YAML and follow existing schema

Add reference: typo3-psr-patterns.md covering:
- PSR-3 LoggerAwareInterface with NullLogger default
- PSR-14 event dispatch with try/catch guard
- Factory pattern with Imagick/GD capability fallback
- Services.yaml factory wiring
- ProcessorInterface for middleware decoupling
- PHPStan baseline management practices

Add checkpoints PM-26 through PM-28 for TYPO3-specific PSR compliance.
Update SKILL.md with TYPO3-specific patterns section.

Patterns established during t3x-nr-image-optimize session.
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces TYPO3-specific PSR patterns and modernization guidelines, adding a new reference document and validation checkpoints for PSR-3 logging, PSR-14 event dispatching, and factory patterns. The feedback suggests clarifying the role of external classes in the factory pattern examples to improve documentation completeness.

Comment thread skills/php-modernization/references/typo3-psr-patterns.md
@CybotTM CybotTM enabled auto-merge March 27, 2026 15:30
Fix ImagickDriver/GdDriver to use proper Intervention\Image\Drivers FQCNs
Add missing use statements to PSR-14 and ProcessorInterface examples
Clarify ProcessorInterface is HTTP-specific, note domain alternative
Add PHPStan explanation for getLogger() null coalescing
@CybotTM CybotTM merged commit 9cbeefe into main Mar 27, 2026
5 checks passed
@CybotTM CybotTM deleted the feature/add-typo3-psr-patterns branch March 27, 2026 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant