Skip to content

Commit

Permalink
Make the type annotation for CompositeExpression::count more specific (
Browse files Browse the repository at this point in the history
…#6188)

This helps static analysis.

|      Q       |   A
|------------- | -----------
| Type         | improvement
| Fixed issues | (none)

#### Summary

`count` cannot return a negative number. Add a PHPDoc annotation to make
this clear for static analysis.
  • Loading branch information
oliverklee committed Oct 15, 2023
1 parent d3954ec commit 45941c6
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/Query/Expression/CompositeExpression.php
Expand Up @@ -149,6 +149,7 @@ public function with($part, ...$parts): self
* Retrieves the amount of expressions on composite expression.
*
* @return int
* @psalm-return int<0, max>
*/
#[ReturnTypeWillChange]
public function count()
Expand Down

0 comments on commit 45941c6

Please sign in to comment.