Some refactoring
This commit is contained in:
parent
87dd20f753
commit
ee7eaf1317
@ -7,12 +7,8 @@ class MicrodataDOMElement extends \DOMElement
|
|||||||
public function getProperties()
|
public function getProperties()
|
||||||
{
|
{
|
||||||
$results = [];
|
$results = [];
|
||||||
$memory = [];
|
$memory = [$this];
|
||||||
$pending = [];
|
$pending = $this->getChildElementNodes();
|
||||||
|
|
||||||
$memory[] = $this;
|
|
||||||
|
|
||||||
$pending = array_merge($pending, $this->getChildElementNodes());
|
|
||||||
|
|
||||||
if ($this->hasAttribute('itemref')) {
|
if ($this->hasAttribute('itemref')) {
|
||||||
$tokens = $this->tokenizeAttribute('itemref');
|
$tokens = $this->tokenizeAttribute('itemref');
|
||||||
@ -37,7 +33,7 @@ class MicrodataDOMElement extends \DOMElement
|
|||||||
$pending = array_merge($pending, $current->getChildElementNodes());
|
$pending = array_merge($pending, $current->getChildElementNodes());
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($current->hasAttribute('itemprop') && /* hasPropertyNames */ $current->getPropertyNames()) {
|
if ($current->hasAttribute('itemprop') && $current->hasPropertyNames()) {
|
||||||
$results[] = $current;
|
$results[] = $current;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -45,6 +41,10 @@ class MicrodataDOMElement extends \DOMElement
|
|||||||
return array_reverse($results);
|
return array_reverse($results);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function hasPropertyNames() {
|
||||||
|
return !empty($this->tokenizeAttribute('itemprop'));
|
||||||
|
}
|
||||||
|
|
||||||
public function getPropertyNames()
|
public function getPropertyNames()
|
||||||
{
|
{
|
||||||
$tokens = $this->tokenizeAttribute('itemprop');
|
$tokens = $this->tokenizeAttribute('itemprop');
|
||||||
|
Loading…
Reference in New Issue
Block a user