Skip to content

Conversation

Copy link

Copilot AI commented Jan 6, 2026

  • Understand the issue with overlapping extensions in renderer selection
  • Sort renderer extensions by length in descending order before matching
  • Add test to verify longer extensions are matched first
  • Optimize sorting to happen once when renderers are set, not on every render
  • Fix test to implement TemplateRendererInterface instead of extending final class
  • Optimize test to reuse PhpTemplateRenderer instance
  • Run final code review and security checks

Summary

This PR successfully addresses the feedback about renderer selection with overlapping extensions. All changes have been implemented and validated:

  1. Predictable behavior: Longer, more specific extensions (like "blade.php") are always matched before shorter ones (like "php"), regardless of registration order.

  2. Efficient implementation: Sorting happens once when renderers are set via withRenderers(), not on every render call.

  3. Test coverage: Added testOverlappingExtensionRendererPriority() to verify the correct behavior when multiple renderers with overlapping extensions are registered. The test properly implements TemplateRendererInterface and efficiently reuses a single PhpTemplateRenderer instance.

  4. Fixed fatal error: Changed test from extending the final PhpTemplateRenderer class to implementing TemplateRendererInterface directly.

The implementation uses uksort() to sort renderer extensions by length in descending order in the withRenderers() method, ensuring both correctness and performance.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits January 6, 2026 06:21
Co-authored-by: samdark <47294+samdark@users.noreply.github.com>
…nder

Co-authored-by: samdark <47294+samdark@users.noreply.github.com>
Copy link
Author

Copilot AI commented Jan 6, 2026

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/azjezz/psl/zipball/15153a64c9824335ce11654522e7d88de762d39e
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/eEdUTs /usr/bin/composer install --no-interaction --prefer-dist (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/Wrtmes /usr/bin/composer install --no-interaction rgo/bin/git -&#39; &#39;https://githgit --fix-thin nfig/composer/ve-r git rev-�� --quiet --verify dfc3aa0d^{commit} --quiet --verify om/symfony/servi--no-checkout git (http block)
  • https://api.github.com/repos/bamarni/composer-bin-plugin/zipball/e7ef9e012667327516c24e5fad9903a3bc91389d
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/eEdUTs /usr/bin/composer install --no-interaction --prefer-dist (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/Wrtmes /usr/bin/composer install --no-interaction rgo/bin/git -&#39; &#39;https://githgit --fix-thin nfig/composer/ve-r git rev-�� --quiet --verify dfc3aa0d^{commit} --quiet --verify om/symfony/servi--no-checkout git (http block)
  • https://api.github.com/repos/clue/reactphp-stdio/zipball/dfa6c378aabdff718202d4e2453f752c38ea3399
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/Wrtmes /usr/bin/composer install --no-interaction rgo/bin/git -&#39; &#39;https://githgit --fix-thin nfig/composer/ve-r git rev-�� --quiet --verify dfc3aa0d^{commit} --quiet --verify om/symfony/servi--no-checkout git (http block)
  • https://api.github.com/repos/clue/reactphp-term/zipball/00f297dc597eaee2ebf98af8f27cca5d21d60fa3
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/eEdUTs /usr/bin/composer install --no-interaction --prefer-dist (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/Wrtmes /usr/bin/composer install --no-interaction rgo/bin/git -&#39; &#39;https://githgit --fix-thin nfig/composer/ve-r git rev-�� --quiet --verify dfc3aa0d^{commit} --quiet --verify om/symfony/servi--no-checkout git (http block)
  • https://api.github.com/repos/clue/reactphp-utf8/zipball/d5cd04d39cb5457aa5df830b7c4b301d2694217e
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/eEdUTs /usr/bin/composer install --no-interaction --prefer-dist (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/Wrtmes /usr/bin/composer install --no-interaction rgo/bin/git -&#39; &#39;https://githgit --fix-thin nfig/composer/ve-r git rev-�� --quiet --verify dfc3aa0d^{commit} --quiet --verify om/symfony/servi--no-checkout git (http block)
  • https://api.github.com/repos/igorw/evenement/zipball/0a16b0d71ab13284339abb99d9d2bd813640efbc
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/eEdUTs /usr/bin/composer install --no-interaction --prefer-dist (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/Wrtmes /usr/bin/composer install --no-interaction rgo/bin/git -&#39; &#39;https://githgit --fix-thin nfig/composer/ve-r git rev-�� --quiet --verify dfc3aa0d^{commit} --quiet --verify om/symfony/servi--no-checkout git (http block)
  • https://api.github.com/repos/jolicode/JoliNotif/zipball/7083df4c4dc614f20bf16dc3ad53f705460bd1dd
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/Wrtmes /usr/bin/composer install --no-interaction rgo/bin/git -&#39; &#39;https://githgit --fix-thin nfig/composer/ve-r git rev-�� --quiet --verify dfc3aa0d^{commit} --quiet --verify om/symfony/servi--no-checkout git (http block)
  • https://api.github.com/repos/jolicode/php-os-helper/zipball/e71596ae67d477fe214a5908f5522b9e4d19fd37
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/eEdUTs /usr/bin/composer install --no-interaction --prefer-dist (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/Wrtmes /usr/bin/composer install --no-interaction rgo/bin/git -&#39; &#39;https://githgit --fix-thin nfig/composer/ve-r git rev-�� --quiet --verify dfc3aa0d^{commit} --quiet --verify om/symfony/servi--no-checkout git (http block)
  • https://api.github.com/repos/maglnet/ComposerRequireChecker/zipball/c62d517ef5ac2d347dd9b3d02c1cc16c0f1091e2
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/eEdUTs /usr/bin/composer install --no-interaction --prefer-dist (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/Wrtmes /usr/bin/composer install --no-interaction rgo/bin/git -&#39; &#39;https://githgit --fix-thin nfig/composer/ve-r git rev-�� --quiet --verify dfc3aa0d^{commit} --quiet --verify om/symfony/servi--no-checkout git (http block)
  • https://api.github.com/repos/myclabs/DeepCopy/zipball/07d290f0c47959fd5eed98c95ee5602db07e0b6a
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/Wrtmes /usr/bin/composer install --no-interaction rgo/bin/git -&#39; &#39;https://githgit --fix-thin nfig/composer/ve-r git rev-�� --quiet --verify dfc3aa0d^{commit} --quiet --verify om/symfony/servi--no-checkout git (http block)
  • https://api.github.com/repos/nikic/PHP-Parser/zipball/dca41cd15c2ac9d055ad70dbfd011130757d1f82
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/eEdUTs /usr/bin/composer install --no-interaction --prefer-dist (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/Wrtmes /usr/bin/composer install --no-interaction rgo/bin/git -&#39; &#39;https://githgit --fix-thin nfig/composer/ve-r git rev-�� --quiet --verify dfc3aa0d^{commit} --quiet --verify om/symfony/servi--no-checkout git (http block)
  • https://api.github.com/repos/phar-io/manifest/zipball/54750ef60c58e43759730615a392c31c80e23176
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/Wrtmes /usr/bin/composer install --no-interaction rgo/bin/git -&#39; &#39;https://githgit --fix-thin nfig/composer/ve-r git rev-�� --quiet --verify dfc3aa0d^{commit} --quiet --verify om/symfony/servi--no-checkout git (http block)
  • https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/Wrtmes /usr/bin/composer install --no-interaction rgo/bin/git -&#39; &#39;https://githgit --fix-thin nfig/composer/ve-r git rev-�� --quiet --verify dfc3aa0d^{commit} --quiet --verify om/symfony/servi--no-checkout git (http block)
  • https://api.github.com/repos/php-fig/clock/zipball/e41a24703d4560fd0acb709162f73b8adfc3aa0d
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/eEdUTs /usr/bin/composer install --no-interaction --prefer-dist (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/Wrtmes /usr/bin/composer install --no-interaction rgo/bin/git -&#39; &#39;https://githgit --fix-thin nfig/composer/ve-r git rev-�� --quiet --verify dfc3aa0d^{commit} --quiet --verify om/symfony/servi--no-checkout git (http block)
  • https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/eEdUTs /usr/bin/composer install --no-interaction --prefer-dist (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/Wrtmes /usr/bin/composer install --no-interaction rgo/bin/git -&#39; &#39;https://githgit --fix-thin nfig/composer/ve-r git rev-�� --quiet --verify dfc3aa0d^{commit} --quiet --verify om/symfony/servi--no-checkout git (http block)
  • https://api.github.com/repos/php-fig/event-dispatcher/zipball/dbefd12671e8a14ec7f180cab83036ed26714bb0
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/eEdUTs /usr/bin/composer install --no-interaction --prefer-dist (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/Wrtmes /usr/bin/composer install --no-interaction rgo/bin/git -&#39; &#39;https://githgit --fix-thin nfig/composer/ve-r git rev-�� --quiet --verify dfc3aa0d^{commit} --quiet --verify om/symfony/servi--no-checkout git (http block)
  • https://api.github.com/repos/php-fig/log/zipball/f16e1d5863e37f8d8c2a01719f5b34baa2b714d3
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/Wrtmes /usr/bin/composer install --no-interaction rgo/bin/git -&#39; &#39;https://githgit --fix-thin nfig/composer/ve-r git rev-�� --quiet --verify dfc3aa0d^{commit} --quiet --verify om/symfony/servi--no-checkout git (http block)
  • https://api.github.com/repos/php-fig/simple-cache/zipball/764e0b3939f5ca87cb904f570ef9be2d78a07865
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/eEdUTs /usr/bin/composer install --no-interaction --prefer-dist (http block)
  • https://api.github.com/repos/phpstan/phpstan/zipball/9e800e6bee7d5bd02784d4c6069b48032d16224f
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/Wrtmes /usr/bin/composer install --no-interaction rgo/bin/git -&#39; &#39;https://githgit --fix-thin nfig/composer/ve-r git rev-�� --quiet --verify dfc3aa0d^{commit} --quiet --verify om/symfony/servi--no-checkout git (http block)
  • https://api.github.com/repos/reactphp/event-loop/zipball/ba276bda6083df7e0050fd9b33f66ad7a4ac747a
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/eEdUTs /usr/bin/composer install --no-interaction --prefer-dist (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/Wrtmes /usr/bin/composer install --no-interaction rgo/bin/git -&#39; &#39;https://githgit --fix-thin nfig/composer/ve-r git rev-�� --quiet --verify dfc3aa0d^{commit} --quiet --verify om/symfony/servi--no-checkout git (http block)
  • https://api.github.com/repos/reactphp/stream/zipball/1e5b0acb8fe55143b5b426817155190eb6f5b18d
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/eEdUTs /usr/bin/composer install --no-interaction --prefer-dist (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/Wrtmes /usr/bin/composer install --no-interaction rgo/bin/git -&#39; &#39;https://githgit --fix-thin nfig/composer/ve-r git rev-�� --quiet --verify dfc3aa0d^{commit} --quiet --verify om/symfony/servi--no-checkout git (http block)
  • https://api.github.com/repos/rectorphp/rector/zipball/f7166355dcf47482f27be59169b0825995f51c7d
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/Wrtmes /usr/bin/composer install --no-interaction rgo/bin/git -&#39; &#39;https://githgit --fix-thin nfig/composer/ve-r git rev-�� --quiet --verify dfc3aa0d^{commit} --quiet --verify om/symfony/servi--no-checkout git (http block)
  • https://api.github.com/repos/revoltphp/event-loop/zipball/b6fc06dce8e9b523c9946138fa5e62181934f91c
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/eEdUTs /usr/bin/composer install --no-interaction --prefer-dist (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/Wrtmes /usr/bin/composer install --no-interaction rgo/bin/git -&#39; &#39;https://githgit --fix-thin nfig/composer/ve-r git rev-�� --quiet --verify dfc3aa0d^{commit} --quiet --verify om/symfony/servi--no-checkout git (http block)
  • https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/c34583b87e7b7a8055bf6c450c2c77ce32a24084
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/Wrtmes /usr/bin/composer install --no-interaction rgo/bin/git -&#39; &#39;https://githgit --fix-thin nfig/composer/ve-r git rev-�� --quiet --verify dfc3aa0d^{commit} --quiet --verify om/symfony/servi--no-checkout git (http block)
  • https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/5e3a687f7d8ae33fb362c5c0743794bbb2420a1d
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/Wrtmes /usr/bin/composer install --no-interaction rgo/bin/git -&#39; &#39;https://githgit --fix-thin nfig/composer/ve-r git rev-�� --quiet --verify dfc3aa0d^{commit} --quiet --verify om/symfony/servi--no-checkout git (http block)
  • https://api.github.com/repos/sebastianbergmann/code-unit/zipball/a81fee9eef0b7a76af11d121767abc44c104e503
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/Wrtmes /usr/bin/composer install --no-interaction rgo/bin/git -&#39; &#39;https://githgit --fix-thin nfig/composer/ve-r git rev-�� --quiet --verify dfc3aa0d^{commit} --quiet --verify om/symfony/servi--no-checkout git (http block)
  • https://api.github.com/repos/sebastianbergmann/comparator/zipball/e8e53097718d2b53cfb2aa859b06a41abf58c62e
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/Wrtmes /usr/bin/composer install --no-interaction rgo/bin/git -&#39; &#39;https://githgit --fix-thin nfig/composer/ve-r git rev-�� --quiet --verify dfc3aa0d^{commit} --quiet --verify om/symfony/servi--no-checkout git (http block)
  • https://api.github.com/repos/sebastianbergmann/complexity/zipball/68ff824baeae169ec9f2137158ee529584553799
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/Wrtmes /usr/bin/composer install --no-interaction rgo/bin/git -&#39; &#39;https://githgit --fix-thin nfig/composer/ve-r git rev-�� --quiet --verify dfc3aa0d^{commit} --quiet --verify om/symfony/servi--no-checkout git (http block)
  • https://api.github.com/repos/sebastianbergmann/diff/zipball/c41e007b4b62af48218231d6c2275e4c9b975b2e
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/Wrtmes /usr/bin/composer install --no-interaction rgo/bin/git -&#39; &#39;https://githgit --fix-thin nfig/composer/ve-r git rev-�� --quiet --verify dfc3aa0d^{commit} --quiet --verify om/symfony/servi--no-checkout git (http block)
  • https://api.github.com/repos/sebastianbergmann/environment/zipball/8074dbcd93529b357029f5cc5058fd3e43666984
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/Wrtmes /usr/bin/composer install --no-interaction rgo/bin/git -&#39; &#39;https://githgit --fix-thin nfig/composer/ve-r git rev-�� --quiet --verify dfc3aa0d^{commit} --quiet --verify om/symfony/servi--no-checkout git (http block)
  • https://api.github.com/repos/sebastianbergmann/exporter/zipball/0735b90f4da94969541dac1da743446e276defa6
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/Wrtmes /usr/bin/composer install --no-interaction rgo/bin/git -&#39; &#39;https://githgit --fix-thin nfig/composer/ve-r git rev-�� --quiet --verify dfc3aa0d^{commit} --quiet --verify om/symfony/servi--no-checkout git (http block)
  • https://api.github.com/repos/sebastianbergmann/global-state/zipball/987bafff24ecc4c9ac418cab1145b96dd6e9cbd9
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/Wrtmes /usr/bin/composer install --no-interaction rgo/bin/git -&#39; &#39;https://githgit --fix-thin nfig/composer/ve-r git rev-�� --quiet --verify dfc3aa0d^{commit} --quiet --verify om/symfony/servi--no-checkout git (http block)
  • https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/856e7f6a75a84e339195d48c556f23be2ebf75d0
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/Wrtmes /usr/bin/composer install --no-interaction rgo/bin/git -&#39; &#39;https://githgit --fix-thin nfig/composer/ve-r git rev-�� --quiet --verify dfc3aa0d^{commit} --quiet --verify om/symfony/servi--no-checkout git (http block)
  • https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/202d0e344a580d7f7d04b3fafce6933e59dae906
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/Wrtmes /usr/bin/composer install --no-interaction rgo/bin/git -&#39; &#39;https://githgit --fix-thin nfig/composer/ve-r git rev-�� --quiet --verify dfc3aa0d^{commit} --quiet --verify om/symfony/servi--no-checkout git (http block)
  • https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/24ed13d98130f0e7122df55d06c5c4942a577957
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/eEdUTs /usr/bin/composer install --no-interaction --prefer-dist (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/Wrtmes /usr/bin/composer install --no-interaction rgo/bin/git -&#39; &#39;https://githgit --fix-thin nfig/composer/ve-r git rev-�� --quiet --verify dfc3aa0d^{commit} --quiet --verify om/symfony/servi--no-checkout git (http block)
  • https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/7e308268858ed6baedc8704a304727d20bc07c77
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/Wrtmes /usr/bin/composer install --no-interaction rgo/bin/git -&#39; &#39;https://githgit --fix-thin nfig/composer/ve-r git rev-�� --quiet --verify dfc3aa0d^{commit} --quiet --verify om/symfony/servi--no-checkout git (http block)
  • https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/a95037b6d9e608ba092da1b23931e537cadc3c3c
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/Wrtmes /usr/bin/composer install --no-interaction rgo/bin/git -&#39; &#39;https://githgit --fix-thin nfig/composer/ve-r git rev-�� --quiet --verify dfc3aa0d^{commit} --quiet --verify om/symfony/servi--no-checkout git (http block)
  • https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/f5e568ba02fa5ba0ddd0f618391d5a9ea50b06d7
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/Wrtmes /usr/bin/composer install --no-interaction rgo/bin/git -&#39; &#39;https://githgit --fix-thin nfig/composer/ve-r git rev-�� --quiet --verify dfc3aa0d^{commit} --quiet --verify om/symfony/servi--no-checkout git (http block)
  • https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/0c7b06ff49e3d5072f057eb1fa59258bf287a748
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/Wrtmes /usr/bin/composer install --no-interaction rgo/bin/git -&#39; &#39;https://githgit --fix-thin nfig/composer/ve-r git rev-�� --quiet --verify dfc3aa0d^{commit} --quiet --verify om/symfony/servi--no-checkout git (http block)
  • https://api.github.com/repos/sebastianbergmann/php-timer/zipball/e2a2d67966e740530f4a3343fe2e030ffdc1161d
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/Wrtmes /usr/bin/composer install --no-interaction rgo/bin/git -&#39; &#39;https://githgit --fix-thin nfig/composer/ve-r git rev-�� --quiet --verify dfc3aa0d^{commit} --quiet --verify om/symfony/servi--no-checkout git (http block)
  • https://api.github.com/repos/sebastianbergmann/phpunit/zipball/f2e26f52f80ef77832e359205f216eeac00e320c
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/Wrtmes /usr/bin/composer install --no-interaction rgo/bin/git -&#39; &#39;https://githgit --fix-thin nfig/composer/ve-r git rev-�� --quiet --verify dfc3aa0d^{commit} --quiet --verify om/symfony/servi--no-checkout git (http block)
  • https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/47e34210757a2f37a97dcd207d032e1b01e64c7a
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/eEdUTs /usr/bin/composer install --no-interaction --prefer-dist (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/Wrtmes /usr/bin/composer install --no-interaction rgo/bin/git -&#39; &#39;https://githgit --fix-thin nfig/composer/ve-r git rev-�� --quiet --verify dfc3aa0d^{commit} --quiet --verify om/symfony/servi--no-checkout git (http block)
  • https://api.github.com/repos/sebastianbergmann/type/zipball/462699a16464c3944eefc02ebdd77882bd3925bf
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/eEdUTs /usr/bin/composer install --no-interaction --prefer-dist (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/Wrtmes /usr/bin/composer install --no-interaction rgo/bin/git -&#39; &#39;https://githgit --fix-thin nfig/composer/ve-r git rev-�� --quiet --verify dfc3aa0d^{commit} --quiet --verify om/symfony/servi--no-checkout git (http block)
  • https://api.github.com/repos/sebastianbergmann/version/zipball/c51fa83a5d8f43f1402e3f32a005e6262244ef17
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/eEdUTs /usr/bin/composer install --no-interaction --prefer-dist (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/Wrtmes /usr/bin/composer install --no-interaction rgo/bin/git -&#39; &#39;https://githgit --fix-thin nfig/composer/ve-r git rev-�� --quiet --verify dfc3aa0d^{commit} --quiet --verify om/symfony/servi--no-checkout git (http block)
  • https://api.github.com/repos/spatie/phpunit-watcher/zipball/3b0e68596c70eba9bec99566b5e2199afb9f289d
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/Wrtmes /usr/bin/composer install --no-interaction rgo/bin/git -&#39; &#39;https://githgit --fix-thin nfig/composer/ve-r git rev-�� --quiet --verify dfc3aa0d^{commit} --quiet --verify om/symfony/servi--no-checkout git (http block)
  • https://api.github.com/repos/symfony/console/zipball/732a9ca6cd9dfd940c639062d5edbde2f6727fb6
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/eEdUTs /usr/bin/composer install --no-interaction --prefer-dist (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/Wrtmes /usr/bin/composer install --no-interaction rgo/bin/git -&#39; &#39;https://githgit --fix-thin nfig/composer/ve-r git rev-�� --quiet --verify dfc3aa0d^{commit} --quiet --verify om/symfony/servi--no-checkout git (http block)
  • https://api.github.com/repos/symfony/deprecation-contracts/zipball/63afe740e99a13ba87ec199bb07bbdee937a5b62
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/eEdUTs /usr/bin/composer install --no-interaction --prefer-dist (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/Wrtmes /usr/bin/composer install --no-interaction rgo/bin/git -&#39; &#39;https://githgit --fix-thin nfig/composer/ve-r git rev-�� --quiet --verify dfc3aa0d^{commit} --quiet --verify om/symfony/servi--no-checkout git (http block)
  • https://api.github.com/repos/symfony/finder/zipball/fffe05569336549b20a1be64250b40516d6e8d06
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/Wrtmes /usr/bin/composer install --no-interaction rgo/bin/git -&#39; &#39;https://githgit --fix-thin nfig/composer/ve-r git rev-�� --quiet --verify dfc3aa0d^{commit} --quiet --verify om/symfony/servi--no-checkout git (http block)
  • https://api.github.com/repos/symfony/polyfill-ctype/zipball/a3cc8b044a6ea513310cbd48ef7333b384945638
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/eEdUTs /usr/bin/composer install --no-interaction --prefer-dist (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/Wrtmes /usr/bin/composer install --no-interaction rgo/bin/git -&#39; &#39;https://githgit --fix-thin nfig/composer/ve-r git rev-�� --quiet --verify dfc3aa0d^{commit} --quiet --verify om/symfony/servi--no-checkout git (http block)
  • https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/380872130d3a5dd3ace2f4010d95125fde5d5c70
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/eEdUTs /usr/bin/composer install --no-interaction --prefer-dist (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/Wrtmes /usr/bin/composer install --no-interaction rgo/bin/git -&#39; &#39;https://githgit --fix-thin nfig/composer/ve-r git rev-�� --quiet --verify dfc3aa0d^{commit} --quiet --verify om/symfony/servi--no-checkout git (http block)
  • https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/3833d7255cc303546435cb650316bff708a1c75c
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/eEdUTs /usr/bin/composer install --no-interaction --prefer-dist (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/Wrtmes /usr/bin/composer install --no-interaction rgo/bin/git -&#39; &#39;https://githgit --fix-thin nfig/composer/ve-r git rev-�� --quiet --verify dfc3aa0d^{commit} --quiet --verify om/symfony/servi--no-checkout git (http block)
  • https://api.github.com/repos/symfony/polyfill-mbstring/zipball/6d857f4d76bd4b343eac26d6b539585d2bc56493
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/eEdUTs /usr/bin/composer install --no-interaction --prefer-dist (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/Wrtmes /usr/bin/composer install --no-interaction rgo/bin/git -&#39; &#39;https://githgit --fix-thin nfig/composer/ve-r git rev-�� --quiet --verify dfc3aa0d^{commit} --quiet --verify om/symfony/servi--no-checkout git (http block)
  • https://api.github.com/repos/symfony/process/zipball/2f8e1a6cdf590ca63715da4d3a7a3327404a523f
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/Wrtmes /usr/bin/composer install --no-interaction rgo/bin/git -&#39; &#39;https://githgit --fix-thin nfig/composer/ve-r git rev-�� --quiet --verify dfc3aa0d^{commit} --quiet --verify om/symfony/servi--no-checkout git (http block)
  • https://api.github.com/repos/symfony/service-contracts/zipball/45112560a3ba2d715666a509a0bc9521d10b6c43
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/eEdUTs /usr/bin/composer install --no-interaction --prefer-dist (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/Wrtmes /usr/bin/composer install --no-interaction rgo/bin/git -&#39; &#39;https://githgit --fix-thin nfig/composer/ve-r git rev-�� --quiet --verify dfc3aa0d^{commit} --quiet --verify om/symfony/servi--no-checkout git (http block)
  • https://api.github.com/repos/symfony/string/zipball/d50e862cb0a0e0886f73ca1f31b865efbb795003
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/eEdUTs /usr/bin/composer install --no-interaction --prefer-dist (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/Wrtmes /usr/bin/composer install --no-interaction rgo/bin/git -&#39; &#39;https://githgit --fix-thin nfig/composer/ve-r git rev-�� --quiet --verify dfc3aa0d^{commit} --quiet --verify om/symfony/servi--no-checkout git (http block)
  • https://api.github.com/repos/symfony/yaml/zipball/24dd4de28d2e3988b311751ac49e684d783e2345
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/Wrtmes /usr/bin/composer install --no-interaction rgo/bin/git -&#39; &#39;https://githgit --fix-thin nfig/composer/ve-r git rev-�� --quiet --verify dfc3aa0d^{commit} --quiet --verify om/symfony/servi--no-checkout git (http block)
  • https://api.github.com/repos/theseer/tokenizer/zipball/b7489ce515e168639d17feec34b8847c326b0b3c
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/Wrtmes /usr/bin/composer install --no-interaction rgo/bin/git -&#39; &#39;https://githgit --fix-thin nfig/composer/ve-r git rev-�� --quiet --verify dfc3aa0d^{commit} --quiet --verify om/symfony/servi--no-checkout git (http block)
  • https://api.github.com/repos/webmozarts/glob/zipball/8a2842112d6916e61e0e15e316465b611f3abc17
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/eEdUTs /usr/bin/composer install --no-interaction --prefer-dist (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/Wrtmes /usr/bin/composer install --no-interaction rgo/bin/git -&#39; &#39;https://githgit --fix-thin nfig/composer/ve-r git rev-�� --quiet --verify dfc3aa0d^{commit} --quiet --verify om/symfony/servi--no-checkout git (http block)
  • https://api.github.com/repos/yiisoft/aliases/zipball/6f876dbf899f604fd3aefa3b3fd37e2ff2549ead
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/Wrtmes /usr/bin/composer install --no-interaction rgo/bin/git -&#39; &#39;https://githgit --fix-thin nfig/composer/ve-r git rev-�� --quiet --verify dfc3aa0d^{commit} --quiet --verify om/symfony/servi--no-checkout git (http block)
  • https://api.github.com/repos/yiisoft/arrays/zipball/8efada90e4fd540b3da476779bc1b7bd9319b62f
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/eEdUTs /usr/bin/composer install --no-interaction --prefer-dist (http block)
  • https://api.github.com/repos/yiisoft/cache/zipball/1f0fe8fac81632aa86b8feea73f2c7f11d7405d2
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/eEdUTs /usr/bin/composer install --no-interaction --prefer-dist (http block)
  • https://api.github.com/repos/yiisoft/definitions/zipball/efba764905b89b549e2b5a7a72f50a79b3d5b0cc
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/eEdUTs /usr/bin/composer install --no-interaction --prefer-dist (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/Wrtmes /usr/bin/composer install --no-interaction rgo/bin/git -&#39; &#39;https://githgit --fix-thin nfig/composer/ve-r git rev-�� --quiet --verify dfc3aa0d^{commit} --quiet --verify om/symfony/servi--no-checkout git (http block)
  • https://api.github.com/repos/yiisoft/di/zipball/09545283f29b6311805eca870bf01d2603704c63
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/eEdUTs /usr/bin/composer install --no-interaction --prefer-dist (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/Wrtmes /usr/bin/composer install --no-interaction rgo/bin/git -&#39; &#39;https://githgit --fix-thin nfig/composer/ve-r git rev-�� --quiet --verify dfc3aa0d^{commit} --quiet --verify om/symfony/servi--no-checkout git (http block)
  • https://api.github.com/repos/yiisoft/files/zipball/465650fd9e4295669f42ab7e9fec2386700540a7
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/eEdUTs /usr/bin/composer install --no-interaction --prefer-dist (http block)
  • https://api.github.com/repos/yiisoft/friendly-exception/zipball/c6c36fd60a0b4f1514882d2ce8395f54352ec967
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/eEdUTs /usr/bin/composer install --no-interaction --prefer-dist (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/Wrtmes /usr/bin/composer install --no-interaction rgo/bin/git -&#39; &#39;https://githgit --fix-thin nfig/composer/ve-r git rev-�� --quiet --verify dfc3aa0d^{commit} --quiet --verify om/symfony/servi--no-checkout git (http block)
  • https://api.github.com/repos/yiisoft/html/zipball/c9ebbac355d1e8a626c0e17e3e467b701f672aa1
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/eEdUTs /usr/bin/composer install --no-interaction --prefer-dist (http block)
  • https://api.github.com/repos/yiisoft/json/zipball/6af88ed2c653f4b6cbe3ea9114e4aebc5a463c80
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/eEdUTs /usr/bin/composer install --no-interaction --prefer-dist (http block)
  • https://api.github.com/repos/yiisoft/psr-dummy-provider/zipball/658283e87ffe10c81092552a25ad9770788f0346
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/eEdUTs /usr/bin/composer install --no-interaction --prefer-dist (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/Wrtmes /usr/bin/composer install --no-interaction rgo/bin/git -&#39; &#39;https://githgit --fix-thin nfig/composer/ve-r git rev-�� --quiet --verify dfc3aa0d^{commit} --quiet --verify om/symfony/servi--no-checkout git (http block)
  • https://api.github.com/repos/yiisoft/strings/zipball/9bc7fea56374619cccd4587848029fe97f98bb33
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/eEdUTs /usr/bin/composer install --no-interaction --prefer-dist (http block)
  • https://api.github.com/repos/yiisoft/test-support/zipball/2be91b4db0239c00e7502fb6dc9f4ded0ea18f06
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/eEdUTs /usr/bin/composer install --no-interaction --prefer-dist (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/Wrtmes /usr/bin/composer install --no-interaction rgo/bin/git -&#39; &#39;https://githgit --fix-thin nfig/composer/ve-r git rev-�� --quiet --verify dfc3aa0d^{commit} --quiet --verify om/symfony/servi--no-checkout git (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title [WIP] Address feedback on fix for template file searching Sort renderer extensions by length to prioritize specific extensions Jan 6, 2026
Copilot AI requested a review from samdark January 6, 2026 06:25
@samdark
Copy link
Member

samdark commented Jan 6, 2026

@copilot PHP Fatal error: Class Yiisoft\View\PhpTemplateRenderer@anonymous cannot extend final class Yiisoft\View\PhpTemplateRenderer in /home/runner/work/view/view/tests/ViewTest.php on line 265

Copilot AI and others added 4 commits January 6, 2026 06:40
…lateRenderer

Co-authored-by: samdark <47294+samdark@users.noreply.github.com>
… new ones

Co-authored-by: samdark <47294+samdark@users.noreply.github.com>
Co-authored-by: samdark <47294+samdark@users.noreply.github.com>
Copy link
Author

Copilot AI commented Jan 6, 2026

@copilot PHP Fatal error: Class Yiisoft\View\PhpTemplateRenderer@anonymous cannot extend final class Yiisoft\View\PhpTemplateRenderer in /home/runner/work/view/view/tests/ViewTest.php on line 265

Fixed! Changed the test to implement TemplateRendererInterface directly instead of extending the final PhpTemplateRenderer class. The anonymous classes now use constructor property promotion to efficiently share a single PhpTemplateRenderer instance. Fix in commit 4f58ea5.

@codecov
Copy link

codecov bot commented Jan 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.14%. Comparing base (9fa216f) to head (1796fdb).
⚠️ Report is 1 commits behind head on 289-double-extensions.

Additional details and impacted files
@@                   Coverage Diff                    @@
##             289-double-extensions     #292   +/-   ##
========================================================
  Coverage                    99.14%   99.14%           
  Complexity                     311      311           
========================================================
  Files                           19       19           
  Lines                          815      816    +1     
========================================================
+ Hits                           808      809    +1     
  Misses                           7        7           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@samdark samdark marked this pull request as ready for review January 6, 2026 19:32
Copilot AI review requested due to automatic review settings January 6, 2026 19:32
@samdark samdark merged commit 40a5e9e into 289-double-extensions Jan 6, 2026
25 of 26 checks passed
@samdark samdark deleted the copilot/sub-pr-291 branch January 6, 2026 19:33
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 renderer selection when multiple renderers have overlapping file extensions. The key change ensures that more specific (longer) extensions like "blade.php" are matched before less specific (shorter) ones like "php", regardless of registration order.

Key Changes:

  • Sorts renderer extensions by length in descending order when renderers are set
  • Adds comprehensive test coverage for overlapping extension scenarios
  • Optimizes performance by sorting once during registration rather than on each render

Reviewed changes

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

File Description
src/ViewTrait.php Added sorting logic in withRenderers() to prioritize longer extensions using uksort() with descending length comparison
tests/ViewTest.php Added testOverlappingExtensionRendererPriority() test that verifies longer extensions are matched first by using anonymous classes implementing TemplateRendererInterface with identifying markers

After a thorough review of the implementation, I found no issues with this pull request. The code is well-implemented with the following strengths:

Correct sorting logic: Uses uksort() with strlen($b) <=> strlen($a) to ensure longer extensions are checked first
Optimal performance: Sorting happens once during withRenderers() rather than on every render call
Comprehensive test coverage: The new test properly validates the fix using anonymous classes with markers
Clean implementation: Clear inline comment explaining the purpose, properly reuses PhpTemplateRenderer instance
Edge case handling: Empty string extensions are already filtered in the render loop (line 455-456 in ViewTrait.php)

The implementation successfully addresses the issue described in the PR where overlapping extensions could cause unexpected behavior depending on registration order.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

3 participants