public static function callInjects(DI\Container $container, $service)
{
if (!is_object($service)) {
throw new Nette\InvalidArgumentException(sprintf('Service must be object, %s given.', gettype($service)));
}
foreach (self::getInjectMethods($service) as $method) {
$container->callMethod([$service, $method]);
}
foreach (self::getInjectProperties(get_class($service)) as $property => $type) {
self::checkType($service, $property, $type, $container);
$service->{$property} = $container->getByType($type);
}
}