diff --git a/src/DocBlock/Tags/Method.php b/src/DocBlock/Tags/Method.php index ff50dd2..e20559e 100644 --- a/src/DocBlock/Tags/Method.php +++ b/src/DocBlock/Tags/Method.php @@ -101,8 +101,9 @@ final class Method extends BaseTag implements Factory\StaticMethod // 5. then a word with underscores, followed by ( and any character // until a ) and whitespace : as method name with signature // 6. any remaining text : as description - if (!preg_match( - '/^ + if ( + !preg_match( + '/^ # Static keyword # Declares a static method ONLY if type is also present (?: @@ -132,9 +133,10 @@ final class Method extends BaseTag implements Factory\StaticMethod # Description (.*) $/sux', - $body, - $matches - )) { + $body, + $matches + ) + ) { return null; } diff --git a/src/DocBlock/Tags/Source.php b/src/DocBlock/Tags/Source.php index 7d5f094..8b8c0fb 100644 --- a/src/DocBlock/Tags/Source.php +++ b/src/DocBlock/Tags/Source.php @@ -70,7 +70,7 @@ final class Source extends BaseTag implements Factory\StaticMethod $description = $matches[3]; } - return new static($startingLine, $lineCount, $descriptionFactory->create($description??'', $context)); + return new static($startingLine, $lineCount, $descriptionFactory->create($description ?? '', $context)); } /** diff --git a/src/Exception/PcreException.php b/src/Exception/PcreException.php index 31d79e3..b8b6da8 100644 --- a/src/Exception/PcreException.php +++ b/src/Exception/PcreException.php @@ -21,14 +21,19 @@ final class PcreException extends InvalidArgumentException switch ($errorCode) { case PREG_BACKTRACK_LIMIT_ERROR: return new self('Backtrack limit error'); + case PREG_RECURSION_LIMIT_ERROR: return new self('Recursion limit error'); + case PREG_BAD_UTF8_ERROR: return new self('Bad UTF8 error'); + case PREG_BAD_UTF8_OFFSET_ERROR: return new self('Bad UTF8 offset error'); + case PREG_JIT_STACKLIMIT_ERROR: return new self('Jit stacklimit error'); + case PREG_NO_ERROR: case PREG_INTERNAL_ERROR: default: