Sokil\Mongo\Structure::getValidatorClassNameByRuleName PHP Метод

getValidatorClassNameByRuleName() приватный Метод

private getValidatorClassNameByRuleName ( $ruleName )
    private function getValidatorClassNameByRuleName($ruleName)
    {
        if (false !== strpos($ruleName, '_')) {
            $className = implode('', array_map('ucfirst', explode('_', strtolower($ruleName))));
        } else {
            $className = ucfirst(strtolower($ruleName));
        }
        foreach ($this->validatorNamespaces as $namespace) {
            $fullyQualifiedClassName = $namespace . '\\' . $className . 'Validator';
            if (class_exists($fullyQualifiedClassName)) {
                return $fullyQualifiedClassName;
            }
        }
        throw new Exception('Validator with name ' . $ruleName . ' not found');
    }