mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-12-06 02:59:29 +00:00
Fixed phpstan issues
This commit is contained in:
parent
8efc1ab07d
commit
9f2989444a
2 changed files with 5 additions and 7 deletions
|
|
@ -124,7 +124,7 @@ abstract class AbstractParameter extends AbstractNamedDBElement implements Uniqu
|
|||
/**
|
||||
* @var float|null the guaranteed minimum value of this property
|
||||
*/
|
||||
#[Assert\Type(['float', null])]
|
||||
#[Assert\Type(['float', 'null'])]
|
||||
#[Assert\LessThanOrEqual(propertyPath: 'value_typical', message: 'parameters.validator.min_lesser_typical')]
|
||||
#[Assert\LessThan(propertyPath: 'value_max', message: 'parameters.validator.min_lesser_max')]
|
||||
#[Groups(['full', 'parameter:read', 'parameter:write', 'import'])]
|
||||
|
|
@ -134,7 +134,7 @@ abstract class AbstractParameter extends AbstractNamedDBElement implements Uniqu
|
|||
/**
|
||||
* @var float|null the typical value of this property
|
||||
*/
|
||||
#[Assert\Type([null, 'float'])]
|
||||
#[Assert\Type(['null', 'float'])]
|
||||
#[Groups(['full', 'parameter:read', 'parameter:write', 'import'])]
|
||||
#[ORM\Column(type: Types::FLOAT, nullable: true)]
|
||||
protected ?float $value_typical = null;
|
||||
|
|
@ -142,7 +142,7 @@ abstract class AbstractParameter extends AbstractNamedDBElement implements Uniqu
|
|||
/**
|
||||
* @var float|null the maximum value of this property
|
||||
*/
|
||||
#[Assert\Type(['float', null])]
|
||||
#[Assert\Type(['float', 'null'])]
|
||||
#[Assert\GreaterThanOrEqual(propertyPath: 'value_typical', message: 'parameters.validator.max_greater_typical')]
|
||||
#[Groups(['full', 'parameter:read', 'parameter:write', 'import'])]
|
||||
#[ORM\Column(type: Types::FLOAT, nullable: true)]
|
||||
|
|
|
|||
|
|
@ -72,11 +72,9 @@ class ProviderSelectType extends AbstractType
|
|||
$resolver->setDefault('choice_label', function (Options $options){
|
||||
if ('object' === $options['input']) {
|
||||
return ChoiceList::label($this, static fn (?InfoProviderInterface $choice) => new StaticMessage($choice?->getProviderInfo()['name']));
|
||||
} else {
|
||||
return static fn ($choice, $key, $value) => new StaticMessage($key);
|
||||
}
|
||||
|
||||
return null;
|
||||
return static fn ($choice, $key, $value) => new StaticMessage($key);
|
||||
});
|
||||
$resolver->setDefault('choice_value', function (Options $options) {
|
||||
if ('object' === $options['input']) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue