Skip to content

Addressing PR comments#89

Merged
MekDrop merged 4 commits intomainfrom
claude/remove-icms-core-textsanitizer-stub
Apr 2, 2026
Merged

Addressing PR comments#89
MekDrop merged 4 commits intomainfrom
claude/remove-icms-core-textsanitizer-stub

Conversation

@Claude
Copy link
Copy Markdown
Contributor

@Claude Claude AI commented Apr 2, 2026

No description provided.

@Claude Claude AI assigned Claude and MekDrop Apr 2, 2026
@Claude Claude AI linked an issue Apr 2, 2026 that may be closed by this pull request
Following the same pattern as CensorStringInterface (PR #85), replace the
icms_core_Textsanitizer stub with a proper interface-based solution:

- Added TextSanitizerInterface for text sanitization functionality
- Added DefaultTextSanitizer as default implementation (pass-through)
- Updated ServiceLocator to register TextSanitizerInterface
- Modified StringType to use TextSanitizerInterface via ServiceLocator
- Removed icms_core_Textsanitizer class from legacy-stubs.php
- Kept phpstan-stubs.php for static analysis compatibility

Users can now configure their own text sanitizer by registering a custom
implementation with ServiceLocator, allowing integration with ImpressCMS
or other sanitization libraries.

Agent-Logs-Url: https://github.com/imponeer/properties/sessions/48caf56e-c644-4502-bd10-c59d175bbc3b

Co-authored-by: MekDrop <342641+MekDrop@users.noreply.github.com>
@Claude Claude AI changed the title [WIP] Remove icms_core_Textsanitizer stub Replace icms_core_Textsanitizer stub with configurable interface Apr 2, 2026
@Claude Claude AI requested a review from MekDrop April 2, 2026 11:03
Comment thread src/Contracts/TextSanitizerInterface.php Outdated
Comment thread src/Internal/DefaultTextSanitizer.php Outdated
Comment thread src/legacy-stubs.php Outdated
…ubs.php

- Renamed TextSanitizerInterface → TextDisplayFilterInterface (more descriptive)
- Changed to __invoke pattern (consistent with CensorStringInterface)
- Implemented proper default logic: HTML escaping and nl2br when html=0
- Deleted legacy-stubs.php completely (no longer needed)
- Updated composer.json to remove legacy-stubs.php from autoload files
- Updated phpcs.xml to remove legacy-stubs.php exclusion
- Updated all references in StringType and ServiceLocator

The interface now follows the same pattern as CensorStringInterface and
provides a basic but functional default implementation.

Agent-Logs-Url: https://github.com/imponeer/properties/sessions/a8e20bac-fdb2-48bc-bc77-25454b6c703a

Co-authored-by: MekDrop <342641+MekDrop@users.noreply.github.com>
@Claude Claude AI requested a review from MekDrop April 2, 2026 11:11
Comment thread src/Internal/DefaultTextDisplayFilter.php Outdated
Allow users to extend the class for partial functionality.
Updated docblock to clarify that the class can be extended.

Agent-Logs-Url: https://github.com/imponeer/properties/sessions/b3047197-9b8c-4c15-b65c-bc93633d2b43

Co-authored-by: MekDrop <342641+MekDrop@users.noreply.github.com>
@Claude Claude AI changed the title Replace icms_core_Textsanitizer stub with configurable interface Addressing PR comments Apr 2, 2026
@Claude Claude AI requested a review from MekDrop April 2, 2026 11:13
@MekDrop MekDrop marked this pull request as ready for review April 2, 2026 11:14
@MekDrop MekDrop merged commit d1a4f1b into main Apr 2, 2026
5 checks passed
@MekDrop MekDrop deleted the claude/remove-icms-core-textsanitizer-stub branch April 2, 2026 11:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Remove icms_core_Textsanitizer stub

2 participants