Skip to content

Commit 4f16a9e

Browse files
committed
Merge branch '5.3' into 5.4
* 5.3: Simplify some code with null coalesce operator Don't use deprecated TestLogger class
2 parents cb8fcbb + a489156 commit 4f16a9e

File tree

3 files changed

+4
-8
lines changed

3 files changed

+4
-8
lines changed

Constraints/File.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,10 +163,10 @@ private function normalizeBinaryFormat($maxSize)
163163
];
164164
if (ctype_digit((string) $maxSize)) {
165165
$this->maxSize = (int) $maxSize;
166-
$this->binaryFormat = null === $this->binaryFormat ? false : $this->binaryFormat;
166+
$this->binaryFormat = $this->binaryFormat ?? false;
167167
} elseif (preg_match('/^(\d++)('.implode('|', array_keys($factors)).')$/i', $maxSize, $matches)) {
168168
$this->maxSize = $matches[1] * $factors[$unit = strtolower($matches[2])];
169-
$this->binaryFormat = null === $this->binaryFormat ? 2 === \strlen($unit) : $this->binaryFormat;
169+
$this->binaryFormat = $this->binaryFormat ?? (2 === \strlen($unit));
170170
} else {
171171
throw new ConstraintDefinitionException(sprintf('"%s" is not a valid maximum size.', $this->maxSize));
172172
}

Constraints/FileValidator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function validate($value, Constraint $constraint)
6060
$binaryFormat = $constraint->binaryFormat;
6161
} else {
6262
$limitInBytes = $iniLimitSize;
63-
$binaryFormat = null === $constraint->binaryFormat ? true : $constraint->binaryFormat;
63+
$binaryFormat = $constraint->binaryFormat ?? true;
6464
}
6565

6666
[, $limitAsString, $suffix] = $this->factorizeSizes(0, $limitInBytes, $binaryFormat);

Mapping/ClassMetadata.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -384,11 +384,7 @@ public function hasPropertyMetadata(string $property)
384384
*/
385385
public function getPropertyMetadata(string $property)
386386
{
387-
if (!isset($this->members[$property])) {
388-
return [];
389-
}
390-
391-
return $this->members[$property];
387+
return $this->members[$property] ?? [];
392388
}
393389

394390
/**

0 commit comments

Comments
 (0)