Skip to content

Unable to get PHPStan to warn about missing try/catch blocks #10944

Closed Answered by ondrejmirtes
Jemt asked this question in Support
Discussion options

You must be logged in to vote

You mean to get an error for echo multiplyByTwo(4); when called outside of any function or method? There currently isn't any rule for that in PHPStan.

I recommend you to wrap all your code in functions and classes.

Replies: 1 comment 6 replies

Comment options

You must be logged in to vote
6 replies
@ondrejmirtes
Comment options

@Jemt
Comment options

@Jemt
Comment options

@ondrejmirtes
Comment options

@Jemt
Comment options

Answer selected by Jemt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Support
Labels
None yet
2 participants