From a809882edf43a827bba4c7fb320474b629244613 Mon Sep 17 00:00:00 2001 From: Sascha Egerer Date: Mon, 31 Jan 2022 09:49:29 +0100 Subject: [PATCH] Add missing parameter to countBy method reflection --- .../RepositoryCountByMethodReflection.php | 5 +- .../RepositoryCountByParameterReflection.php | 54 +++++++++++++++++++ 2 files changed, 57 insertions(+), 2 deletions(-) create mode 100644 src/Reflection/RepositoryCountByParameterReflection.php diff --git a/src/Reflection/RepositoryCountByMethodReflection.php b/src/Reflection/RepositoryCountByMethodReflection.php index f90391c..543c891 100644 --- a/src/Reflection/RepositoryCountByMethodReflection.php +++ b/src/Reflection/RepositoryCountByMethodReflection.php @@ -9,6 +9,7 @@ use PHPStan\TrinaryLogic; use PHPStan\Type\Generic\TemplateTypeMap; use PHPStan\Type\IntegerType; +use PHPStan\Type\MixedType; use PHPStan\Type\Type; class RepositoryCountByMethodReflection implements MethodReflection @@ -57,11 +58,11 @@ public function getName(): string } /** - * @return RepositoryFindByParameterReflection[] + * @return array{0: RepositoryCountByParameterReflection} */ public function getParameters(): array { - return []; + return [new RepositoryCountByParameterReflection('arg', new MixedType(\false))]; } public function isVariadic(): bool diff --git a/src/Reflection/RepositoryCountByParameterReflection.php b/src/Reflection/RepositoryCountByParameterReflection.php new file mode 100644 index 0000000..399b494 --- /dev/null +++ b/src/Reflection/RepositoryCountByParameterReflection.php @@ -0,0 +1,54 @@ +name = $name; + $this->type = $type; + } + + public function getName(): string + { + return $this->name; + } + + public function isOptional(): bool + { + return false; + } + + public function getType(): Type + { + return $this->type; + } + + public function isVariadic(): bool + { + return false; + } + + public function passedByReference(): PassedByReference + { + return PassedByReference::createNo(); + } + + public function getDefaultValue(): ?Type + { + return null; + } + +}