public function hasValidFormat()
    {
        $is_ok = (preg_match('/^[0-9]+$/', $this->number) && preg_match('/([K0-9])$/', $this->vn) && strlen($this->number) > $this->minChars && strlen($this->number) < $this->maxChars);
        if (!$is_ok && $this->useExceptions) {
            throw new InvalidFormatException("R.U.T. '{$this->number}' with verification code '{$this->vn}' has an invalid format");
        }

        return $is_ok;
    }
public function hasValidFormat()
    {
        $is_ok = (preg_match('/^[0-9]+$/', $this->number) && preg_match('/([K0-9])$/', $this->vn) && strlen($this->number) > $this->minChars && strlen($this->number) < $this->maxChars);
        if (!$is_ok && $this->useExceptions) {
            throw new InvalidFormatException("R.U.T. '{$this->number}' with verification code '{$this->vn}' has an invalid format");
        }

        return $is_ok;
    }
public function hasValidFormat ( ) { $ is_ok = ( preg_match ( '/^[0-9]+$/' , $ this -> number ) && preg_match ( '/([K0-9])$/' , $ this -> vn ) && strlen ( $ this -> number ) > $ this -> minChars && strlen ( $ this -> number ) < $ this -> maxChars ) ; if ( ! $ is_ok && $ this -> useExceptions ) { throw new InvalidFormatException ( "R.U.T. '{$this->number}' with verification code '{$this->vn}' has an invalid format" ) ; } return $ is_ok ; }
Check if RUT has a valid format. If not, throws an Exception

REvisa si el R.U.T. tiene un formato válido. De ser inválido, arroja una excepción o returna false si $use_exections = true;

@param $rut
@param null $vn
@throws \Freshwork\ChileanBundle\Exceptions\InvalidFormatException

@return bool
Check if RUT has a valid format . If not throws an Exception