Returns the class of the rule
@param string $rule
@return string
776659
private function getRuleClass($rule) {

		if(false === is_string($rule)) {
			return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($rule)), E_USER_ERROR);
		}

		if(true === isset($this -> custom[$rule])) {
			return $this -> custom[$rule];
		}

		return __NAMESPACE__ . self :: NAMESPACE_RULES . ucfirst(strtolower($rule));
	}
115422
protected function checkRuleCorrect(stdClass $rule)
    {
        if (!isset($rule->operator, $rule->id, $rule->field, $rule->type)) {
            return false;
        }

        if (!isset($this->operators[$rule->operator])) {
            return false;
        }

        return true;
    }
1028285
public function getObjClass($path)
    {
      $cnt = 0;
      foreach (self::$paths as $k => $p)
        if ($p == $path)
          return $k;


      return TitleUtility::toTitlecase(TitleUtility::toSingular($path));
    }
899192
protected function makeRuleMethod($rule)
    {
        if (strpos($rule, '=') !== false) {
            $rule = explode('=', $rule)[0];
        }

        return 'rule'.ucfirst($rule);
    }
838274
public function error($rule=null) {
		if($rule === null)
			return $this->self;
		elseif(isset($this->rules[$rule]))
			return $this->rules[$rule];
		elseif($attribute = $this->attribute($rule))
			return $attribute->error();
	}
37643
public function getFilterForRule(Rule $rule)
    {
        $filterIdentifier = $rule->getFilter();

        if (class_exists($filterIdentifier)) {
            return new $filterIdentifier;
        }

        $error = "Unable to locate filter for: $filterIdentifier defined in " . get_class($rule);
        throw new \UnexpectedValueException($error);
    }
809669
protected function parseRule($rule)
    {
        $name    = $rule;
        $options = [];

        if (str_contains($rule, ':')) {
            list($name, $options) = explode(':', $rule, 2);
            $options              = array_map('trim', explode(',', $options));
        }

        return empty($name) ? [] : compact('name', 'options');
    }
116780
public function getTypeClass($type)
    {
        if (isset($this->types[$type])) {
            return $this->types[$type];
        }

        if (\class_exists($type)) {
            return $type;
        }

        return null;
    }
16531
private function parseRule($rule)
    {
        $parameters = [];

        if (strpos($rule, ':') !== false) {
            list($rule, $parameter) = explode(':', $rule, 2);
            $parameters = $this->parseParameters($rule, $parameter);
        }

        if (!Variable::ruleExists($rule)) {
            throw new \InvalidArgumentException("validation: rule '$rule' not supported.");
        }

        return [$rule, $parameters];
    }
646922
private function fixTransliteratorRule(string $rule): string
	{
		static $latinAsciiFix;
		static $deAsciiFix;

		if ($latinAsciiFix === null) {
			$latinAsciiFix = \in_array('Latin-ASCII', \Transliterator::listIDs(), true)
				? false
				: file_get_contents(__DIR__.'/Resources/Latin-ASCII.txt')
			;
		}

		if ($deAsciiFix === null) {
			$deAsciiFix = \in_array('de-ASCII', \Transliterator::listIDs(), true)
				? false
				: file_get_contents(__DIR__.'/Resources/de-ASCII.txt')
			;
			if ($latinAsciiFix) {
				$deAsciiFix = str_replace('::Latin-ASCII;', $latinAsciiFix, $deAsciiFix);
			}
		}

		// Add the de-ASCII transform if a CLDR version lower than 32.0 is used.
		if ($deAsciiFix && $rule === 'de-ASCII') {
			return $deAsciiFix;
		}

		// Add the Latin-ASCII transform if a CLDR version lower than 1.9 is used.
		if ($latinAsciiFix && $rule === 'Latin-ASCII') {
			return $latinAsciiFix;
		}

		return $rule;
	}
1042620
public function parseGroupRule($rule)
    {
        $origin = $this->router->getGroup();
        $this->router->setGroup($this);

        if ($rule instanceof \Closure) {
            Container::getInstance()->invokeFunction($rule);
        } elseif (is_array($rule)) {
            $this->addRules($rule);
        } elseif (is_string($rule) && $rule) {
            $this->router->bind($rule, $this->domain);
        }

        $this->router->setGroup($origin);
    }
477258
protected function getRuleName($rule)
    {
        /* Retire le caractère de négation de la fonction. */
        $function = $rule[ 0 ] == '!'
            ? substr($rule, 1)
            : $rule;

        /* Sépare le nom de la fonction si elle a des arguments. */
        if (($name = strstr($function, ':', true)) !== false) {
            return strtolower($name);
        }

        return strtolower($function);
    }
81499
public function parse( $rules ) {
		if ( is_array( $rules ) ) {
			return $this->parse_array_rules( $rules );
		}

		return $this->parse_string_rules( $rules );
	}
286123
private function getClass($value)
    {
        if (! is_object($value) && ! is_string($value)) {
            return false;
        }

        if (is_object($value)) {
            $value = get_class($value);
        }

        return ltrim($value, '\\');
    }
76672
public function getRule($rule, $domain = null)
    {
        return isset($this->rule[$domain][$rule]) ? $this->rule[$domain][$rule] : [];
    }
580997
public static function getObjectClass($object)
    {
        if(is_object($object))
        {
            if($object instanceof IBean)
            {
                return get_parent_class($object);
            }
            else
            {
                return get_class($object);
            }
        }
        else
        {
            return (string)$object;
        }
    }
577769
public function parse($rules)
    {
        $attributes = array();
        $rules = $rule = $this->getRulesAsArray($rules);

        foreach ($rules as $rule) {
            list($rule, $parameters) = $this->parseRule($rule);

            if ($rule && method_exists($this, $rule)) {
                $attributes += $this->$rule($parameters);
            }
        }

        return $attributes;
    }