JBZoo\SimpleTypes\Formatter::__construct PHP Method

__construct() public method

public __construct ( array $rules = [], array $default = [], string $type = null )
$rules array
$default array
$type string
    public function __construct(array $rules = array(), array $default = array(), $type = null)
    {
        $this->_type = $type;
        $this->_default = $default;
        // prepare rules
        $this->_rules = array_change_key_case((array) $rules, CASE_LOWER);
        foreach ($this->_rules as $key => $item) {
            $this->_rules[$key] = array_merge($default, (array) $item);
        }
    }