@param string $class

@return HydratorInterface
334553
public function load(string $class): HydratorInterface
    {
        if (isset($this->hydrators[$class])) {
            return $this->hydrators[$class];
        }

        /** @var ClassMetadata $classMetadata */
        $classMetadata = $this->metadataFactory->getMetadataForClass($class);

        if (null === $classMetadata) {
            throw new \RuntimeException(
                'No mapping file was found for class '.$class.
                '. Did you configure the correct paths for serializer?'
            );
        }

        $fqn = $this->configuration->getFQNClassName($classMetadata);

        if (\class_exists($fqn, false)) {
            return $this->hydrators[$class] = $this->factory->newInstance($classMetadata);
        }

        $this->compileAndLoad($classMetadata);

        return $this->hydrators[$class] = $this->factory->newInstance($classMetadata);
    }
1130799
protected function hydrateResponse(ResponseInterface $response, string $class)
    {
        if (null === $this->hydrator) {
            return $response;
        }

        if (200 !== $response->getStatusCode() && 201 !== $response->getStatusCode()) {
            $this->handleErrors($response);
        }

        return $this->hydrator->hydrate($response, $class);
    }
1178657
public function make($class)
    {
        $controller = $this->container->make($class);
        $controller->setServer($this->makeServer());
        $controller->setView($this->makeView());
        $controller->setSession($this->makeSession());
        $controller->setUrlGenerator($this->makeUrlGenerator());

        return $controller;
    }
341936
public function hydrate($templates, $class)
    {
        if (is_array($templates) && !empty($templates)) {
            $availableParameters = array_filter($templates, function ($template) use ($class) {
                return !$class->hasParameterWithName($template->name);
            });
            if (!empty($availableParameters)) {
                $class->setAvailableParameters(array_values($availableParameters));
            }
            foreach ($templates as $template) {
                $parameter = $class->getParameterByName($template->name);
                if ($parameter != null) {
                    $this->groupParameterHydrator->hydrate($template, $parameter);
                }
            }
        }
    }
109605
public function routable($class, $prefix = null)
    {
        $class = $this->resolveRoutableClassValue($class);

        $router = (new RoutableInspector($class))->generateRoutables(null, $prefix);

        $this->mergeRouter($router);

        return $this;
    }
257151
protected function hydrateItem($objectClass, array $item)
    {
        $object = $this->createObjectToHydrate($objectClass);

        if (0 == count($item)) {
            return $object;
        }

        $hydrator = $this->objectManager->getHydratorFor($objectClass);

        return $hydrator->hydrate($item, $object);
    }
1018364
public static function loadByAlias($class)
    {
        if (!isset(self::$classAliases[$class])) {
            foreach (self::$classAliases as $key => $value) {
                if (strlen($key) == strlen($class) && false !== stripos($key, $class)) {
                    $class = $key;
                    break;
                }
            }
        }

        $existsBefore = class_exists($class, false);
        $success = parent::loadByAlias($class);
        if (!$existsBefore && class_exists($class, false)) {
            self::injectStaticDependencies($class);
        }

        return $success;
    }
256095
public function addClass($class)
    {
        if (! $this->hasClass($class)) {
            $this->set('class', trim((string) $this->get('class') . ' ' . $class));
        }

        return $this;
    }
1146648
protected function resolveOnce($class)
    {
        if (isset($this->instances[$class])) {
            return $this->instances[$class];
        }
        $this->instances[$class] = call_user_func($this->container, $class);

        return $this->instances[$class];
    }
1007849
public function addClass(string $class): self
    {
        $classes = explode(' ', $class);

        foreach ($classes as $class) {
            if (!in_array($class, $this->rowClasses)) {
                $this->rowClasses[] = $class;
            }
        }

        return $this;
    }
1122245
public function removeClass($class): self
    {
        $class = Str::toString($class);

        $classes = array_filter(explode(' ', $class), 'strlen');

        $this->classList->remove(...$classes);

        return $this;
    }
577682
public function setIteratorClass($class)
    {
        $reflection = new ReflectionClass($class);
        if (
            !$reflection->implementsInterface('Traversable') &&
            !$reflection->implementsInterface('Iterator')
        ) {
            // The provided class is not an iterator or traversable
            throw new InvalidArgumentException(
                "The class {$class} does not implement Traversable or " .
                "Iterator interfaces"
            );
        }

        $this->_iteratorClass = $class;
        return $this;
    }
1329908
public function create($class) {
        $reflectionClass = new ReflectionClass($class);
        $reflectionMethod = $reflectionClass->getConstructor();
        if (!$reflectionMethod) {
            return new $class;
        }
        $params = &$this->fetchDepsFromSignature($reflectionMethod);
        return $reflectionClass->newInstanceArgs($params);
    }
911555
public function load(string $class)
    {
        $alias = $this->loader;
        if (isset($alias[$class])) {
            class_alias($alias[$class], $class);
        }

        $class = $this->alias($class);
        if (!$this->container->has($class)) {
            return null;
        }

        $instance = $this->container[$class];
        if (is_object($instance)) {
            return $instance;
        }

        return null;
    }
1196462
final public function whereInstanceOf(string $class)
    {
        if ($this->class === $class) {
            return $this;
        }

        if (!is_a($class, $this->class->getClassName(), true)) {
            throw InvalidArgumentException::format(
                'Invalid class supplied to %s: must be an a subclass of %s, %s given',
                __METHOD__, $this->class->getClassName(), $class
            );
        }

        $this->append(new InstanceOfCondition($class));
        
        if (!$this->isOrMode) {
            $this->class = $class::definition();
        }

        return $this;
    }
841691
protected function createInstance(\ReflectionClass $reflectedClass)
    {
        $constructor = $reflectedClass->getConstructor();

        if ($constructor && $constructor->getNumberOfRequiredParameters() > 0) {
            throw new \RuntimeException('Unable to hydrate an object requiring constructor param');
        }

        return $reflectedClass->newInstance();
    }
807117
public function make($class)
    {
        $action = $this->container->make($class);
        $action->setEvents($this->container->make('events'));

        return $action;
    }