Skip to content

Commit dbeec5e

Browse files
authored
Revert unintended BC break (#170)
1 parent f68081a commit dbeec5e

File tree

7 files changed

+10
-10
lines changed

7 files changed

+10
-10
lines changed

src/Flow/ETL/Row.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public function merge(self $row, string $prefix = '_') : self
9494
);
9595
}
9696

97-
public function remove_entries(string ...$names) : self
97+
public function remove(string ...$names) : self
9898
{
9999
$namesToRemove = [];
100100

@@ -107,7 +107,7 @@ public function remove_entries(string ...$names) : self
107107
return new self($this->entries->remove(...$namesToRemove));
108108
}
109109

110-
public function rename_entry(string $currentName, string $newName) : self
110+
public function rename(string $currentName, string $newName) : self
111111
{
112112
return new self($this->entries->rename($currentName, $newName));
113113
}

src/Flow/ETL/Transformer/KeepEntriesTransformer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public function transform(Rows $rows) : Rows
5151
$allEntries = $row->entries()->map(fn (Entry $entry) : string => $entry->name());
5252
$removeEntries = \array_diff($allEntries, $this->names);
5353

54-
return $row->remove_entries(...$removeEntries);
54+
return $row->remove(...$removeEntries);
5555
});
5656
}
5757
}

src/Flow/ETL/Transformer/RemoveEntriesTransformer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function transform(Rows $rows) : Rows
4949
* @psalm-var pure-callable(Row $row) : Row $transformer
5050
*/
5151
$transformer = function (Row $row) : Row {
52-
return $row->remove_entries(...$this->names);
52+
return $row->remove(...$this->names);
5353
};
5454

5555
return $rows->map($transformer);

src/Flow/ETL/Transformer/RenameEntriesTransformer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function transform(Rows $rows) : Rows
4747
{
4848
foreach ($this->entryRenames as $entryRename) {
4949
$rows = $rows->map(function (Row $row) use ($entryRename) : Row {
50-
return $row->rename_entry($entryRename->from(), $entryRename->to());
50+
return $row->rename($entryRename->from(), $entryRename->to());
5151
});
5252
}
5353

tests/Flow/ETL/Tests/Unit/ETLTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,7 @@ public function extract() : \Generator
615615
new class implements Transformer {
616616
public function transform(Rows $rows) : Rows
617617
{
618-
return $rows->map(fn (Row $row) => $row->rename_entry('id', 'new_id'));
618+
return $rows->map(fn (Row $row) => $row->rename('id', 'new_id'));
619619
}
620620

621621
public function __serialize() : array
@@ -677,7 +677,7 @@ public function extract() : \Generator
677677
new class implements Transformer {
678678
public function transform(Rows $rows) : Rows
679679
{
680-
return $rows->map(fn (Row $row) => $row->rename_entry('id', 'new_id'));
680+
return $rows->map(fn (Row $row) => $row->rename('id', 'new_id'));
681681
}
682682

683683
public function __serialize() : array

tests/Flow/ETL/Tests/Unit/RowTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public function test_renames_entry() : void
6565
new StringEntry('name', 'just a string'),
6666
new BooleanEntry('active', true)
6767
);
68-
$newRow = $row->rename_entry('name', 'new-name');
68+
$newRow = $row->rename('name', 'new-name');
6969

7070
$this->assertEquals(
7171
Row::create(

tests/Flow/ETL/Tests/Unit/Transformer/CallbackRowTransformerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class CallbackRowTransformerTest extends TestCase
1616
public function test_replacing_dashes_in_entry_name_with_str_replace_callback() : void
1717
{
1818
$callbackTransformer = Transform::callback_row(
19-
fn (Row $row) : Row => $row->remove_entries('old-int')
19+
fn (Row $row) : Row => $row->remove('old-int')
2020
);
2121

2222
$rows = $callbackTransformer->transform(
@@ -38,7 +38,7 @@ public function test_replacing_dashes_in_entry_name_with_str_replace_callback()
3838
public function test_replacing_dashes_in_entry_name_with_str_replace_callback_with_serialization() : void
3939
{
4040
$callbackTransformer = Transform::callback_row(
41-
fn (Row $row) : Row => $row->remove_entries('old-int')
41+
fn (Row $row) : Row => $row->remove('old-int')
4242
);
4343

4444
$serialization = new NativePHPSerializer();

0 commit comments

Comments
 (0)