Skip to content

Commit

Permalink
Merge pull request #279 from finiteinfinity/fix_property_typehints
Browse files Browse the repository at this point in the history
Use preg_replace rather than str_replace
  • Loading branch information
finiteinfinity authored May 10, 2024
2 parents 4438db1 + 8f2313c commit 7f8f377
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Coders/Model/Factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ private function shortenAndExtractImportableDependencies(&$placeholder, $model)
}

$importableDependencies[trim($usedClass, '\\')] = true;
$placeholder = str_replace($usedClass, $className, $placeholder);
$placeholder = preg_replace('!'.addslashes($usedClass).'\b!', addslashes($className), $placeholder, 1);
}
}

Expand Down

0 comments on commit 7f8f377

Please sign in to comment.