Skip to content

Declare strict types #375

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

Merged
merged 9 commits into from
Jan 6, 2020
Merged

Declare strict types #375

merged 9 commits into from
Jan 6, 2020

Conversation

gmponos
Copy link
Contributor

@gmponos gmponos commented Dec 27, 2019

I could also add it as a php-cs rule but checking travis I saw that you don't check the code against php-cs

@gmponos
Copy link
Contributor Author

gmponos commented Dec 27, 2019

Ah!.. you use pretty ci... ok.. so shall I add it? if I do I will need to enable risky rules.

Copy link
Collaborator

@dbu dbu left a comment

Choose a reason for hiding this comment

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

thanks, this looks good! yeah please enable the style-ci rules for it. it won't automatically change code, so i am not too worried about "risky" rules.

@@ -1,3 +1,4 @@
/.phpunit.result.cache
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added this also on this PR.

@gmponos
Copy link
Contributor Author

gmponos commented Dec 27, 2019

Done.

Copy link
Member

@Nyholm Nyholm left a comment

Choose a reason for hiding this comment

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

Thank you.

What are the benefits of having declare(strict_types=1)?

@gmponos
Copy link
Contributor Author

gmponos commented Dec 27, 2019

What are the benefits of having declare(strict_types=1)?

I guess today none.. but why not having it?

@Nyholm
Copy link
Member

Nyholm commented Dec 27, 2019

but why not having it?

Because if we made one small mistake, everything will break horribly. =)

@gmponos
Copy link
Contributor Author

gmponos commented Dec 27, 2019

Because if we made one small mistake, everything will break horribly. =)

Ah.. I got to admit that you have a point and better safe than sorry.. then may I suggest in order not to get all the work lost.. to leave it for tests and interfaces? or you want to disable except if you want to have a php-cs rule for having it removed.

@dbu
Copy link
Collaborator

dbu commented Dec 27, 2019

i would be for having the strict types. if we do have mistakes, people will tell us, and we can fix them. more likely, other people have mistakes and can notice and fix them. non-strictness essentially hides issues. i would see this in a new minor version, not as a patch release.

most code in the bundle is not interacted with by the user, but is about the collector and factories and such.

@dbu
Copy link
Collaborator

dbu commented Jan 6, 2020

@Nyholm are you ok if we merge this? afaik it should only cause BC breaks if we have programming errors in our code, and if we do we rather know and fix them than ignoring the problem.

@Nyholm
Copy link
Member

Nyholm commented Jan 6, 2020

Fair. @gmponos, can you make sure the ci is green

@dbu
Copy link
Collaborator

dbu commented Jan 6, 2020

also needs a rebase on master again, to solve conflicts :-/

Copy link
Collaborator

@dbu dbu left a comment

Choose a reason for hiding this comment

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

thanks!

@dbu dbu merged commit fb7b473 into php-http:master Jan 6, 2020
@gmponos gmponos deleted the declare-strict branch January 6, 2020 11:18
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.

3 participants