JBZoo\SimpleTypes\Formatter::get PHP Method

get() public method

public get ( string $rule ) : array
$rule string
return array
    public function get($rule)
    {
        if (array_key_exists($rule, $this->_rules)) {
            return (array) $this->_rules[$rule];
        }
        throw new Exception('Undefined rule: "' . $rule . '"');
    }

Usage Example

Beispiel #1
0
 /**
  * @param string $rule
  * @return array
  * @throws \JBZoo\SimpleTypes\Exception
  */
 public function getRuleData($rule)
 {
     $rule = $this->_parser->cleanRule($rule);
     return $this->_formatter->get($rule);
 }