Skip to content

Commit

Permalink
typo
Browse files Browse the repository at this point in the history
  • Loading branch information
staabm committed Jul 25, 2024
1 parent 05705ce commit e5aaa14
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Type/Php/RegexArrayShapeMatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -286,13 +286,13 @@ private function buildArrayType(
$countGroups = count($captureGroups);
$i = 0;
foreach ($captureGroups as $captureGroup) {
$isTraillingOptional = $i >= $countGroups - $trailingOptionals;
$isTrailingOptional = $i >= $countGroups - $trailingOptionals;
$groupValueType = $this->getValueType($captureGroup->getType(), $flags);

if (!$wasMatched->yes()) {
$optional = true;
} else {
if (!$isTraillingOptional) {
if (!$isTrailingOptional) {
$optional = false;
if ($this->containsUnmatchedAsNull($flags) && !$captureGroup->isOptional()) {
$groupValueType = TypeCombinator::removeNull($groupValueType);
Expand All @@ -304,7 +304,7 @@ private function buildArrayType(
}
}

if (!$isTraillingOptional && $captureGroup->isOptional() && !$this->containsUnmatchedAsNull($flags)) {
if (!$isTrailingOptional && $captureGroup->isOptional() && !$this->containsUnmatchedAsNull($flags)) {
$groupValueType = TypeCombinator::union($groupValueType, new ConstantStringType(''));
}

Expand Down

0 comments on commit e5aaa14

Please sign in to comment.