From 6487af46e77a3beca9e88c01ff094da5ab9201c7 Mon Sep 17 00:00:00 2001 From: Human HUMANOV Date: Thu, 7 Mar 2024 17:04:03 +0100 Subject: [PATCH] Add support for casting a namespaced class to a string. Fixes BrianHenryIE/strauss#88 --- src/Prefixer.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Prefixer.php b/src/Prefixer.php index 30ed6346..a1b1d3cd 100644 --- a/src/Prefixer.php +++ b/src/Prefixer.php @@ -202,6 +202,7 @@ public function replaceNamespace(string $contents, string $originalNamespace, st |\[\s* # In a square array |\?\s* # In a ternary operator |:\s* # In a ternary operator + |\(string\)\s* # casting a namespaced class to a string ) (? {$searchNamespace} # followed by the namespace to replace