Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
minor #3687 throwing syntax error when the matches regexp is not vali…
…d (WebMamba, fabpot) This PR was merged into the 3.x branch. Discussion ---------- throwing syntax error when the matches regexp is not valid During the symfony live, Fabien talk about a PR he did on the Expression Language component (https://github.com/symfony/symfony/pull/45875/files). The goal was to throw a more readable error when using the matchs operator. This think need to be fix in twig to. So as promises, here is my PR ! This is my first contrib to symfony so any advice is welcome ! 😁 Commits ------- a82e94d Add some tests 61672c4 throwing syntaxt error when the matches regexp is not valid
- Loading branch information
Showing
3 changed files
with
29 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--TEST-- | ||
Twig supports the "matches" operator with a great error message | ||
--TEMPLATE-- | ||
{{ 'foo' matches '/o' }} | ||
--DATA-- | ||
return [] | ||
--EXCEPTION-- | ||
Twig\Error\RuntimeError: Regexp "/o" passed to "matches" is not valid: No ending delimiter '/' found in "index.twig" at line 2 |