Validator/Container.php
public static function create($validator, $command)
    {
        static $cache = [];
        $cacheKey = $validator;

        if (isset($cache[$cacheKey]))  {
            $class = $cache[$cacheKey]['class'];
            $validator = $cache[$cacheKey]['validator'];
        } else {
            if (false === strpos($validator, '.')) {
                // Not FQCN
                $class = __NAMESPACE__ . '\\' . String::convertToCamelCase($validator);
            } else {
                // FQCN
                $class = explode('.', $validator);
                $class = array_map(array('In2pire\\Component\\Utility\\Text', 'convertToCamelCase'), $class);
                $class = implode('\\', $class);
                $validator = substr($validator, strrpos($validator, '.') + 1);
            }

            $cache[$cacheKey] = [
                'class' => $class,
                'validator' => $validator
            ];
        }

        if (!class_exists($class)) {
            throw new \RuntimeException('Unknow validator ' . $cacheKey);
        }

        return new $class($command);
    }
public static function create($validator, $command)
    {
        static $cache = [];
        $cacheKey = $validator;

        if (isset($cache[$cacheKey]))  {
            $class = $cache[$cacheKey]['class'];
            $validator = $cache[$cacheKey]['validator'];
        } else {
            if (false === strpos($validator, '.')) {
                // Not FQCN
                $class = __NAMESPACE__ . '\\' . String::convertToCamelCase($validator);
            } else {
                // FQCN
                $class = explode('.', $validator);
                $class = array_map(array('In2pire\\Component\\Utility\\Text', 'convertToCamelCase'), $class);
                $class = implode('\\', $class);
                $validator = substr($validator, strrpos($validator, '.') + 1);
            }

            $cache[$cacheKey] = [
                'class' => $class,
                'validator' => $validator
            ];
        }

        if (!class_exists($class)) {
            throw new \RuntimeException('Unknow validator ' . $cacheKey);
        }

        return new $class($command);
    }
Create new validator.

@param string $validator
Validator ID.
@param In2pire\Cli\Command\CliCommand $command
The running command.

@return In2pire\Cli\Validator\CliValidator
New validator.