Skip to content

Commit 3996def

Browse files
alamiraultfabpot
authored andcommitted
Remove usage of empty function when possible
1 parent 3e5195c commit 3996def

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Annotation/Groups.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function __construct(string|array $groups)
3737
{
3838
$this->groups = (array) $groups;
3939

40-
if (empty($this->groups)) {
40+
if (!$this->groups) {
4141
throw new InvalidArgumentException(sprintf('Parameter of annotation "%s" cannot be empty.', static::class));
4242
}
4343

Normalizer/FormErrorNormalizer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ private function convertFormChildrenToArray(FormInterface $data): array
7272
'errors' => $this->convertFormErrorsToArray($child),
7373
];
7474

75-
if (!empty($child->all())) {
75+
if ($child->all()) {
7676
$childData['children'] = $this->convertFormChildrenToArray($child);
7777
}
7878

0 commit comments

Comments
 (0)