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 = [];
|
$items = [];
|
||||||
|
|
||||||
// Step 3
|
// Step 3
|
||||||
// items = map("top-level microdata items", item => getObject(item))
|
foreach ($this->topLevelItems as $topLevelItem) {
|
||||||
$items = array_map([$this, 'getObject'], iterator_to_array($this->topLevelItems));
|
$items[] = $this->getObject($topLevelItem);
|
||||||
|
}
|
||||||
/*foreach ($topLevelItems as $topLevelItem) {
|
|
||||||
$items[] = getObject($topLevelItem);
|
|
||||||
}*/
|
|
||||||
|
|
||||||
// Step 4
|
// Step 4
|
||||||
$result->items = $items;
|
$result->items = $items;
|
||||||
|
Loading…
Reference in New Issue
Block a user