Adding checks for the expression language#25137
Conversation
|
3.4? |
| break; | ||
| case 'expression': | ||
| if (!class_exists(Expression::class)) { | ||
| throw new \LogicException(sprintf('type="expression" cannot be used without the expression component. Try running "composer require symfony/expression-language".')); |
There was a problem hiding this comment.
The symfony/ part is always optional when using Flex. Could we use composer require expression-language instead?
There was a problem hiding this comment.
Since this is inside a component, it feels too presumptive to put the Flex alias.
There was a problem hiding this comment.
What about:
The type="expression" attribute cannot be used without the ExpressionLanguage component. Try running "composer require symfony/expression-language". (we already use that ExpressionLanguage name in other similar exceptions.)
0f13584 to
d6214f9
Compare
|
Target branch changed! |
| } | ||
| } elseif (is_string($value) && 0 === strpos($value, '@=')) { | ||
| if (!class_exists(Expression::class)) { | ||
| throw new \LogicException(sprintf('The @= expression syntax cannot be used without the expression component. Try running "composer require symfony/expression-language".')); |
There was a problem hiding this comment.
The "@=" expression syntax cannot be used without the ExpressionLanguage component. Try running "composer require symfony/expression-language".
There was a problem hiding this comment.
(reminder: strings in double quotes are in bold in profiler panels ;) )
d6214f9 to
e17232d
Compare
|
Changes made! |
|
@weaverryan Can you rebase? |
e17232d to
3502020
Compare
|
Rebased. Sorry - I rebased locally... and did a bad job. Looks better now |
|
Thank you @weaverryan. |
This PR was merged into the 3.4 branch. Discussion ---------- Adding checks for the expression language | Q | A | ------------- | --- | Branch? | 4.0 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | none | License | MIT | Doc PR | not needed If you try to use the expression syntax in DI, this will drastically improve the error message :) Commits ------- 3502020 adding checks for the expression language
If you try to use the expression syntax in DI, this will drastically improve the error message :)