From 45941c67dd0505dab2fb970786d93055b7cbd2b6 Mon Sep 17 00:00:00 2001 From: Oliver Klee Date: Sun, 15 Oct 2023 20:01:28 +0200 Subject: [PATCH] Make the type annotation for CompositeExpression::count more specific (#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. --- src/Query/Expression/CompositeExpression.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Query/Expression/CompositeExpression.php b/src/Query/Expression/CompositeExpression.php index de1d929a0d0..4cad8ec1d5a 100644 --- a/src/Query/Expression/CompositeExpression.php +++ b/src/Query/Expression/CompositeExpression.php @@ -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()