Skip to content

Commit 92fbe97

Browse files
authored
Merge pull request #9 from simPod/drop-deprecated
Drop deprecated functions `withMap()` and `withFilter()`
2 parents b6d6b9d + 699d41d commit 92fbe97

File tree

2 files changed

+0
-52
lines changed

2 files changed

+0
-52
lines changed

src/IterableObject.php

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -79,26 +79,6 @@ public function map($map)
7979
return new self($this->iterable, $this->filter, $map);
8080
}
8181

82-
/**
83-
* @param callable $filter
84-
* @return self
85-
* @deprecated Use IterableObject::filter instead.
86-
*/
87-
public function withFilter($filter)
88-
{
89-
return $this->filter($filter);
90-
}
91-
92-
/**
93-
* @param callable $map
94-
* @return self
95-
* @deprecated Use IterableObject::map instead.
96-
*/
97-
public function withMap($map)
98-
{
99-
return $this->map($map);
100-
}
101-
10282
/**
10383
* @inheritdoc
10484
*/

tests/TestIterableObject.php

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -43,38 +43,6 @@ public function testFromTraversableToArray($data, $filter = null, $map = null, $
4343
$this->assertEquals($expectedResult, $iterableObject->asArray());
4444
}
4545

46-
public function testFilterMutator()
47-
{
48-
$filter = function ($value) {
49-
return 'bar' === $value;
50-
};
51-
$iterableObject = iterable(array('foo', 'bar'))->withFilter($filter);
52-
$this->assertEquals(array(1 => 'bar'), iterator_to_array($iterableObject));
53-
}
54-
55-
public function testMapMutator()
56-
{
57-
$map = 'strtoupper';
58-
$iterableObject = iterable(array('foo', 'bar'))->withMap($map);
59-
$this->assertEquals(array('FOO', 'BAR'), iterator_to_array($iterableObject));
60-
}
61-
62-
public function testFilterAndMapMutators()
63-
{
64-
$filter = function ($value) {
65-
return 'bar' === $value;
66-
};
67-
$map = 'strtoupper';
68-
$iterableObject = iterable(array('foo', 'bar'))->withMap($map)->withFilter($filter);
69-
$this->assertEquals(array(1 => 'BAR'), iterator_to_array($iterableObject));
70-
$iterableObject = iterable(array('foo', 'bar'))->map($map)->filter($filter);
71-
$this->assertEquals(array(1 => 'BAR'), iterator_to_array($iterableObject));
72-
$iterableObject = iterable(array('foo', 'bar'))->withFilter($filter)->withMap($map);
73-
$this->assertEquals(array(1 => 'BAR'), iterator_to_array($iterableObject));
74-
$iterableObject = iterable(array('foo', 'bar'))->filter($filter)->map($map);
75-
$this->assertEquals(array(1 => 'BAR'), iterator_to_array($iterableObject));
76-
}
77-
7846
public function dataProvider()
7947
{
8048
$data = array('foo', 'bar');

0 commit comments

Comments
 (0)