Started to increase the phpstan level

This commit is contained in:
Jan Böhmer 2023-06-13 10:36:34 +02:00
parent 71cd4057a7
commit fc3290271c
29 changed files with 119 additions and 55 deletions

View file

@ -40,8 +40,8 @@ class EntityConstraint extends AbstractConstraint
* @param class-string<T> $class
* @param string $property
* @param string|null $identifier
* @param null $value
* @param string $operator
* @param null|T $value
* @param string|null $operator
*/
public function __construct(protected ?NodesListBuilder $nodesListBuilder,
protected string $class,
@ -82,9 +82,10 @@ class EntityConstraint extends AbstractConstraint
}
/**
* @param T|null $value
* @param AbstractDBElement|null $value
* @phpstan-param T|null $value
*/
public function setValue(?AbstractDBElement $value): void
public function setValue(AbstractDBElement|null $value): void
{
if (!$value instanceof $this->class) {
throw new \InvalidArgumentException('The value must be an instance of ' . $this->class);

View file

@ -29,7 +29,7 @@ trait FilterTrait
protected bool $useHaving = false;
public function useHaving($value = true): self
public function useHaving($value = true): static
{
$this->useHaving = $value;
return $this;

View file

@ -85,6 +85,7 @@ class PartFilter implements FilterInterface
protected IntConstraint $attachmentsCount;
protected EntityConstraint $attachmentType;
protected TextConstraint $attachmentName;
/** @var ArrayCollection<int, ParameterConstraint> */
protected ArrayCollection $parameters;
protected IntConstraint $parametersCount;