JBZoo\SimpleTypes\Formatter::get PHP 메소드

get() 공개 메소드

public get ( string $rule ) : array
$rule string
리턴 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

예제 #1
0
파일: Type.php 프로젝트: jbzoo/simpletypes
 /**
  * @param string $rule
  * @return array
  * @throws \JBZoo\SimpleTypes\Exception
  */
 public function getRuleData($rule)
 {
     $rule = $this->_parser->cleanRule($rule);
     return $this->_formatter->get($rule);
 }