We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0e3db66 commit 91f3980Copy full SHA for 91f3980
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