From d492b7cf973c4a7ae8bc8c50a07548a9ff71566a Mon Sep 17 00:00:00 2001 From: Oleksandr Oliinyk Date: Sat, 3 Feb 2024 02:47:48 +0200 Subject: [PATCH 1/2] fix: for laravel-ide-helper's 1505 issue; the problem: param's generic type and description cancel out one another which looses description; --- src/Barryvdh/Reflection/DocBlock/Tag/ParamTag.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Barryvdh/Reflection/DocBlock/Tag/ParamTag.php b/src/Barryvdh/Reflection/DocBlock/Tag/ParamTag.php index 78c5aa52..431505ee 100644 --- a/src/Barryvdh/Reflection/DocBlock/Tag/ParamTag.php +++ b/src/Barryvdh/Reflection/DocBlock/Tag/ParamTag.php @@ -49,7 +49,7 @@ public function setContent($content) $parts = preg_split( '/(\s+)/Su', $this->description, - 3, + 4, PREG_SPLIT_DELIM_CAPTURE ); From cc98b15c53603c4f682a99d4f9a22dfadd0e4ffb Mon Sep 17 00:00:00 2001 From: Oleksandr Oliinyk Date: Sun, 4 Feb 2024 14:02:28 +0200 Subject: [PATCH 2/2] test: data cases for the ParamTag's type generics plus description issue; --- .../Reflection/DocBlock/Tag/ParamTagTest.php | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/tests/Barryvdh/Reflection/DocBlock/Tag/ParamTagTest.php b/tests/Barryvdh/Reflection/DocBlock/Tag/ParamTagTest.php index 3fd9e61e..70eee369 100644 --- a/tests/Barryvdh/Reflection/DocBlock/Tag/ParamTagTest.php +++ b/tests/Barryvdh/Reflection/DocBlock/Tag/ParamTagTest.php @@ -114,6 +114,46 @@ public function provideDataForConstructor() array('int'), '$bob', "Type on a new line" + ), + array( + 'param', + "array \$arrayNoGenericsDescription Some text", + 'array', + array('array'), + '$arrayNoGenericsDescription', + "Some text" + ), + array( + 'param', + "array \$arrayGenericsNoDescription", + 'array', + array('array'), + '$arrayGenericsNoDescription', + "" + ), + array( + 'param', + "array \$arrayGenericsNoSpaceDescription Description goes here", + 'array', + array('array'), + '$arrayGenericsNoSpaceDescription', + "Description goes here" + ), + array( + 'param', + "array \$arrayGenericsDescription Description goes here", + 'array', + array('array'), + '$arrayGenericsDescription', + "Description goes here" + ), + array( + 'param', + "array \$arrayGenericsDescription Description multiline\n goes\n here", + 'array', + array('array'), + '$arrayGenericsDescription', + "Description multiline\n goes\n here" ) ); }