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