Skip to content
Permalink
Browse files

Add support for doubly-extended non-template params

  • Loading branch information...
muglug committed Jun 25, 2019
1 parent 9d998bf commit 5cb6fe14d7902abcb0a57884834a2193f3afa1d0
@@ -732,6 +732,11 @@ function (PhpParser\Node\Arg $arg) {
$found_generic_params[$type_key][$template_fq_class_name] = [
$found_generic_params[$t->param_name][$t->defining_class ?: ''][0]
];
} else {
$found_generic_params[$type_key][$template_fq_class_name] = [
clone $extended_type
];
break;
}
}
}
@@ -2170,6 +2170,31 @@ public function getValue()
}
}',
],
'extendsArryObjectGetIterator' => [
'<?php
class Obj {}
/**
* @template T1
* @template-extends ArrayObject<int, T1>
*/
class Collection extends ArrayObject {}
/**
* @template T2 as Obj
* @template-extends Collection<T2>
*/
class Collection2 extends Collection {
/**
* called to get the collection ready when we go to loop through it
*
* @return \ArrayIterator<int, T2>
*/
public function getIterator() {
return parent::getIterator();
}
}'
],
];
}

0 comments on commit 5cb6fe1

Please sign in to comment.
You can’t perform that action at this time.