Skip to content

Commit bcb963c

Browse files
authored
Merge pull request #30 from mensbeam/master
Address PHP 8.4 deprecation
2 parents 0e3db66 + 91f3980 commit bcb963c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/docopt.php

+5-1
Original file line numberDiff line numberDiff line change
@@ -1455,8 +1455,12 @@ class SingleMatch
14551455
* @param ?int $pos
14561456
* @param Pattern $pattern
14571457
*/
1458-
public function __construct($pos, Pattern $pattern=null)
1458+
public function __construct($pos, $pattern=null)
14591459
{
1460+
if ($pattern !== null && !$pattern instanceof Pattern) {
1461+
throw new \InvalidArgumentException();
1462+
}
1463+
14601464
$this->pos = $pos;
14611465
$this->pattern = $pattern;
14621466
}

0 commit comments

Comments
 (0)