Returns a class name from a form widget code
Normalizes a class name or converts an code to its class name.
@param string $name Class name or form widget code.
@return string The class name resolved, or the original name.
488639
public function resolveFormWidget($name)
    {
        if ($this->formWidgets === null) {
            $this->listFormWidgets();
        }

        $hints = $this->formWidgetHints;

        if (isset($hints[$name])) {
            return $hints[$name];
        }

        $_name = Str::normalizeClassName($name);
        if (isset($this->formWidgets[$_name])) {
            return $_name;
        }

        return $name;
    }
711029
public static function generateClassName($name)
    {
        $name = str_replace("-", "_", $name);

        if (strstr($name, "\\")) {
            $composedName = "";
            foreach (explode("\\", $name) as $namespace) {
                $namespace = Inflector::underscore($namespace);
                $namespace = Inflector::classify($namespace);
                $composedName .= $namespace . "\\";
            }
        } else {
            $name = Inflector::underscore($name);
            $name = Inflector::classify($name);
        }

        $suffix = self::getClassNameSuffix();
        if (!preg_match("/$suffix$/", $name)) {
            $name .= $suffix;
        }

        if (!preg_match('/^[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/', $name)) {
            throw new Exception(sprintf("We could not generate a valid PHP classname from %s", $name));
        }

        return $name;
    }
1019978
private function getProperty($name)
    {
        $normalized = lcfirst($name);
        $old = "_{$normalized}";
        $name = false;
        foreach ($this->getInspector()->getClassProperties() as $property) {
            if ($old == $property || $normalized == $property) {
                $name = $property;
                break;
            }
        }
        return $name;
    }
49486
public function name($name = null)
    {
        deprecationWarning(
            get_called_class() . '::name() is deprecated. ' .
            'Use setName()/getName() instead.'
        );
        if ($name !== null) {
            $this->setName($name);
        }

        return $this->getName();
    }
242605
public function resolveMiddlewareClassName( $name )
	{
		$map = $this->middleware;

		// If the middleware is the name of a middleware group, we will return the array
		// of middlewares that belong to the group. This allows developers to group a
		// set of middleware under single keys that can be conveniently referenced.
		if ( isset( $this->middlewareGroups[$name] ) )
		{
			return $this->parseMiddlewareGroup( $name );
			// When the middleware is simply a Closure, we will return this Closure instance
			// directly so that Closures can be registered as middleware inline, which is
			// convenient on occasions when the developers are experimenting with them.
		}
		elseif ( isset( $map[$name] ) && $map[$name] instanceof Closure )
		{
			return $map[$name];
			// Finally, when the middleware is simply a string mapped to a class name the
			// middleware name will get parsed into the full class name and parameters
			// which may be run using the Pipeline which accepts this string format.
		}
		else
		{
			list( $name, $parameters ) = array_pad( explode( ':', $name, 2 ), 2, null );

			return ( isset( $map[$name] ) ? $map[$name] : $name ) . ( $parameters !== null ? ':' . $parameters : '' );
		}
	}
233382
public function controllerClassNameStrategy($name)
    {
        $names = explode('_', $name);
        $names = array_map('ucfirst', $names);
        return join('\\', $names) . 'Controller';
    }
1005853
protected function getClassName($name) {
        if (empty($name)) {
            throw new $this->_factoryExceptionClassName ('$name must not be empty');
        }

        $result = $this->getFactoryNamespace() . '\\' . $name . $this->getFactoryPostfix();

        if (!class_exists($result)) {
            throw new $this->_factoryExceptionClassName ('Class "' . $result . '" does not exist');
        }

        return $result;
    }
808018
protected function normalizeName($name)
    {
        $path = $this->finder->find($name);

        if ($path && in_array($path, $this->paths[static::MAIN_NAMESPACE])) {
            $this->prependPath($path);
        }

        return parent::normalizeName($name);
    }
134871
public function getClassName($name)
    {
        $name = $this->_formatName($name);
        if ($this->_useStaticRegistry
            && isset(self::$_staticLoadedPlugins[$this->_useStaticRegistry][$name])
        ) {
            return self::$_staticLoadedPlugins[$this->_useStaticRegistry][$name];
        } elseif (isset($this->_loadedPlugins[$name])) {
            return $this->_loadedPlugins[$name];
        }

        return false;
    }
672933
public function getClassName($name)
    {
        if (!isset($this->mapping[$name])) {
            throw new \InvalidArgumentException(sprintf('Could not find "%s"', $name));
        }

        return $this->mapping[$name];
    }
759258
protected function normalizeName($name)
    {
        $extension = '.' . $this->app['twig.extension'];
        $length = strlen($extension);

        if (substr($name, -$length, $length) === $extension) {
            $name = substr($name, 0, -$length);
        }

        // Normalize namespace and delimiters
        $delimiter = ViewFinderInterface::HINT_PATH_DELIMITER;
        if (strpos($name, $delimiter) === false) {
            return str_replace('/', '.', $name);
        }

        list($namespace, $name) = explode($delimiter, $name);

        return $namespace.$delimiter.str_replace('/', '.', $name);
    }
970566
protected function getFieldName($name)
    {
        $formName = $this->getName();
        if ($formName !== null) {
            if (strpos($formName, '[') !== false || strpos($formName, ']') !== false) {
                return $this->formHelper->transformToBracketSyntax(
                    $this->formHelper->transformToDotSyntax(
                        $formName . '[' . $name . ']'
                    )
                );
            }

            return $formName . '[' . $name . ']';
        }

        return $name;
    }
557523
protected function normalizeName(string $name) : string
    {
        $name = parent::normalizeName($name);

        if (strpos($name, 'http-') === 0) {
            $name = substr($name, 5);
        }

        return $name;
    }
895789
protected function getSubformElementName($name)
    {
        $formName = isset($this->attributes['name']) ? $this->attributes['name'] : $this->getName();

        return $formName . '[' . $name . ']';
    }
1213161
public function getFormWidget($name)
    {
        if (array_key_exists($name, $this->widgets)) {
            return $this->widgets[$name];
        }

        return null;
    }
663073
public static function getClassNameFromFQN(string $name): string
    {
        $arr = explode('\\', $name);

        return (string)array_pop($arr);
    }
477887
protected function getClassName($className = null)
    {
        $parts = explode('\\', $className ?: $this->className);

        return $parts[count($parts) - 1];
    }