Skip to content

Commit 8fcadfe

Browse files
committed
No longer bubble tag exceptions to the top
When a tag has an invalid component to it it would cause a whole file to fail to parse. Instead we should consider invalid tags a nuisance but not worth breaking the whole parsing over. In this change I have added a try..catch that will prevent invalid tags from breaking the whole parsing process.
1 parent 4835166 commit 8fcadfe

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/DocBlock/StandardTagFactory.php

+5-1
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,11 @@ private function createTag(string $body, string $name, TypeContext $context): ?T
191191
$this->getServiceLocatorWithDynamicParameters($context, $name, $body)
192192
);
193193

194-
return call_user_func_array([$handlerClassName, 'create'], $arguments);
194+
try {
195+
return call_user_func_array([$handlerClassName, 'create'], $arguments);
196+
} catch (\InvalidArgumentException $e) {
197+
return null;
198+
}
195199
}
196200

197201
/**

0 commit comments

Comments
 (0)