original_string: protected function validateFormatCountry()
      {
          $field = 'format';
          $format = $this->getSubmitted($field);
  
          if (!isset($format)) {
              $this->unsetSubmitted($field);
              return null;
          }
  
          $label = $this->translation->text('Format');
  
          if (!is_array($format)) {
              $this->setErrorInvalid($field, $label);
              return false;
          }
  
          $default = $this->country->getDefaultFormat();
  
          if (!array_intersect_key($format, $default)) {
              $this->setErrorInvalid($field, $label);
              return false;
          }
  
          foreach ($format as $key => $value) {
  
              if (!is_array($value) || !array_intersect_key($value, $default[$key])) {
                  $this->setErrorInvalid($field, $label);
                  return false;
              }
  
              foreach ($value as $v) {
                  if (!in_array(gettype($v), array('string', 'integer', 'boolean'))) {
                      $this->setErrorInvalid($field, $label);
                      return false;
                  }
              }
          }
  
          return true;
      }
code: protected function validateFormatCountry()
      {
          $field = 'format';
          $format = $this->getSubmitted($field);
  
          if (!isset($format)) {
              $this->unsetSubmitted($field);
              return null;
          }
  
          $label = $this->translation->text('Format');
  
          if (!is_array($format)) {
              $this->setErrorInvalid($field, $label);
              return false;
          }
  
          $default = $this->country->getDefaultFormat();
  
          if (!array_intersect_key($format, $default)) {
              $this->setErrorInvalid($field, $label);
              return false;
          }
  
          foreach ($format as $key => $value) {
  
              if (!is_array($value) || !array_intersect_key($value, $default[$key])) {
                  $this->setErrorInvalid($field, $label);
                  return false;
              }
  
              foreach ($value as $v) {
                  if (!in_array(gettype($v), array('string', 'integer', 'boolean'))) {
                      $this->setErrorInvalid($field, $label);
                      return false;
                  }
              }
          }
  
          return true;
      }
code_tokens: protected function validateFormatCountry ( ) { $ field = 'format' ; $ format = $ this -> getSubmitted ( $ field ) ; if ( ! isset ( $ format ) ) { $ this -> unsetSubmitted ( $ field ) ; return null ; } $ label = $ this -> translation -> text ( 'Format' ) ; if ( ! is_array ( $ format ) ) { $ this -> setErrorInvalid ( $ field , $ label ) ; return false ; } $ default = $ this -> country -> getDefaultFormat ( ) ; if ( ! array_intersect_key ( $ format , $ default ) ) { $ this -> setErrorInvalid ( $ field , $ label ) ; return false ; } foreach ( $ format as $ key => $ value ) { if ( ! is_array ( $ value ) || ! array_intersect_key ( $ value , $ default [ $ key ] ) ) { $ this -> setErrorInvalid ( $ field , $ label ) ; return false ; } foreach ( $ value as $ v ) { if ( ! in_array ( gettype ( $ v ) , array ( 'string' , 'integer' , 'boolean' ) ) ) { $ this -> setErrorInvalid ( $ field , $ label ) ; return false ; } } } return true ; }
docstring: Validates country format
  @return boolean
docstring_tokens: Validates country format