Skip to content

Conversation

@Steveb-p
Copy link
Contributor

@Steveb-p Steveb-p commented Oct 22, 2025

Caution

Fast forward (or rebase) merge

🎫 Issue IBX-10840

Description:

This PR fixes missing logger in ImageExtension by adding LoggerAwareInterface.

Additionally, it enables repository-wide check against dynamic property use by enabling checkDynamicProperties in PHPStan. This uncovered other places where property was missing (mostly tests though), and where property accessed was done on invalid assumptions (some phpdocs have been corrected).

For QA:

Documentation:

@Steveb-p Steveb-p marked this pull request as ready for review October 22, 2025 11:38
@Steveb-p Steveb-p requested review from a team and Copilot October 22, 2025 11:38
@Steveb-p Steveb-p added Bug Something isn't working Ready for review labels Oct 22, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes a missing logger in ImageExtension by implementing LoggerAwareInterface and enabling repository-wide PHPStan checks for dynamic properties via checkDynamicProperties: true. This stricter analysis revealed several undeclared properties in tests and incorrect PHPDoc type hints in production code.

Key Changes:

  • Added logger support to ImageExtension class using LoggerAwareInterface and LoggerAwareTrait
  • Enabled checkDynamicProperties in PHPStan configuration to catch dynamic property usage
  • Corrected PHPDoc type hints in multiple field type classes to accurately reflect parameter types

Reviewed Changes

Copilot reviewed 23 out of 23 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/lib/MVC/Symfony/Templating/Twig/Extension/ImageExtension.php Added LoggerAwareInterface implementation with LoggerAwareTrait
src/bundle/Core/Resources/config/templating.yml Configured logger injection for ImageExtension service
phpstan.neon.dist Enabled checkDynamicProperties check
phpstan-baseline.neon Updated baseline to reflect resolved and new PHPStan issues
tests/lib/FieldType/Url/Gateway/DoctrineStorageTest.php Declared $storageGateway property and refactored getter using null coalescing assignment
tests/lib/FieldType/ImageTest.php Declared $mimeTypeDetectorMock property and refactored getter using null coalescing assignment
tests/lib/Repository/Values/User/UserTest.php Added PHPStan ignore comment for intentional invalid property access test
tests/lib/Repository/Values/User/UserGroupTest.php Added PHPStan ignore comment for intentional invalid property access test
tests/lib/Repository/Values/User/RoleTest.php Added PHPStan ignore comment for intentional invalid property access test
tests/lib/Repository/Values/User/PolicyTest.php Added PHPStan ignore comment for intentional invalid property access test
tests/lib/Repository/Values/ObjectState/ObjectStateTest.php Added PHPStan ignore comment for intentional invalid property access test
tests/lib/Repository/Values/ObjectState/ObjectStateGroupTest.php Added PHPStan ignore comment for intentional invalid property access test
tests/lib/Repository/Values/Content/TrashItemTest.php Added PHPStan ignore comment for intentional invalid property access test
tests/lib/Repository/Values/Content/SectionTest.php Added PHPStan ignore comment for intentional invalid property access test
tests/lib/Repository/Values/Content/LocationTest.php Added PHPStan ignore comment for intentional invalid property access test
tests/lib/Repository/Values/Content/LanguageTest.php Added PHPStan ignore comment for intentional invalid property access test
src/lib/FieldType/Validator/ImageValidator.php Corrected PHPDoc to specify concrete Value parameter type
src/lib/FieldType/Selection/Type.php Removed redundant union type from PHPDoc
src/lib/FieldType/RelationList/Type.php Removed redundant union type from PHPDoc
src/lib/FieldType/Relation/Type.php Removed redundant union type from PHPDoc
src/lib/FieldType/ImageAsset/Type.php Removed redundant union type from PHPDoc
src/lib/FieldType/BinaryBase/Type.php Removed redundant union type from PHPDoc
src/lib/FieldType/Author/Type.php Added PHPDoc to getName() and corrected PHPDoc for getSortInfo()

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@Steveb-p Steveb-p force-pushed the ibx-10840/fixed-missing-logger branch from c4183ec to 7e97871 Compare October 22, 2025 12:02
@sonarqubecloud
Copy link

@Steveb-p Steveb-p requested review from alongosz and Copilot October 22, 2025 13:19
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 23 out of 23 changed files in this pull request and generated no new comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@alongosz alongosz added the Fast-forward merge PR should be merged in a fast-forward way label Oct 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something isn't working Fast-forward merge PR should be merged in a fast-forward way Ready for QA Ready for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants