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

fix cs and alot of phpstan warnings, add more types #333

Merged
merged 12 commits into from
May 17, 2020
Merged

Conversation

Tobion
Copy link
Member

@Tobion Tobion commented May 13, 2020

No description provided.

@Tobion Tobion changed the title fix cs and phpstan, remove unused make config fix cs and alot of phpstan warnings, add more types to functions and static methods May 14, 2020
@Tobion Tobion force-pushed the fix-analysis branch 2 times, most recently from bc13f5d to 5be7a3a Compare May 15, 2020 20:39
@Tobion Tobion requested a review from sagikazarmark May 15, 2020 20:41
this is safe as either users use strict types and the php functions like fopen() would throw a TypeError anyway or they don't use strict types and params will be casted automatically
@gmponos
Copy link
Member

gmponos commented May 16, 2020

Did you apply all these by hand?

Some of these might be worth to be applied through php-cs-fixer...

some examples:

  • short willReturns on tests
  • useless inherit doc
  • Correct Indentation of phpdocs

and maybe more..

extra resource: https://mlocati.github.io/php-cs-fixer-configurator/#version:2.16

@Tobion
Copy link
Member Author

Tobion commented May 16, 2020

Yes all done by hand. There were also alot of minor errors like return mocks for methods that shouldn't return or wrong return types.

src/PumpStream.php Outdated Show resolved Hide resolved
this is safe due to phps contravariant return type rules
phpstan-baseline.neon Outdated Show resolved Hide resolved
src/MultipartStream.php Outdated Show resolved Hide resolved
@Tobion Tobion changed the title fix cs and alot of phpstan warnings, add more types to functions and static methods fix cs and alot of phpstan warnings, add more types May 17, 2020
Copy link
Member

@gmponos gmponos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There might be more changes or PHPStan issues that we might be able to fix.. but as a first PR it LGTM at this state.

@Tobion Tobion merged commit a7563ee into master May 17, 2020
@Tobion Tobion deleted the fix-analysis branch May 17, 2020 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants