mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-24 10:49:00 +02:00
Started to increase the phpstan level
This commit is contained in:
parent
71cd4057a7
commit
fc3290271c
29 changed files with 119 additions and 55 deletions
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue