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

Bug in SetOptionsOperation #15

Closed
eugene3141 opened this issue Sep 30, 2022 · 5 comments
Closed

Bug in SetOptionsOperation #15

eugene3141 opened this issue Sep 30, 2022 · 5 comments

Comments

@eugene3141
Copy link

eugene3141 commented Sep 30, 2022

if ($this->masterKeyWeight) {

It's impossible to set masterKeyWeight to 0. It should be

 if ($this->masterKeyWeight !== null) {
   $result->setMasterWeight($this->masterKeyWeight);
 }
@christian-rogobete
Copy link
Contributor

Hello @eugene3141,
thank you for reporting this issue. I fixed it in release 1.0.2

@eugene3141
Copy link
Author

https://onlinephp.io?s=s7EvyCjg5eLlUilLLFKwVTCwBnEy0zTAfEVbhbzSnBxNhWpeLs7U5Ix8BXUDmKA6UGUtqmLsqpGUAwA%2C&v=8.1.11

!= doesn't check type, so int 0 equals null, and the check fails.
It should be !== to force type check.

@christian-rogobete
Copy link
Contributor

thx, it's strange because it worked in my test. I updated it in release 1.0.3.

@eugene3141
Copy link
Author

Thank you.
In the test, you used assertEquals, it also doesn't check type.
assertSame checks type.

@christian-rogobete
Copy link
Contributor

thank you

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

No branches or pull requests

2 participants