From 8fcadfe5f85c38705151c9ab23b4781f23e6a70e Mon Sep 17 00:00:00 2001 From: Mike van Riel Date: Sat, 15 Jun 2019 22:45:01 +0200 Subject: [PATCH] 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. --- src/DocBlock/StandardTagFactory.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/DocBlock/StandardTagFactory.php b/src/DocBlock/StandardTagFactory.php index 2c34994..b466cfc 100644 --- a/src/DocBlock/StandardTagFactory.php +++ b/src/DocBlock/StandardTagFactory.php @@ -191,7 +191,11 @@ final class StandardTagFactory implements TagFactory $this->getServiceLocatorWithDynamicParameters($context, $name, $body) ); - return call_user_func_array([$handlerClassName, 'create'], $arguments); + try { + return call_user_func_array([$handlerClassName, 'create'], $arguments); + } catch (\InvalidArgumentException $e) { + return null; + } } /**