Skip to content

Commit 93e3c80

Browse files
committed
Remove iterator aggregate from GraphNode
1 parent d2b7c59 commit 93e3c80

File tree

2 files changed

+1
-26
lines changed

2 files changed

+1
-26
lines changed

src/GraphNode/GraphNode.php

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
/**
2626
* @package Facebook
2727
*/
28-
class GraphNode implements \IteratorAggregate
28+
class GraphNode
2929
{
3030
/**
3131
* @var array maps object key names to Graph object types
@@ -102,16 +102,6 @@ public function asArray()
102102
}, $this->fields);
103103
}
104104

105-
/**
106-
* Get an iterator for the fields.
107-
*
108-
* @return \ArrayIterator
109-
*/
110-
public function getIterator()
111-
{
112-
return new \ArrayIterator($this->fields);
113-
}
114-
115105
/**
116106
* Convert the collection to its string representation.
117107
*

tests/GraphNode/GraphNodeTest.php

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -196,19 +196,4 @@ public function testAGraphNodeCanBeAccessedAsAnArray()
196196
$this->assertEquals('bar', $graphNode->getField('foo'));
197197
$this->assertEquals('baz', $graphNode->getField('faz'));
198198
}
199-
200-
public function testAGraphNodeCanBeIteratedOver()
201-
{
202-
$graphNode = new GraphNode(['foo' => 'bar', 'faz' => 'baz']);
203-
204-
$this->assertInstanceOf(\IteratorAggregate::class, $graphNode);
205-
206-
$newArray = [];
207-
208-
foreach ($graphNode as $k => $v) {
209-
$newArray[$k] = $v;
210-
}
211-
212-
$this->assertEquals(['foo' => 'bar', 'faz' => 'baz'], $newArray);
213-
}
214199
}

0 commit comments

Comments
 (0)