Try to get a object from the given class.

@param string $lookupClassName The name of the class.

@return null|object

@SuppressWarnings(PHPMD.Superglobals)
@SuppressWarnings(PHPMD.CamelCaseVariableName)
427962
protected function getObjectFromName($lookupClassName)
    {
        // Check if we know this class.
        if (!isset($GLOBALS['METAMODELS']['filters']['perimetersearch']['resolve_class'][$lookupClassName])) {
            return null;
        }

        $reflectionName = $GLOBALS['METAMODELS']['filters']['perimetersearch']['resolve_class'][$lookupClassName];

        $reflection = new \ReflectionClass($reflectionName);

        // Fetch singleton instance.
        if ($reflection->hasMethod('getInstance')) {
            $getInstanceMethod = $reflection->getMethod('getInstance');

            // Create a new instance.
            if ($getInstanceMethod->isStatic()) {
                return $getInstanceMethod->invoke(null);
            }

            return $reflection->newInstance();
        }

        // Create a normal object.
        return $reflection->newInstance();
    }
858492
public JavaClass lookupClass(String className) throws ClassNotFoundException {
        if (classesThatCantBeFound.contains(className)) {
            throw new ClassNotFoundException("Error while looking for class " + className + ": class not found");
        }
        String resourceName = className.replace('.', '/') + ".class";
        InputStream in = null;
        boolean parsedClass = false;

        try {

            in = getInputStreamForResource(resourceName);
            if (in == null) {
                classesThatCantBeFound.add(className);
                throw new ClassNotFoundException("Error while looking for class " + className + ": class not found");
            }

            ClassParser classParser = new ClassParser(in, resourceName);
            JavaClass javaClass = classParser.parse();
            parsedClass = true;

            return javaClass;
        } catch (IOException e) {
            classesThatCantBeFound.add(className);
            throw new ClassNotFoundException("IOException while looking for class " + className, e);
        } finally {
            if (in != null && !parsedClass) {
                try {
                    in.close();
                } catch (IOException ignore) {
                    // Ignore
                }
            }
        }
    }
684235
public static function getClassName($className) {
    if (is_object($className)) $className = self::getClass($className);
    
    $c = $className;
    if (mb_strpos($className,'\\') !== FALSE) {
      $p = explode('\\',$className);
      $c = array_pop($p);
    }
    return $c;
  }
655931
public final function get($className)
   {
       try {
           return $this->cache->get(... func_get_args());
       } catch (NotFoundException $e) {
           try {
               $service = $this->resolver->resolve($className, $this->cache);
           } catch (NotFoundException $e) {
               throw $e;
           } catch (ContainerException $e) {
               throw $e;
           }
       }
       $this->cache->set($className, $service);
       return $this->cache->get($className);
   }
257135
private static function collectAround(string $className, string $methodName)
    {
        if (!isset(self::$aspects[$className])) {
            return null;
        }

        self::$aspects[$className]['advice']['around'] = [$className, $methodName];
    }
596508
public function getJoinOn(string $className): InputObjectType
    {
        /** @var InputObjectType $type */
        $type = $this->getViaFactory($className, 'JoinOn' . Utils::getTypeName($className), $this->joinOnTypeFactory);

        return $type;
    }
154041
private function classGetter($className, $types)
    {
        if (!class_exists($className)) {
            return;
        }

        $obj = $this->get($className);

        foreach ($types as $type) {
            if ($obj instanceof $type) {
                return $obj;
            }
        }
    }
1705
public function getMethodDeclaredReturnType($className, $methodName)
    {
        $className = $this->prepareClassReflectionForUsage($className);
        if (!isset($this->classReflectionData[$className][self::DATA_CLASS_METHODS][$methodName][self::DATA_METHOD_DECLARED_RETURN_TYPE])) {
            return null;
        }

        return $this->classReflectionData[$className][self::DATA_CLASS_METHODS][$methodName][self::DATA_METHOD_DECLARED_RETURN_TYPE];
    }
1271362
public function lookupLocalProxy($lookupName)
    {

        // extract the session bean name from the lookup name
        $beanName = str_replace('/local', '', $lookupName);

        // load the application
        $application = $this->getApplication();

        // load bean and object manager
        $beanManager = $application->search(BeanContextInterface::IDENTIFIER);
        $objectManager = $application->search(ObjectManagerInterface::IDENTIFIER);

        // load the requested session bean
        $sessionBean = $application->search($beanName);

        // load the bean descriptor
        $sessionBeanDescriptor = $objectManager->getObjectDescriptors()->get(get_class($sessionBean));

        // initialize the local proxy instance
        return new LocalProxy(
            $beanManager,
            $sessionBeanDescriptor,
            $sessionBean
        );
    }
478735
public function getByClass($className)
    {
        $types = array_unique(Arr::wrap(Arr::get($this->classMapping, $className, [])));
        $resolved = array_map([$this, 'get'], $types);

        return $this->firstOrAll(Arr::collapse($resolved));
    }
66107
public function tryGetById(string $className, array $data)
    {
        $serialized = serialize($this->extractIdentifierFromData($className, $data));

        if (isset($this->identityMap[$className][$serialized])) {
            return $this->identityMap[$className][$serialized];
        }

        return null;
    }
744895
public function getConfigurationObjectForClass(ClassName $className): ObjectInterface
    {
        if (isset($this->objects[$className->getIdentifier()]) === true) {
            return $this->objects[$className->getIdentifier()];
        }

        return new Blackhole();
    }
787163
public final function get($className, CacheInterface $cache = null)
   {
       try {
           return $this->resolve($className, $cache);
       } catch (NotFoundException $e) {
           throw $e;
       } catch (ContainerException $e) {
           throw $e;
       }
   }
1322790
private function getRepository($classname)
    {
        $om = ManagerUtils::getManager($this->doctrine, $classname);

        return null !== $om ? $om->getRepository($classname) : null;
    }
919492
public function lookup($itemName)
        {
            if (!$this->has($itemName)) {
                throw new Exception(
                    'Cannot lookup dependency "' . $itemName . '" since it is not registered.'
                );
            }

            switch ($this->_store[$itemName]['lookupType']) {
                case self::TYPE_ALIAS:
                    return $this->_createAlias($itemName);
                case self::TYPE_VALUE:
                    return $this->_getValue($itemName);
                case self::TYPE_INSTANCE:
                    return $this->_createNewInstance($itemName);
                case self::TYPE_SHARED:
                    return $this->_createSharedInstance($itemName);
            }
        }
887429
public function getElement($className)
    {
        if ($this->classCache === null) {
            $this->initialize();
        }

        if (isset($this->classCache[$className])) {
            return $this->classCache[$className];
        }

        $result = $this->loadMappingFile($this->locator->findMappingFile($className));
        if (! isset($result[$className])) {
            throw MappingException::invalidMappingFile($className, str_replace('\\', '.', $className) . $this->locator->getFileExtension());
        }

        $this->classCache[$className] = $result[$className];

        return $result[$className];
    }
675584
public static function getParent($className) {
		$reflection = ClassType::from($className);
		$parent = $reflection->getParentClass();
		return $parent ? $parent->getName() : $parent;
	}