Skip to content

Add throw tag to parse methods#4698

Merged
fabpot merged 1 commit intotwigphp:3.xfrom
VincentLanglet:parseException
Nov 5, 2025
Merged

Add throw tag to parse methods#4698
fabpot merged 1 commit intotwigphp:3.xfrom
VincentLanglet:parseException

Conversation

@VincentLanglet
Copy link
Copy Markdown
Contributor

Hi @fabpot, with PHPStan improving every day his exception checking, it's useful to have well documented method.

I didn't update all of them (there are too many), and focus on the one I have issue with:

  • Almost all the InfixExpressionParserInterface/PrefixExpressionParserInterface implements throws a SyntaxError in parse method
  • Parser::parse method is catching SyntaxError and rethrowing them so it should be added to the phpdoc
  • Since Parser::parse catch Parser::subparse, it would be useful to add the phpdoc to subparse

@VincentLanglet
Copy link
Copy Markdown
Contributor Author

Cs failure seems unrelated ; should I fix it @fabpot ?

@fabpot
Copy link
Copy Markdown
Contributor

fabpot commented Nov 5, 2025

Thank you @VincentLanglet.

@fabpot fabpot merged commit d58c8be into twigphp:3.x Nov 5, 2025
40 of 41 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants