You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Install Twig for the test suite again and run the Twig tests #626
Make twig/twig a required dependency again, so the Twig renderer works out of the box, its tests run instead of being skipped, and PHPStan analyzes the adapter against the real Twig classes.
Why
Twig is a rendering engine, and it was a normal required dependency of the framework until 3.0.3. It was taken out of the install in 3.0.3 (#532): vulnerable Twig releases were fixed only in versions that need PHP 8.1, and the framework still supported PHP 8.0. Twig became an optional renderer, its tests skip when it is missing, and stubs/Twig.stub stands in for it in PHPStan.
PHP 8.1 is the minimum now (#595). Composer resolves twig/twig:^3.27 on PHP 8.1 (currently v3.30.0), and composer audit reports no advisories. Four tests skip today because Twig is not installed: TwigAdapterTest::testTwigAdapterRenderView, RendererFactoryTest::testRendererFactoryTwigAdapter, RendererTest::testRendererGetTwigAdapter and ViewTest::testRenderViewWithTwig.
Scope
Move "twig/twig": "^3.27" from suggest to require in composer.json.
Remove stubs/Twig.stub and its entry in phpstan.neon.dist, so PHPStan analyzes src/Renderer/Adapters/TwigAdapter.php against the real Twig classes. Any new finding is fixed or reported.
Check that the four skipped tests run and pass on PHP 8.1, 8.2 and 8.3.
RendererException::twigNotInstalled(), the class_exists guard in TwigAdapter and TwigAdapterTest::testTwigAdapterThrowsActionableExceptionWhenTwigIsMissing become dead code once Twig is required: remove them, or keep them as a safety net (decided in the pull request).
Add the CHANGELOG.md entry.
Acceptance Criteria
twig/twig^3.27 is in require and no longer in suggest
the four Twig tests run and pass
the Twig stub is gone and composer phpstan passes
composer test, composer cs:check and composer rector:check pass on PHP 8.1 to 8.3
Activity
[#626] Require Twig again
[#626] Remove the missing-Twig exception
[#626] Add Twig to the changelog