original_string: public function stateId(array $values)
      {
          $count = count($values);
          $ids = array_filter($values, 'ctype_digit');
  
          if ($count != count($ids)) {
              return $this->translation->text('@field has invalid value', array(
                  '@field' => $this->translation->text('Condition')));
          }
  
          $existing = array_filter($values, function ($state_id) {
              $state = $this->state->get($state_id);
              return isset($state['state_id']);
          });
  
          if ($count != count($existing)) {
              return $this->translation->text('@name is unavailable', array(
                  '@name' => $this->translation->text('Country state')));
          }
  
          return true;
      }
code: public function stateId(array $values)
      {
          $count = count($values);
          $ids = array_filter($values, 'ctype_digit');
  
          if ($count != count($ids)) {
              return $this->translation->text('@field has invalid value', array(
                  '@field' => $this->translation->text('Condition')));
          }
  
          $existing = array_filter($values, function ($state_id) {
              $state = $this->state->get($state_id);
              return isset($state['state_id']);
          });
  
          if ($count != count($existing)) {
              return $this->translation->text('@name is unavailable', array(
                  '@name' => $this->translation->text('Country state')));
          }
  
          return true;
      }
code_tokens: public function stateId ( array $ values ) { $ count = count ( $ values ) ; $ ids = array_filter ( $ values , 'ctype_digit' ) ; if ( $ count != count ( $ ids ) ) { return $ this -> translation -> text ( '@field has invalid value' , array ( '@field' => $ this -> translation -> text ( 'Condition' ) ) ) ; } $ existing = array_filter ( $ values , function ( $ state_id ) { $ state = $ this -> state -> get ( $ state_id ) ; return isset ( $ state [ 'state_id' ] ) ; } ) ; if ( $ count != count ( $ existing ) ) { return $ this -> translation -> text ( '@name is unavailable' , array ( '@name' => $ this -> translation -> text ( 'Country state' ) ) ) ; } return true ; }
docstring: Validates the country state condition
  @param array $values
  @return boolean|string
docstring_tokens: Validates the country state condition