Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

PHPStan fixes #9

Closed
weierophinney opened this issue Dec 31, 2019 · 6 comments
Closed

PHPStan fixes #9

weierophinney opened this issue Dec 31, 2019 · 6 comments

Comments

@weierophinney
Copy link
Member

In order to bump to PHP 7 minimum version in the future, I used phpstan to static analyse the code, correcting some phpdoc errors and adding guards throwing exceptions when needed. Code quality will be improved when other components will be improved.

It's just a first step, but I think it will be useful.

I don't know if this could be considered a BC break, probably it isn't.


Originally posted by @thomasvargiu at zendframework/zend-mvc#296

@weierophinney
Copy link
Member Author

@Ocramius I can add phpstan on CI, but just a low level. Too many errors depends on other libraries.


Originally posted by @thomasvargiu at zendframework/zend-mvc#296 (comment)

@weierophinney
Copy link
Member Author

@thomasvargiu that's fine - we can raise the level as we get better


Originally posted by @Ocramius at zendframework/zend-mvc#296 (comment)

@weierophinney
Copy link
Member Author

@thomasvargiu btw, I still suggest getting rid of all the throw new SomeException($someString), and having throw SomeException::unexpectedType($expected, $actual) instead


Originally posted by @Ocramius at zendframework/zend-mvc#296 (comment)

@weierophinney
Copy link
Member Author

@Ocramius I'm still working on this. I set this PR as WIP


Originally posted by @thomasvargiu at zendframework/zend-mvc#296 (comment)

@weierophinney
Copy link
Member Author

Done. Needs a complete review


Originally posted by @thomasvargiu at zendframework/zend-mvc#296 (comment)

@samsonasik
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants