@param $class

@return AbstractApi
@throws InCommonException
181369
protected function getApi($class)
    {
        $class = "\\" . __NAMESPACE__ . "\\Api\\" . $class;

        if ( ! class_exists($class)) {
            throw new InCommonException(sprintf('%s API handler does not exist.', $class));
        }

        if ( ! array_key_exists($class, $this->apis)) {
            $this->apis[$class] = new $class($this->client);
        }

        return $this->apis[$class];
    }
1115378
private function getService($class)
    {
        if (!array_key_exists($class, $this->services)) {
            $this->services[$class] = new $class($this->getClient(), $this->getLogger());
        }

        return $this->services[$class];
    }
23287
function classGetReflection($class) {
    if (array_key_exists($class, $this->classLikesByQcn)) {
      return $this->classLikesByQcn[$class];
    }
    if (class_exists($class, FALSE) || interface_exists($class, FALSE) || trait_exists($class, FALSE)) {
      $reflectionClass = new \ReflectionClass($class);
      $this->initKnownClass($class, $reflectionClass);
    }
    else {
      $this->triggerAutoload($class);
    }
    if (isset($this->classLikesByQcn[$class])) {
      return $this->classLikesByQcn[$class];
    }
    if (array_key_exists($class, $this->classLikesByQcn)) {
      return $this->classLikesByQcn[$class];
    }
    return NULL;
  }
209774
public static function fromClassname($class)
    {
        try {
            if (!class_exists($class)) {
                throw new InvalidArgumentException(sprintf('The class "%s" does not exist', $class));
            }

            return new self(ClassUtils::getRealClass($class), 'class');
        } catch (InvalidArgumentException $e) {
            throw new InvalidSubjectIdentityException($e->getMessage(), 0, $e);
        }
    }
708711
public function map($name, $class = null)
    {
        if (is_array($name)) {
            foreach ($name as $name => $class) {
                $this->map($name, $class);
            }

            return $this;
        }

        $this->builder->addDiscriminatorMapClass($name, $class);

        return $this;
    }
130701
public function loadOne($class = '\\stdClass')
    {
        if (strtolower($class) === 'array') {
            return $this->getReader()->loadArray();
        }

        if (strtolower($class) === 'assoc') {
            return $this->getReader()->loadAssoc();
        }

        return $this->getReader()->loadObject($class);
    }
1255625
public function add($class=null)
	{
		$class = $this->get_class($class);

		if (!isset($this->reflections[$class]))
			$this->reflections[$class] = new ReflectionClass($class);
			
		return $this;
	}
941729
public function load($class, $type = null)
    {
        if (!class_exists($class)) {
            throw new \InvalidArgumentException(sprintf('Class "%s" does not exist.', $class));
        }

        $class = new \ReflectionClass($class);
        if ($class->isAbstract()) {
            throw new \InvalidArgumentException(sprintf('Annotations from class "%s" cannot be read as it is abstract.', $class->getName()));
        }

        $globals = $this->getGlobals($class);

        $collection = new RouteCollection();
        $collection->addResource(new FileResource($class->getFileName()));

        foreach ($class->getMethods() as $method) {
            $this->defaultRouteIndex = 0;
            foreach ($this->reader->getMethodAnnotations($method) as $annot) {
                if ($annot instanceof $this->routeAnnotationClass) {
                    $this->addRoute($collection, $annot, $globals, $class, $method);
                }
            }
        }

        if (0 === $collection->count() && $class->hasMethod('__invoke')) {
            $globals = $this->resetGlobals();
            foreach ($this->reader->getClassAnnotations($class) as $annot) {
                if ($annot instanceof $this->routeAnnotationClass) {
                    $this->addRoute($collection, $annot, $globals, $class, $class->getMethod('__invoke'));
                }
            }
        }

        return $collection;
    }
666798
protected function findFileInApc($class)
    {
        if (false === $file = apc_fetch($this->apc_prefix . $class)) {
            apc_store($this->apc_prefix . $class, $file = $this->findFile($class));
        }

        return $file;
    }
138599
public function getImplements(string $class){
        if(!class_exists($class)){
            throw new \InvalidArgumentException();
        }

        if(false === ($parent = get_parent_class($class))){
            return array_values(array_unique(class_implements($class)));
        }

        return array_values(
            array_unique(
                array_diff(
                    class_implements($class),
                    class_implements($parent)
                )
            )
        );
    }
734528
public function instantiate(string $class, ...$args)
    {
        $refl = $this->reflection->reflectClass($class);

        $dependencyIds = $this->determineDependencies($refl, count($args));
        $dependencies = $args + $this->getDependencies($dependencyIds);

        return $refl->newInstanceArgs($dependencies);
    }
1067878
private function getObjectMapping(string $class): NormalizationObjectMappingInterface
    {
        try {
            return $this->normalizerObjectMappingRegistry->getObjectMapping($class);
        } catch (SerializerLogicException $exception) {
            $this->logger->error('serialize: {exception}', ['exception' => $exception->getMessage()]);

            throw $exception;
        }
    }
436425
public function inherits($class)
    {
        $delegate = $this->getDelegate();

        if ($delegate instanceof ObjectMixable) {
            $result = $delegate->inherits($class);
        } else {
            $result = $delegate instanceof $class;
        }

        return $result;
    }
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;
    }
1057989
public static function instantiateClassByConstructor($class, $args)
    {
        switch (count($args)) {
            case 0:
                return new $class();
            case 1:
                return new $class($args[0]);
            case 2:
                return new $class($args[0], $args[1]);
            case 3:
                return new $class($args[0], $args[1], $args[2]);
            case 4:
                return new $class($args[0], $args[1], $args[2], $args[3]);
            default:
                $rClass = new \ReflectionClass($class);
                return $rClass->newInstanceArgs($args);
        }
    }
727209
protected function instantiator(string $class): InstantiatorInterface
    {
        if (isset($this->instantiators[$class])) {
            return $this->instantiators[$class];
        }

        //Potential optimization
        $instantiator = $this->getFactory()->make(
            $this->define($class, self::R_INSTANTIATOR),
            [
                'class'  => $class,
                'orm'    => $this,
                'schema' => $this->define($class, self::R_SCHEMA)
            ]
        );

        //Constructing instantiator and storing it in cache
        return $this->instantiators[$class] = $instantiator;
    }
1106650
public static function throwOnRequiredClass($class)
    {
        $e = new \ReflectionException("Class $class does not exist");
        $trace = $e->getTrace();
        $autoloadFrame = [
            'function' => 'spl_autoload_call',
            'args' => [$class],
        ];
        $i = 1 + array_search($autoloadFrame, $trace, true);

        if (isset($trace[$i]['function']) && !isset($trace[$i]['class'])) {
            switch ($trace[$i]['function']) {
                case 'get_class_methods':
                case 'get_class_vars':
                case 'get_parent_class':
                case 'is_a':
                case 'is_subclass_of':
                case 'class_exists':
                case 'class_implements':
                case 'class_parents':
                case 'trait_exists':
                case 'defined':
                case 'interface_exists':
                case 'method_exists':
                case 'property_exists':
                case 'is_callable':
                    return;
            }
        }

        throw $e;
    }