diff --git a/src/Pipeline/Prefixer.php b/src/Pipeline/Prefixer.php index 35c417c6..8b875e1a 100644 --- a/src/Pipeline/Prefixer.php +++ b/src/Pipeline/Prefixer.php @@ -214,6 +214,7 @@ public function replaceNamespace(string $contents, string $originalNamespace, st |\[\s* # In a square array |\?\s* # In a ternary operator |:\s* # In a ternary operator + |< # In a generic type declaration |\(string\)\s* # casting a namespaced class to a string ) @? # Maybe preceeded by the @ symbol for error suppression @@ -229,6 +230,7 @@ public function replaceNamespace(string $contents, string $originalNamespace, st |' # or single quote |: # or a colon to access a static |\\\\{ + |> # In a generic type declaration (end) ) /Ux"; // U: Non-greedy matching, x: ignore whitespace in pattern. diff --git a/tests/Issues/StraussIssue111Test.php b/tests/Issues/StraussIssue111Test.php index 9835060e..ebca909b 100644 --- a/tests/Issues/StraussIssue111Test.php +++ b/tests/Issues/StraussIssue111Test.php @@ -41,7 +41,7 @@ public function test_phpdoc() $php_string = file_get_contents($this->testsWorkingDir . '/vendor-prefixed/stripe/stripe-php/lib/Payout.php'); - self::assertStringNotContainsString('@throws \Stripe\Exception\ApiErrorException', $php_string); - self::assertStringContainsString('@throws \Strauss\Issue111\Stripe\Exception\ApiErrorException', $php_string); + self::assertStringNotContainsString('@return \Stripe\Collection<\Stripe\Payout> of ApiResources', $php_string); + self::assertStringContainsString('@return \Strauss\Issue111\Stripe\Collection<\Strauss\Issue111\Stripe\Payout> of ApiResources', $php_string); } }