psalm-plugin-symfony
psalm-plugin-symfony copied to clipboard
ContainerInterface::get return type could be dynamic, based on second argument.
The containerInterface has the following doc
/**
* Gets a service.
*
* @param string $id The service identifier
* @param int $invalidBehavior The behavior when the service does not exist
*
* @return object|null The associated service
*
* @throws ServiceCircularReferenceException When a circular reference is detected
* @throws ServiceNotFoundException When the service is not defined
*
* @see Reference
*/
public function get($id, int $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE);
When using self::EXCEPTION_ON_INVALID_REFERENCE, the return type should be restricted to object.