Modernize codebase: drop Latte 2 support and update to PHP 8.2+#153
Open
ohmyfelix wants to merge 6 commits into
Open
Modernize codebase: drop Latte 2 support and update to PHP 8.2+#153ohmyfelix wants to merge 6 commits into
ohmyfelix wants to merge 6 commits into
Conversation
Replace ninjify/nunjuck and ninjify/qa with contributte/tester and contributte/qa, bump the PHP requirement to ^8.2, and adapt the codebase to the stricter contributte/qa coding standard. https://claude.ai/code/session_01UPxf8e9GsykRoeqXM4j871
Require latte/latte ^3.0.25 and remove the Latte 2 compatibility layer: delete the MacroSet-based Macros and the Filters class, simplify the DI extension to register the Latte 3 TranslatorExtension unconditionally, and switch from the deprecated Nette\Localization\ITranslator to Nette\Localization\Translator. Inspired by #140 https://claude.ai/code/session_01UPxf8e9GsykRoeqXM4j871
Replace the individual phpstan/phpstan and phpstan-* rule dependencies with contributte/phpstan, and include its bundled phpstan.neon in both config files. https://claude.ai/code/session_01UPxf8e9GsykRoeqXM4j871
Adopt the kernel-style Makefile (direct phpcs/phpcbf with cs2pr under CI, neon-driven phpstan, install target), use the PHP 8.2 contributte/qa ruleset and exclude generated test artifacts, scope phpstan to src, refresh .gitignore/.gitattributes/.editorconfig, and install cs2pr in CI. https://claude.ai/code/session_01UPxf8e9GsykRoeqXM4j871
Drop the project-level FullyQualifiedClassNameInAnnotation rule (kernel inherits contributte/qa's default that does not require FQ class names in annotations) and convert the remaining fully-qualified throws/use sites across src and tests to imported short names. https://claude.ai/code/session_01UPxf8e9GsykRoeqXM4j871
Tees tester.out and posts it as a PR comment when the PHP 8.4 tests job fails, so the failure cause is visible from outside the runner. https://claude.ai/code/session_01UPxf8e9GsykRoeqXM4j871
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR modernizes the codebase by removing legacy code and updating dependencies to current standards.
Summary
Removes support for Latte 2.x and PHP 8.0-8.1, consolidating the codebase around Latte 3.x and PHP 8.2+. This eliminates compatibility shims and simplifies the translation extension implementation.
Key Changes
src/Latte/Macros.phpandsrc/Latte/Filters.phpwhich contained version-specific code for Latte 2.x compatibilityTranslatorExtensionto use modern Latte 3 compiler nodes instead of macro-based approachTranslateNode: Cleaned up conditional logic in the print method using ternary operatorscomposer.json^3.0.25ITranslatorinterface toTranslatorclass throughout codebasecontributte/phpstanpackage, removed version-specific ignore rulesninjify/qatocontributte/qawith updated Makefile targetsImplementation Details
Engine::VERSION_ID)Filtersclass that wrapped translator for Latte 2 compatibilityTranslatorExtensionto work exclusively with Latte 3's tag-based extension systemPhpLiteralusage in favor of modern alternativesstr_contains()instead ofStrings::contains())https://claude.ai/code/session_01UPxf8e9GsykRoeqXM4j871