Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Bug in configuring patternengines (and listeners?) since PHP 8.0 #177

Open
percoction opened this issue Jul 26, 2022 · 1 comment
Open

Comments

@percoction
Copy link

We use patternlab-php-core and edition-php-twig-standard in our project.

We noticed that since PHP 8.0 the config in config/patternengines.json is missing the class namespaces.

I believe this due to an update to the functionality of the token_get_all() built in PHP function, used in InstallerUtil::findClasses().

The fix may be as simple as updating line 135 to consider the new namespace token types:
if (in_array($tokens[$i][0], array(T_STRING, T_NS_SEPARATOR, T_NAME_FULLY_QUALIFIED, T_NAME_QUALIFIED, T_NAME_RELATIVE))) {

@joshuathorne
Copy link

joshuathorne commented Aug 1, 2022

I'm also experiencing this build error.
patternlab updated config/patternengines.json to:
{"patternengines":["\\PatternLab\\PatternEngine\\Twig\\PatternEngineRule","\\PatternEngineRule"]}

error is:
PHP Fatal error: Uncaught Error: Class '\PatternEngineRule' not found in /app/vendor/pattern-lab/core/src/PatternLab/PatternEngine.php:71

I resolved it by manually changing patternengines.json to: {"patternengines":["\\PatternLab\\PatternEngine\\Twig\\PatternEngineRule"]}

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants