Skip to content

Commit da5274b

Browse files
committed
Refactor ParamChecker to return validation error immediately instead of logging
1 parent a9b0f5f commit da5274b

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎src/Internal/Checker/ParamChecker.php‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ public static function checkParams(
9696
foreach ($contract['types'] as $paramName => $typeNode) {
9797
if (\array_key_exists($paramName, $vars)) {
9898
$err = $registry->validate($vars[$paramName], $typeNode, $effectiveFunction . '(): Argument $' . $paramName);
99-
if (str_contains($effectiveFunction, 'ConstKeyContainer') || str_contains($effectiveFunction, 'OffsetAccessContainer')) {
100-
fwrite(STDERR, " - validate result: " . ($err ? 'ERROR: ' . $err->getMessage() : 'NULL (PASSED)') . "\n");
99+
if ($err !== null) {
100+
return $err;
101101
}
102102
}
103103
}

0 commit comments

Comments
 (0)