Skip to content

Commit

Permalink
Add missing parameter to countBy method reflection
Browse files Browse the repository at this point in the history
  • Loading branch information
sascha-egerer committed Jan 31, 2022
1 parent 2887760 commit a809882
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Reflection/RepositoryCountByMethodReflection.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
54 changes: 54 additions & 0 deletions src/Reflection/RepositoryCountByParameterReflection.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<?php declare(strict_types = 1);

namespace SaschaEgerer\PhpstanTypo3\Reflection;

use PHPStan\Reflection\ParameterReflection;
use PHPStan\Reflection\PassedByReference;
use PHPStan\Type\Type;

class RepositoryCountByParameterReflection implements ParameterReflection
{

/** @var string */
private $name;

/** @var Type */
private $type;

public function __construct(string $name, Type $type)
{
$this->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;
}

}

0 comments on commit a809882

Please sign in to comment.