Skip to content

Commit 884b335

Browse files
committed
Fixed types for PHP 7.1.
1 parent 6e137c3 commit 884b335

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/DocBlockParser.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ protected function parseComment(string $comment): void
128128
else
129129
{
130130
// This block is tagged
131-
$tag = \substr(self::strTag($body), 1);
131+
$tag = (string)\substr(self::strTag($body), 1);
132132
$body = \ltrim((string)\substr($body, \strlen($tag) + 2));
133133

134134
if (isset(self::$vectors[$tag])) {
@@ -226,14 +226,14 @@ public static function isTagged(string $str): bool
226226
*
227227
* @param string $str
228228
*
229-
* @return string|null
229+
* @return string
230230
*/
231-
public static function strTag(string $str): ?string
231+
public static function strTag(string $str): string
232232
{
233233
if (\preg_match('/^@[a-z0-9_]+/', $str, $matches)) {
234-
return $matches[0];
234+
return (string)$matches[0];
235235
}
236236

237-
return null;
237+
return '';
238238
}
239239
}

0 commit comments

Comments
 (0)