diff --git a/src/IterableObject.php b/src/IterableObject.php index c0caeea..b8eec16 100644 --- a/src/IterableObject.php +++ b/src/IterableObject.php @@ -79,26 +79,6 @@ public function map($map) return new self($this->iterable, $this->filter, $map); } - /** - * @param callable $filter - * @return self - * @deprecated Use IterableObject::filter instead. - */ - public function withFilter($filter) - { - return $this->filter($filter); - } - - /** - * @param callable $map - * @return self - * @deprecated Use IterableObject::map instead. - */ - public function withMap($map) - { - return $this->map($map); - } - /** * @inheritdoc */ diff --git a/tests/TestIterableObject.php b/tests/TestIterableObject.php index 108a4ee..ea43d00 100644 --- a/tests/TestIterableObject.php +++ b/tests/TestIterableObject.php @@ -43,38 +43,6 @@ public function testFromTraversableToArray($data, $filter = null, $map = null, $ $this->assertEquals($expectedResult, $iterableObject->asArray()); } - public function testFilterMutator() - { - $filter = function ($value) { - return 'bar' === $value; - }; - $iterableObject = iterable(array('foo', 'bar'))->withFilter($filter); - $this->assertEquals(array(1 => 'bar'), iterator_to_array($iterableObject)); - } - - public function testMapMutator() - { - $map = 'strtoupper'; - $iterableObject = iterable(array('foo', 'bar'))->withMap($map); - $this->assertEquals(array('FOO', 'BAR'), iterator_to_array($iterableObject)); - } - - public function testFilterAndMapMutators() - { - $filter = function ($value) { - return 'bar' === $value; - }; - $map = 'strtoupper'; - $iterableObject = iterable(array('foo', 'bar'))->withMap($map)->withFilter($filter); - $this->assertEquals(array(1 => 'BAR'), iterator_to_array($iterableObject)); - $iterableObject = iterable(array('foo', 'bar'))->map($map)->filter($filter); - $this->assertEquals(array(1 => 'BAR'), iterator_to_array($iterableObject)); - $iterableObject = iterable(array('foo', 'bar'))->withFilter($filter)->withMap($map); - $this->assertEquals(array(1 => 'BAR'), iterator_to_array($iterableObject)); - $iterableObject = iterable(array('foo', 'bar'))->filter($filter)->map($map); - $this->assertEquals(array(1 => 'BAR'), iterator_to_array($iterableObject)); - } - public function dataProvider() { $data = array('foo', 'bar');