Skip to content

Commit 05a6285

Browse files
kalessilnicolas-grekas
authored andcommitted
SCA: consolidate non empty array checks across codebase
1 parent dcc8a46 commit 05a6285

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Constraint.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ public function __construct($options = null)
120120
if (\is_array($options)) {
121121
reset($options);
122122
}
123-
if (\is_array($options) && \count($options) > 0 && \is_string(key($options))) {
123+
if ($options && \is_array($options) && \is_string(key($options))) {
124124
foreach ($options as $option => $value) {
125125
if (array_key_exists($option, $knownOptions)) {
126126
$this->$option = $value;

0 commit comments

Comments
 (0)