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

Fixed QueryBuilder type hints #3439

Closed
wants to merge 1 commit into from
Closed

Conversation

petrnemec
Copy link

Q A
Type bug
BC Break no
Fixed issues N/A

Summary

Fixed type hints for $firstResult and $maxResults properties

@morozov
Copy link
Member

morozov commented Jan 24, 2019

@petrnemec thank you for the patch. I'm currently working on making the codebase compliant with PHPStan Level 6 and 7 requirements (see the previous changes in #3435 and #3436). Most likely, this will be taken care of by the upcoming changes.

I'm not going to accept these changes right now since they are not enforced by raising PHPStan level requirement.

@@ -107,14 +107,14 @@ class QueryBuilder
/**
* The index of the first result to retrieve.
*
* @var int
* @var int|null
Copy link
Member

Choose a reason for hiding this comment

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

It's not supposed to be nullable. The "non specified" first result is the same as 0.

Copy link
Author

Choose a reason for hiding this comment

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

Default value of property this is null, init value is not set in constructor, so it should be marked as nullable.

Copy link
Member

Choose a reason for hiding this comment

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

The default value should be 0, not null unless it breaks some existing API contract.

Base automatically changed from master to 4.0.x January 22, 2021 07:44
@morozov morozov closed this Jul 26, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants