1919use phpDocumentor \Reflection \DocBlock \Tags \Deprecated ;
2020use phpDocumentor \Reflection \DocBlock \Tags \Factory \StaticMethod ;
2121use phpDocumentor \Reflection \DocBlock \Tags \Generic ;
22+ use phpDocumentor \Reflection \DocBlock \Tags \InvalidTag ;
2223use phpDocumentor \Reflection \DocBlock \Tags \Link as LinkTag ;
2324use phpDocumentor \Reflection \DocBlock \Tags \Method ;
2425use phpDocumentor \Reflection \DocBlock \Tags \Param ;
@@ -138,7 +139,7 @@ public function __construct(FqsenResolver $fqsenResolver, ?array $tagHandlers =
138139 /**
139140 * {@inheritDoc}
140141 */
141- public function create (string $ tagLine , ?TypeContext $ context = null ) : ? Tag
142+ public function create (string $ tagLine , ?TypeContext $ context = null ) : Tag
142143 {
143144 if (!$ context ) {
144145 $ context = new TypeContext ('' );
@@ -215,7 +216,7 @@ private function extractTagParts(string $tagLine) : array
215216 * Creates a new tag object with the given name and body or returns null if the tag name was recognized but the
216217 * body was invalid.
217218 */
218- private function createTag (string $ body , string $ name , TypeContext $ context ) : ? Tag
219+ private function createTag (string $ body , string $ name , TypeContext $ context ) : Tag
219220 {
220221 $ handlerClassName = $ this ->findHandlerClassName ($ name , $ context );
221222 $ arguments = $ this ->getArgumentsForParametersFromWiring (
@@ -228,7 +229,7 @@ private function createTag(string $body, string $name, TypeContext $context) : ?
228229 $ callable = [$ handlerClassName , 'create ' ];
229230 return call_user_func_array ($ callable , $ arguments );
230231 } catch (InvalidArgumentException $ e ) {
231- return null ;
232+ return InvalidTag:: create ( $ body , $ name )-> withError ( $ e ) ;
232233 }
233234 }
234235
0 commit comments