Skip to content

Commit

Permalink
Fix 111 – update generic class type in doc
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianHenryIE committed Nov 12, 2024
1 parent b37f9e1 commit e05eb33
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/Pipeline/Prefixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.

Expand Down
4 changes: 2 additions & 2 deletions tests/Issues/StraussIssue111Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

0 comments on commit e05eb33

Please sign in to comment.