Skip to content

Overwrite 'i18n extract' to make it able to parse twig templates too. - #121

Open
Antronin wants to merge 9 commits into
cakephp:2.xfrom
Antronin:TwigI18nExtract
Open

Overwrite 'i18n extract' to make it able to parse twig templates too.#121
Antronin wants to merge 9 commits into
cakephp:2.xfrom
Antronin:TwigI18nExtract

Conversation

@Antronin

Copy link
Copy Markdown

This is an enchantment for Twig-View, for issue #91.
With these changes, users can still use i18n extract, but it can now parse Twig files and collect all translations from them in the same way the original command does for PHP files.

@Antronin
Antronin marked this pull request as draft August 18, 2026 13:17
@Antronin

Copy link
Copy Markdown
Author

Can somebody help me with explaining:

  1. What went wrong in the CI 8.2 lowest job? Why it is not finding an instance method which was found in all other jobs?
  2. How to complete phpstan's requirements? CakePhp IO contains the Progress helper, why Phpstan cannot find it?

@Antronin
Antronin marked this pull request as ready for review August 19, 2026 11:32
@web-dev-passion

Copy link
Copy Markdown

Can somebody help me with explaining:

  1. What went wrong in the CI 8.2 lowest job? Why it is not finding an instance method which was found in all other jobs?
  2. How to complete phpstan's requirements? CakePhp IO contains the Progress helper, why Phpstan cannot find it?

I think the 2 phpstan issues are connected to each other.

  1. Wants use statements instead of FQDN -> you added use correctly (https://github.com/cakephp/twig-view/pull/121/changes#diff-59ba34bcfd866a3c81304fe024d9412e0b5ca0ae7bf60862edd8ef06fc24fe95R23)
  2. Wants to use the Progress instead of FQDN -> you forgot removing the FQDN (https://github.com/cakephp/twig-view/pull/121/changes#diff-59ba34bcfd866a3c81304fe024d9412e0b5ca0ae7bf60862edd8ef06fc24fe95R64)

@Antronin

Copy link
Copy Markdown
Author

Thanks, but that's not the error. In PHPUnit, I receive this error, but ONLY in CI:

1) Cake\TwigView\Test\TestCase\Command\I18nExtractCommandTest::testExecute
assert($progress instanceof ProgressHelper)

/home/runner/work/twig-view/twig-view/src/Command/TwigExtractCommand.php:64

I'm not sure why the assert is a problem, even though the same PHP version (8.2.33) runs successfully in another CI task.

And for the Coding Standard check, the error is this:

Fatal error: Uncaught Rector\Exception\Reflection\MissingPrivatePropertyException: Property "$container" was not found in "PHPStan\Parser\RichParser" class in /home/runner/work/twig-view/twig-view/vendor/rector/rector/src/Util/Reflection/PrivatesAccessor.php:82

That is not even my code, but Rector's.

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.

2 participants