Skip to content

Commit 9f29894

Browse files
committed
Fixed phpstan issues
1 parent 8efc1ab commit 9f29894

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

src/Entity/Parameters/AbstractParameter.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ abstract class AbstractParameter extends AbstractNamedDBElement implements Uniqu
124124
/**
125125
* @var float|null the guaranteed minimum value of this property
126126
*/
127-
#[Assert\Type(['float', null])]
127+
#[Assert\Type(['float', 'null'])]
128128
#[Assert\LessThanOrEqual(propertyPath: 'value_typical', message: 'parameters.validator.min_lesser_typical')]
129129
#[Assert\LessThan(propertyPath: 'value_max', message: 'parameters.validator.min_lesser_max')]
130130
#[Groups(['full', 'parameter:read', 'parameter:write', 'import'])]
@@ -134,15 +134,15 @@ abstract class AbstractParameter extends AbstractNamedDBElement implements Uniqu
134134
/**
135135
* @var float|null the typical value of this property
136136
*/
137-
#[Assert\Type([null, 'float'])]
137+
#[Assert\Type(['null', 'float'])]
138138
#[Groups(['full', 'parameter:read', 'parameter:write', 'import'])]
139139
#[ORM\Column(type: Types::FLOAT, nullable: true)]
140140
protected ?float $value_typical = null;
141141

142142
/**
143143
* @var float|null the maximum value of this property
144144
*/
145-
#[Assert\Type(['float', null])]
145+
#[Assert\Type(['float', 'null'])]
146146
#[Assert\GreaterThanOrEqual(propertyPath: 'value_typical', message: 'parameters.validator.max_greater_typical')]
147147
#[Groups(['full', 'parameter:read', 'parameter:write', 'import'])]
148148
#[ORM\Column(type: Types::FLOAT, nullable: true)]
@@ -461,7 +461,7 @@ protected function formatWithUnit(float $value, string $format = '%g', bool $wit
461461

462462
return $str;
463463
}
464-
464+
465465
/**
466466
* Returns the class of the element that is allowed to be associated with this attachment.
467467
* @return string

src/Form/InfoProviderSystem/ProviderSelectType.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,9 @@ public function configureOptions(OptionsResolver $resolver): void
7272
$resolver->setDefault('choice_label', function (Options $options){
7373
if ('object' === $options['input']) {
7474
return ChoiceList::label($this, static fn (?InfoProviderInterface $choice) => new StaticMessage($choice?->getProviderInfo()['name']));
75-
} else {
76-
return static fn ($choice, $key, $value) => new StaticMessage($key);
7775
}
7876

79-
return null;
77+
return static fn ($choice, $key, $value) => new StaticMessage($key);
8078
});
8179
$resolver->setDefault('choice_value', function (Options $options) {
8280
if ('object' === $options['input']) {

0 commit comments

Comments
 (0)