original_string: public function getRequiredFields()
      {
          $rules = $this->getRules();
  
          $requiredFields = array_where(
              $rules, function ($value, $key) {
                  if (is_array($value)) {
                      $value = implode('|', $value);
                  }
  
                  return str_contains($value, ['required', 'sometimes']);
              }
          );
  
          return $requiredFields;
      }
code: public function getRequiredFields()
      {
          $rules = $this->getRules();
  
          $requiredFields = array_where(
              $rules, function ($value, $key) {
                  if (is_array($value)) {
                      $value = implode('|', $value);
                  }
  
                  return str_contains($value, ['required', 'sometimes']);
              }
          );
  
          return $requiredFields;
      }
code_tokens: public function getRequiredFields ( ) { $ rules = $ this -> getRules ( ) ; $ requiredFields = array_where ( $ rules , function ( $ value , $ key ) { if ( is_array ( $ value ) ) { $ value = implode ( '|' , $ value ) ; } return str_contains ( $ value , [ 'required' , 'sometimes' ] ) ; } ) ; return $ requiredFields ; }
docstring: Get required fields.
  
  @return array
docstring_tokens: Get required fields .