Skip to content

Commit 15dd754

Browse files
authored
Merge pull request #2 from PcComponentes/fix/infer-types-with-all
Improve type inference after all() assertions
2 parents efa3890 + 51ce77a commit 15dd754

2 files changed

Lines changed: 18 additions & 0 deletions

File tree

src/BeberleiAssert/AssertionChainTypeSpecifyingExtension.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,15 @@ public function specifyTypes(
107107
$nullOrMode,
108108
'base64' !== $operation['name'],
109109
);
110+
111+
if ($allMode) {
112+
// @phpstan-ignore phpstanApi.method
113+
$currentSpecifiedTypes = AssertHelper::handleAll(
114+
$this->typeSpecifier,
115+
$scope,
116+
$currentSpecifiedTypes,
117+
);
118+
}
110119
} else {
111120
if ($allMode && $this->isSupportedAllNotAssertion($operation['name'])) {
112121
// @phpstan-ignore phpstanApi.method

src/BeberleiAssert/LazyAssertionVerifyNowTypeSpecifyingExtension.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,15 @@ public function specifyTypes(
107107
$nullOrMode,
108108
'base64' !== $operation['name'],
109109
);
110+
111+
if ($allMode) {
112+
// @phpstan-ignore phpstanApi.method
113+
$currentSpecifiedTypes = AssertHelper::handleAll(
114+
$this->typeSpecifier,
115+
$scope,
116+
$currentSpecifiedTypes,
117+
);
118+
}
110119
} elseif ($allMode && $this->isSupportedAllNotAssertion($operation['name'])) {
111120
// @phpstan-ignore phpstanApi.method
112121
$currentSpecifiedTypes = AssertHelper::handleAllNot(

0 commit comments

Comments
 (0)