Look for class name in configuration

@param array $config
@param string $name
@return boolean
191653
protected function getClass($config, $name)
    {
        if (array_key_exists($name, $config) 
                && is_array($config[$name])
                && array_key_exists('class', $config[$name]) 
                && is_scalar($config[$name]['class'])) {
            return $config[$name]['class'];
        }
        
        return false;
    }
1149307
public static function getInstance(array $config = []) {
        // If element has no name
        if (!isset($config['name'])){
            throw new \Exception("You have to set the name of the field", 1);
        }
        if(!isset($config['class'])){
            $config['class'] = Text::className();
        }
        return parent::getInstance($config);
	}
794634
public static function setConfig($config = [])
    {
        if (!is_array($config)) {
            return false;
        }
        self::$config = array_merge(self::$config, $config);
        return true;
    }
383315
public function hasConfigurator(string $name): bool
    {
        if (isset($this->configurators[$name])) {
            return true;
        }

        if (isset($this->serviceIds[$name])) {
            return true;
        }

        return class_exists($name) && \in_array(FieldSetConfigurator::class, class_implements($name), true);
    }
504143
protected function getConfig($cfg, $name = null)
    {
        if (is_null($name)) {
            $name = $this->apiName;
        }

        $name = $name ? ".$name" : '';

        return config("api.$cfg{$name}");
    }
1224131
protected function doSetup($config = array())
    {
        // Catch the configuration file path
        if (isset($config[self::CONFIG_KEY_FILE_PATH])) {
            $this->configFilePath = $config[self::CONFIG_KEY_FILE_PATH];
        } else {
            // Also consider throwing an exception here instead
            // of failing silently
            return $config;
        }

        // Catch the context
        if (isset($config[ConfigInterface::KEY_CONTEXT])) {
            $this->context = $config[ConfigInterface::KEY_CONTEXT];
        }

        return $this->readConfigurationFiles();
    }
882478
private static function getClass($name, array $config)
    {
        if (!empty($config['custom_adapters_namespace'])) {
            $namespaces = (array) $config['custom_adapters_namespace'];

            foreach ($namespaces as $namespace) {
                $class = $namespace.$name;

                if (class_exists($class)) {
                    return $class;
                }
            }
        }

        return 'Embed\\Adapters\\'.$name;
    }
834477
public function hasConfig($name)
    {
        if (property_exists($this, 'client_'.$name)) {
            $name = 'client_'.$name;
            return !empty($this->$name);
        }
        return false;
    }
140841
public static function findByNameType( $name, $type, $config = [] ) {

		return self::queryByNameType( $name, $type, $config )->all();
	}
596673
public function model($name, $config = [])
    {
        $config["class"] = $this->modelClasses[ucfirst($name)];
        return Yii::createObject($config);
    }
122660
protected function loadConfiguration($name, Config $config)
    {
        $themeConfig = CompiledYamlFile::instance("themes://{$name}/{$name}" . YAML_EXT)->content();
        $config->joinDefaults("themes.{$name}", $themeConfig);
    }
844060
public static function has($key, $config = null)
    {
        $config = ($config === null) ? self::$config : $config;

        if (!isset($config[$key]) && !array_key_exists($key, $config)) {
            return false;
        }

        return true;
    }
1162152
public function searchByName( $name, $config = [] ) {

		$modelClass	= static::$modelClass;
		$modelTable	= $this->getModelTable();

		$config[ 'query' ]		= isset( $config[ 'query' ] ) ? $config[ 'query' ] : $modelClass::find();
		$config[ 'columns' ]	= isset( $config[ 'columns' ] ) ? $config[ 'columns' ] : [ "$modelTable.id", "$modelTable.name", "$modelTable.email" ];
		$config[ 'array' ]		= isset( $config[ 'array' ] ) ? $config[ 'array' ] : true;

		$config[ 'query' ]->andWhere( "$modelTable.name LIKE :name", [ ':name' => "$name%" ] );

		return static::searchModels( $config );
	}
1158641
public static function instance($name = '_default_', array $config = array())
	{
		if ( ! \array_key_exists($name, static::$instances))
		{
			static::$instances[$name] = static::forge($config);
		}

		return static::$instances[$name];
	}
1325850
final protected function hasConfigs($config = null)
    {
        if (null !== $config) {
            return array_key_exists($config, self::$_configs);
        }

        return count(self::$_configs) > 0;
    }
1145363
public static function set($name, array $config)
    {
        // 还是没有，那么抛出异常
        if ( ! $config)
        {
            throw new ComponentNotFoundException('The requested component [:component] missing config.', [
                ':component' => $name,
            ]);
        }

        $class = Arr::get($config, 'class');
        if ( ! $class || ! class_exists($class))
        {
            throw new ComponentClassNotFoundException('The requested component class [:class] not found.', [
                ':class' => $class,
            ]);
        }

        /** @var Component $instance */
        $instance = new $class(Arr::get($config, 'params', []));
        foreach (Arr::get($config, 'call', []) as $method => $args)
        {
            call_user_func_array([$instance, $method], $args);
        }

        self::$components[$name] = $instance;
    }
204063
public static function detect(string $namespace, string $configPath, string $name = null, bool $strict = true) : array
    {
        $configName = null;
        $method = $strict ? 'get' : 'getIfExists';

        if (is_null($name)) {
            $configName = 'default';
        } elseif (class_exists($name)) {
            $all = self::config()->$method($configPath);
            foreach ($all ?? [] as $key => $value) {
                if (stripos($name, $key) === 0) {
                    $configName = $key;
                    break;
                }
            }
        } elseif (is_string($name)) {
            $configName = $name;
        }

        if (is_null($configName)) {
            if ($strict) {
                throw new \RuntimeException(sprintf(
                    "Can't detect configuration for namespace: '%s', config: '%s', type: '%s'",
                    $namespace,
                    $configPath,
                    is_string($name) ? $name : get_class($name)
                ));
            } else {
                $configName = 'default';
            }
        }

        if ($strict == false && is_null($configName)) {
            if ($return = self::get($namespace, $name)) {
                return [null, null, $return];
            }

            return [$name, null, $return];
        }

        if ($return = self::get($namespace, $configName)) {
            return [null, null, $return];
        }

        $config = self::config()->$method($configPath . '/' . $configName);

        if ($config) {
            return [$configName, $config, null];
        } elseif ($strict == false) {
            return [$configName ?: $name, null, null];
        }
    }