Add phpstan, add/fix types#46
Merged
TavoNiievez merged 5 commits intoCodeception:masterfrom Jul 26, 2021
Merged
Conversation
The main goal was to provide better param/return types using `class-string` and templates, but I decided to also run PHPStan over the codebase and fix some errors reported. I think this will help to write a better code in the future. I also had to add symfony/cache as a dev dependency, because the test suite was failing: ``` 1) Doctrine2Test: Plain entity Test tests/unit/Codeception/Module/Doctrine2Test.php:testPlainEntity [RuntimeException] Setup tool cannot configure caches without doctrine/cache 1.11 or symfony/cache. Please add an explicit dependency to either library. Codeception#1 /Users/anatoly/PhpstormProjects/module-doctrine2/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Setup.php:184 Codeception#2 /Users/anatoly/PhpstormProjects/module-doctrine2/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Setup.php:160 Codeception#3 /Users/anatoly/PhpstormProjects/module-doctrine2/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Setup.php:139 Codeception#4 /Users/anatoly/PhpstormProjects/module-doctrine2/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Setup.php:87 Codeception#5 /Users/anatoly/PhpstormProjects/module-doctrine2/tests/unit/Codeception/Module/Doctrine2Test.php:73 ```
b1rdex
commented
Jul 20, 2021
TavoNiievez
requested changes
Jul 22, 2021
TavoNiievez
approved these changes
Jul 26, 2021
Member
|
@b1rdex thanks. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The main goal was to provide better param/return types using
class-stringand templates, but I decided to also run PHPStan over the codebase and fix some errors reported. I think this will help to write a better code in the future.I also had to add symfony/cache as a dev dependency, because the test suite was failing: