Skip to content
This repository has been archived by the owner on Dec 3, 2023. It is now read-only.

Improve ConfigLoader::PHP_CONST_REGEX #4484

Conversation

Wirone
Copy link
Contributor

@Wirone Wirone commented Nov 25, 2022

Continuation from #4441 🙂

Differences between proposed regex and actual change in the PR:

  • added support for numbers in constants
  • instead of \\ in first group I had to do \\\\ because somehow tests were failing: class' FQCN was not properly caught and was causing syntax issues, e.g.:

    Symfony\Component\Yaml\Exception\ParseException: Unexpected characters near "\ConfigTransformer\Tests\Converter\ConfigFormatConverter\YamlToPhp\YamlToPhpTest::TEST" at line 2 (near "class_constant: "%const(Symplify)%"\ConfigTransformer\Tests\Converter\ConfigFormatConverter\YamlToPhp\YamlToPhpTest::TEST").

Regex URL was updated, but currently it does not contain \\\\ change (works without it).

@TomasVotruba
Copy link
Member

Thank you 👏 👍

@TomasVotruba TomasVotruba merged commit c75b84b into deprecated-packages:main Nov 25, 2022
@Wirone Wirone deleted the codito/proper-regex-for-constants-in-configs branch November 25, 2022 13:35
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants