original_string: private function filterValues(array $values)
      {
          foreach ($values as $i => $field) {
              if (is_bool($field)) {
                  $values[$i] = (int) $field;
              } elseif ($field instanceof \DateTime) {
                  $values[$i] = $field->format('Y-m-d H:i:s');
              } elseif (!is_scalar($field)) {
                  unset($values[$i]);
              }
          }
          return $values;
      }
code: private function filterValues(array $values)
      {
          foreach ($values as $i => $field) {
              if (is_bool($field)) {
                  $values[$i] = (int) $field;
              } elseif ($field instanceof \DateTime) {
                  $values[$i] = $field->format('Y-m-d H:i:s');
              } elseif (!is_scalar($field)) {
                  unset($values[$i]);
              }
          }
          return $values;
      }
code_tokens: private function filterValues ( array $ values ) { foreach ( $ values as $ i => $ field ) { if ( is_bool ( $ field ) ) { $ values [ $ i ] = ( int ) $ field ; } elseif ( $ field instanceof \ DateTime ) { $ values [ $ i ] = $ field -> format ( 'Y-m-d H:i:s' ) ; } elseif ( ! is_scalar ( $ field ) ) { unset ( $ values [ $ i ] ) ; } } return $ values ; }
docstring: filterValues removes non-scalar values from the array and formats any DateTime to DB string representation.
  
  @param array $values
  @return array
docstring_tokens: filterValues removes non - scalar values from the array and formats any DateTime to DB string representation .