Bladeren bron

[CssSelector] added missing accessors

Fabien Potencier 15 jaren geleden
bovenliggende
commit
28c0f493a2
1 gewijzigde bestanden met toevoegingen van 19 en 4 verwijderingen
  1. 19 4
      src/Symfony/Components/CssSelector/XPathExpr.php

+ 19 - 4
src/Symfony/Components/CssSelector/XPathExpr.php

@@ -38,6 +38,21 @@ class XPathExpr
     $this->starPrefix = $starPrefix;
   }
 
+  public function getPrefix()
+  {
+    return $this->prefix;
+  }
+
+  public function getPath()
+  {
+    return $this->path;
+  }
+
+  public function hasStarPrefix()
+  {
+    return $this->starPrefix;
+  }
+
   public function getElement()
   {
     return $this->element;
@@ -130,18 +145,18 @@ class XPathExpr
     $prefix = (string) $this;
 
     $prefix .= $combiner;
-    $path = $other->prefix.$other->path;
+    $path = $other->getPrefix().$other->getPath();
 
     /* We don't need a star prefix if we are joining to this other
        prefix; so we'll get rid of it */
-    if ($other->starPrefix && $path == '*/')
+    if ($other->hasStarPrefix() && $path == '*/')
     {
       $path = '';
     }
     $this->prefix = $prefix;
     $this->path = $path;
-    $this->element = $other->element;
-    $this->condition = $other->condition;
+    $this->element = $other->getElement();
+    $this->condition = $other->GetCondition();
   }
 
   static public function xpathLiteral($s)