Skip to content

Commit

Permalink
make some shepherd tests to pass
Browse files Browse the repository at this point in the history
  • Loading branch information
ptomulik committed Mar 17, 2023
1 parent 7979ccc commit 0e9f97e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Expand Up @@ -420,8 +420,9 @@ public function start(PhpParser\Node\Stmt\ClassLike $node): ?bool

if ($template_map[1] !== null && $template_map[2] !== null) {
if (trim($template_map[2])) {
$type_string = $template_map[2];
try {
$type_string = CommentAnalyzer::splitDocLine($template_map[2])[0];
$type_string = CommentAnalyzer::splitDocLine($type_string)[0];
} catch (DocblockParseException $e) {
throw new DocblockParseException($type_string . ' is not a valid type: '.$e->getMessage());
}
Expand Down
Expand Up @@ -9,6 +9,7 @@
use Psalm\CodeLocation\DocblockTypeLocation;
use Psalm\Codebase;
use Psalm\Config;
use Psalm\Exception\DocblockParseException;
use Psalm\Exception\InvalidMethodOverrideException;
use Psalm\Exception\TypeParseTreeException;
use Psalm\Internal\Analyzer\CommentAnalyzer;
Expand Down Expand Up @@ -1441,8 +1442,9 @@ private static function handleTemplates(

if ($template_map[1] !== null && $template_map[2] !== null) {
if (trim($template_map[2])) {
$type_string = $template_map[2];
try {
$type_string = CommentAnalyzer::splitDocLine($template_map[2])[0];
$type_string = CommentAnalyzer::splitDocLine($type_string)[0];
} catch (DocblockParseException $e) {
throw new DocblockParseException($type_string . ' is not a valid type: '.$e->getMessage());
}
Expand Down

0 comments on commit 0e9f97e

Please sign in to comment.