Skip to content

Commit b1e8552

Browse files
committed
Address PHP 8.1 deprecations
1 parent 6f94df7 commit b1e8552

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/docopt.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -876,7 +876,7 @@ public function __construct($source, $error='ExitException')
876876
public static function fromPattern($source)
877877
{
878878
$source = preg_replace('@([\[\]\(\)\|]|\.\.\.)@', ' $1 ', $source);
879-
$source = preg_split('@\s+|(\S*<.*?'.'>)@', $source, null, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
879+
$source = preg_split('@\s+|(\S*<.*?'.'>)@', $source, 0, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
880880

881881
return new static($source, 'LanguageError');
882882
}
@@ -1412,26 +1412,31 @@ public function __get($name)
14121412
}
14131413
}
14141414

1415+
#[\ReturnTypeWillChange]
14151416
public function offsetExists($offset)
14161417
{
14171418
return isset($this->args[$offset]);
14181419
}
14191420

1421+
#[\ReturnTypeWillChange]
14201422
public function offsetGet($offset)
14211423
{
14221424
return $this->args[$offset];
14231425
}
14241426

1427+
#[\ReturnTypeWillChange]
14251428
public function offsetSet($offset, $value)
14261429
{
14271430
$this->args[$offset] = $value;
14281431
}
14291432

1433+
#[\ReturnTypeWillChange]
14301434
public function offsetUnset($offset)
14311435
{
14321436
unset($this->args[$offset]);
14331437
}
14341438

1439+
#[\ReturnTypeWillChange]
14351440
public function getIterator()
14361441
{
14371442
return new \ArrayIterator($this->args);

0 commit comments

Comments
 (0)