original_string: protected function validateTypeAddress()
      {
          $field = 'type';
          $value = $this->getSubmitted($field);
  
          if (!isset($value)) {
              $this->unsetSubmitted($field);
              return null;
          }
  
          if (!in_array($value, $this->address->getTypes())) {
              $this->setErrorUnavailable($field, $this->translation->text('Type'));
              return false;
          }
  
          return true;
      }
code: protected function validateTypeAddress()
      {
          $field = 'type';
          $value = $this->getSubmitted($field);
  
          if (!isset($value)) {
              $this->unsetSubmitted($field);
              return null;
          }
  
          if (!in_array($value, $this->address->getTypes())) {
              $this->setErrorUnavailable($field, $this->translation->text('Type'));
              return false;
          }
  
          return true;
      }
code_tokens: protected function validateTypeAddress ( ) { $ field = 'type' ; $ value = $ this -> getSubmitted ( $ field ) ; if ( ! isset ( $ value ) ) { $ this -> unsetSubmitted ( $ field ) ; return null ; } if ( ! in_array ( $ value , $ this -> address -> getTypes ( ) ) ) { $ this -> setErrorUnavailable ( $ field , $ this -> translation -> text ( 'Type' ) ) ; return false ; } return true ; }
docstring: Validates an address type
  @return boolean|null
docstring_tokens: Validates an address type