* @param RowUpdateGenerator $generator Generates single row updates
* based on the rows content
*/
- public function __construct( BatchRowIterator $reader, BatchRowWriter $writer, RowUpdateGenerator $generator ) {
+ public function __construct(
+ BatchRowIterator $reader, BatchRowWriter $writer, RowUpdateGenerator $generator
+ ) {
$this->reader = $reader;
$this->writer = $writer;
$this->generator = $generator;
*/
public function execute() {
foreach ( $this->reader as $rows ) {
- $updates = array();
+ $updates = [];
foreach ( $rows as $row ) {
$update = $this->generator->update( $row );
if ( $update ) {
- $updates[] = array(
+ $updates[] = [
'primaryKey' => $this->reader->extractPrimaryKeys( $row ),
'changes' => $update,
- );
+ ];
}
}