Open
Description
Hi,
Maybe it would be useful to add this small modification to Phalcon\Di\DiInterface
and Phalcon\Di\Di
class?
/**
* @template T
* @param string|class-string<T> $name
* @param mixed $parameters
* @return mixed|T
*/
public function get(string $name, $parameters = null): mixed
{
…
}
having this modified, it is possible to use IDE completion hints, if registered a service using class-string:
$di->set(MyClassInterface::class, MyClass::class);
$di->get(MyClassInterface::class)->…here method completion hints from IDE should appear…
I've prepared a PoC in related PR, but since changes should be done in Zephir I'm not sure how to obtain this: doc-block in Zephir looks a bit different.
What do you think about this change?
Metadata
Metadata
Assignees
Labels
No labels