Skip to content

Commit 11ab75e

Browse files
committed
Storing Null when optional parameter is not passed
1 parent c75571b commit 11ab75e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Request/RequiredArguments.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ private function setVariable(string $argument, bool $optional = false): void
138138
{
139139
if (strrpos($argument, '\\') === false) {
140140
$VALUE = $this->where[$argument] ?? ($optional ? null : throw new RequiredArgumentMissingException($argument));
141-
if (isset($this->regexArguments[$argument])) {
141+
if (isset($this->regexArguments[$argument]) && isset($this->where[$argument])) {
142142
$this->validateVariable($this->regexArguments[$argument]);
143143
/** @psalm-suppress RiskyCast */
144144
$VALUE = match ($this->regexArguments[$argument]->regexp) {

0 commit comments

Comments
 (0)