We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 0e3db66 + 91f3980 commit bcb963cCopy full SHA for bcb963c
1 file changed
src/docopt.php
@@ -1455,8 +1455,12 @@ class SingleMatch
1455
* @param ?int $pos
1456
* @param Pattern $pattern
1457
*/
1458
- public function __construct($pos, Pattern $pattern=null)
+ public function __construct($pos, $pattern=null)
1459
{
1460
+ if ($pattern !== null && !$pattern instanceof Pattern) {
1461
+ throw new \InvalidArgumentException();
1462
+ }
1463
+
1464
$this->pos = $pos;
1465
$this->pattern = $pattern;
1466
}
0 commit comments