We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
In the current codebase of CustomerBank the getter for default looks like:
public function getDefault() : bool { return $this->default; }
This requires $this->default to be a boolean. However, the variable is not initialized, so the following (simplified) code results in an error:
$this->default
$bank = New CustomerBank(); $bank->getDefault();
I know requesting getDefault()on a new object seems strange but it feels off to have invalid values on an object that has just been initialized.
getDefault()
A solution could be to initialize $this->default to false or to allow a null by changing the definition to public function getDefault() : ?bool.
false
null
public function getDefault() : ?bool
I'm wondering what your opinion is on this.
The text was updated successfully, but these errors were encountered:
Your mentioned solutions with a nullable bool is included in PR #142
Sorry, something went wrong.
No branches or pull requests
In the current codebase of CustomerBank the getter for default looks like:
This requires
$this->default
to be a boolean. However, the variable is not initialized, so the following (simplified) code results in an error:I know requesting
getDefault()
on a new object seems strange but it feels off to have invalid values on an object that has just been initialized.A solution could be to initialize
$this->default
tofalse
or to allow anull
by changing the definition topublic function getDefault() : ?bool
.I'm wondering what your opinion is on this.
The text was updated successfully, but these errors were encountered: