original_string: protected function transform_db_records_to_entities(array $records) {
          $preprocessors = $this->get_preprocessors();
          $result = array_map(function($record) {
              return ['record' => $record];
          }, $records);
  
          $result = array_reduce(array_keys($preprocessors), function($carry, $preprocessor) use ($records, $preprocessors) {
              $step = $preprocessors[$preprocessor];
              $dependencies = $step->execute($records);
  
              foreach ($dependencies as $index => $dependency) {
                  // Add the new dependency to the list.
                  $carry[$index] = array_merge($carry[$index], [$preprocessor => $dependency]);
              }
  
              return $carry;
          }, $result);
  
          return $this->from_db_records($result);
      }
code: protected function transform_db_records_to_entities(array $records) {
          $preprocessors = $this->get_preprocessors();
          $result = array_map(function($record) {
              return ['record' => $record];
          }, $records);
  
          $result = array_reduce(array_keys($preprocessors), function($carry, $preprocessor) use ($records, $preprocessors) {
              $step = $preprocessors[$preprocessor];
              $dependencies = $step->execute($records);
  
              foreach ($dependencies as $index => $dependency) {
                  // Add the new dependency to the list.
                  $carry[$index] = array_merge($carry[$index], [$preprocessor => $dependency]);
              }
  
              return $carry;
          }, $result);
  
          return $this->from_db_records($result);
      }
code_tokens: protected function transform_db_records_to_entities ( array $ records ) { $ preprocessors = $ this -> get_preprocessors ( ) ; $ result = array_map ( function ( $ record ) { return [ 'record' => $ record ] ; } , $ records ) ; $ result = array_reduce ( array_keys ( $ preprocessors ) , function ( $ carry , $ preprocessor ) use ( $ records , $ preprocessors ) { $ step = $ preprocessors [ $ preprocessor ] ; $ dependencies = $ step -> execute ( $ records ) ; foreach ( $ dependencies as $ index => $ dependency ) { // Add the new dependency to the list. $ carry [ $ index ] = array_merge ( $ carry [ $ index ] , [ $ preprocessor => $ dependency ] ) ; } return $ carry ; } , $ result ) ; return $ this -> from_db_records ( $ result ) ; }
docstring: Execute the defined preprocessors on the DB record results and then convert
  them into entities.
  
  @param stdClass[] $records List of DB results
  @return array
docstring_tokens: Execute the defined preprocessors on the DB record results and then convert them into entities .