Changed array_map to foreach
Unfortunately array_map only accepts arrays. Foreach looks more understandable (and performant) this way.
This commit is contained in:
parent
0e2f17ac37
commit
793d596541
@ -23,12 +23,9 @@ class MicrodataParser
|
||||
$items = [];
|
||||
|
||||
// Step 3
|
||||
// items = map("top-level microdata items", item => getObject(item))
|
||||
$items = array_map([$this, 'getObject'], iterator_to_array($this->topLevelItems));
|
||||
|
||||
/*foreach ($topLevelItems as $topLevelItem) {
|
||||
$items[] = getObject($topLevelItem);
|
||||
}*/
|
||||
foreach ($this->topLevelItems as $topLevelItem) {
|
||||
$items[] = $this->getObject($topLevelItem);
|
||||
}
|
||||
|
||||
// Step 4
|
||||
$result->items = $items;
|
||||
|
Loading…
Reference in New Issue
Block a user