[12.x] Refactor: improve doc block#58677
Merged
taylorotwell merged 1 commit intolaravel:12.xfrom Feb 7, 2026
Merged
Conversation
shaedrich
reviewed
Feb 7, 2026
| * @param int $to | ||
| * @param int $step | ||
| * @return static<int, int> | ||
| * @return ($step is zero ? never : static<int, int>) |
Contributor
There was a problem hiding this comment.
This is what PHPStan has to say:
Condition "int is zero" in conditional return type is always false.
Method LazyCollection::range() has invalid return type zero.
https://phpstan.org/r/fe45d051-2850-4c2d-a04d-f359f58956f6
These are the supported integer ranges:
positive-intnegative-intnon-positive-intnon-negative-intnon-zero-intint<0, 100>int<min, 100>int<50, max>
Similar to how strings can be a non-empty-string but not an empty-string, as they can be typed with a single literal: ''
Suggested change
| * @return ($step is zero ? never : static<int, int>) | |
| * @return ($step is 0 ? never : static<int, int>) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
add
@throwsand modify@returnfor this line: