Skip to content

Instantly share code, notes, and snippets.

@dasl-
Created October 21, 2019 22:48
Show Gist options
  • Save dasl-/26a33adee63ab8af6ce3dfdb01476309 to your computer and use it in GitHub Desktop.
Save dasl-/26a33adee63ab8af6ce3dfdb01476309 to your computer and use it in GitHub Desktop.
--- from_file
+++ untitled 1
@@ -341,6 +341,7 @@
public static function loadMethodPlugins(CodeBase $code_base) : void
{
$plugin_set = ConfigPluginSet::instance();
+ $codebase_method_set = $code_base->getMethodSet();
foreach ($plugin_set->getReturnTypeOverrides($code_base) as $fqsen_string => $closure) {
try {
if (\stripos($fqsen_string, '::') !== false) {
@@ -353,6 +354,11 @@
if ($code_base->hasMethodWithFQSEN($fqsen)) {
$method = $code_base->getMethodByFQSEN($fqsen);
$method->setDependentReturnTypeClosure($closure);
+ foreach ($codebase_method_set as $codebase_method) {
+ if ($codebase_method->getDefiningFQSEN()->__toString() === $fqsen_string) {
+ $codebase_method->setDependentReturnTypeClosure($closure);
+ }
+ }
}
}
} else {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment