Skip to content

Commit 3be9604

Browse files
alamiraultfabpot
authored andcommitted
Remove usage of empty function when possible
1 parent a10bc23 commit 3be9604

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

ChoiceList/Factory/DefaultChoiceListFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public function createView(ChoiceListInterface $list, array|callable $preferredC
7171
$keys = $list->getOriginalKeys();
7272

7373
if (!\is_callable($preferredChoices)) {
74-
if (empty($preferredChoices)) {
74+
if (!$preferredChoices) {
7575
$preferredChoices = null;
7676
} else {
7777
// make sure we have keys that reflect order

Extension/Core/DataTransformer/ArrayToPartsTransformer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function transform(mixed $array): mixed
3939
$result = [];
4040

4141
foreach ($this->partMapping as $partKey => $originalKeys) {
42-
if (empty($array)) {
42+
if (!$array) {
4343
$result[$partKey] = null;
4444
} else {
4545
$result[$partKey] = array_intersect_key($array, array_flip($originalKeys));

FormRegistry.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ public function getTypeGuesser(): ?FormTypeGuesserInterface
152152
}
153153
}
154154

155-
$this->guesser = !empty($guessers) ? new FormTypeGuesserChain($guessers) : null;
155+
$this->guesser = $guessers ? new FormTypeGuesserChain($guessers) : null;
156156
}
157157

158158
return $this->guesser;

0 commit comments

Comments
 (0)