original_string: protected function filterArray($rules, $rawAttributes)
      {
          $attributes = [];
          foreach (array_keys($rules) as $filedName) {
              $value = array_get($rawAttributes, $filedName, 'not found in array'); // Default value !== null
              if ($value !== 'not found in array') { // Only if field specified in incoming array
                  if (isset($this->filters[$filedName])) {
                      $filters = explode('|', $this->filters[$filedName]);
                      foreach ($filters as $filter) {
                          array_set($attributes, $filedName, $this->$filter($value));
                      }
                  } else {
                      array_set($attributes, $filedName, $value);
                  }
              }
          }
          return $attributes;
      }
code: protected function filterArray($rules, $rawAttributes)
      {
          $attributes = [];
          foreach (array_keys($rules) as $filedName) {
              $value = array_get($rawAttributes, $filedName, 'not found in array'); // Default value !== null
              if ($value !== 'not found in array') { // Only if field specified in incoming array
                  if (isset($this->filters[$filedName])) {
                      $filters = explode('|', $this->filters[$filedName]);
                      foreach ($filters as $filter) {
                          array_set($attributes, $filedName, $this->$filter($value));
                      }
                  } else {
                      array_set($attributes, $filedName, $value);
                  }
              }
          }
          return $attributes;
      }
code_tokens: protected function filterArray ( $ rules , $ rawAttributes ) { $ attributes = [ ] ; foreach ( array_keys ( $ rules ) as $ filedName ) { $ value = array_get ( $ rawAttributes , $ filedName , 'not found in array' ) ; // Default value !== null if ( $ value !== 'not found in array' ) { // Only if field specified in incoming array if ( isset ( $ this -> filters [ $ filedName ] ) ) { $ filters = explode ( '|' , $ this -> filters [ $ filedName ] ) ; foreach ( $ filters as $ filter ) { array_set ( $ attributes , $ filedName , $ this -> $ filter ( $ value ) ) ; } } else { array_set ( $ attributes , $ filedName , $ value ) ; } } } return $ attributes ; }
docstring: Filter array with data to validate
  
  @param array $rules         Rules array
  @param array $rawAttributes Array with data passed to validation
  
  @return array
docstring_tokens: Filter array with data to validate