Переглянути джерело

[CssSelector] moved protected to private

Fabien Potencier 14 роки тому
батько
коміт
eeca46dea0

+ 6 - 6
src/Symfony/Component/CssSelector/Parser.php

@@ -29,12 +29,12 @@ class Parser
      * Optionally, a prefix can be added to the resulting XPath
      * expression with the $prefix parameter.
      *
-     * @throws SyntaxError When got None for xpath expression
-     *
      * @param  mixed  $cssExpr The CSS expression.
      * @param  string $prefix  An optional prefix for the XPath expression.
      *
      * @return string
+     *
+     * @throws SyntaxError When got None for xpath expression
      */
     static public function cssToXpath($cssExpr, $prefix = 'descendant-or-self::')
     {
@@ -103,7 +103,7 @@ class Parser
      *
      * @return Node\NodeInterface
      */
-    protected function parseSelectorGroup($stream)
+    private function parseSelectorGroup($stream)
     {
         $result = array();
         while (true) {
@@ -132,7 +132,7 @@ class Parser
      *
      * @return Node\NodeInterface
      */
-    protected function parseSelector($stream)
+    private function parseSelector($stream)
     {
         $result = $this->parseSimpleSelector($stream);
 
@@ -168,7 +168,7 @@ class Parser
      *
      * @return Node\NodeInterface
      */
-    protected function parseSimpleSelector($stream)
+    private function parseSimpleSelector($stream)
     {
         $peek = $stream->peek();
         if ('*' != $peek && !$peek->isType('Symbol')) {
@@ -277,7 +277,7 @@ class Parser
      *
      * @return Node\AttribNode
      */
-    protected function parseAttrib($selector, $stream)
+    private function parseAttrib($selector, $stream)
     {
         $attrib = $stream->next();
         if ($stream->peek() == '|') {

+ 3 - 3
src/Symfony/Component/CssSelector/Token.php

@@ -21,9 +21,9 @@ namespace Symfony\Component\CssSelector;
  */
 class Token
 {
-    protected $type;
-    protected $value;
-    protected $position;
+    private $type;
+    private $value;
+    private $position;
 
     /**
      * Constructor.

+ 5 - 5
src/Symfony/Component/CssSelector/TokenStream.php

@@ -21,11 +21,11 @@ namespace Symfony\Component\CssSelector;
  */
 class TokenStream
 {
-    protected $used;
-    protected $tokens;
-    protected $source;
-    protected $peeked;
-    protected $peeking;
+    private $used;
+    private $tokens;
+    private $source;
+    private $peeked;
+    private $peeking;
 
     /**
      * Constructor.

+ 3 - 3
src/Symfony/Component/CssSelector/Tokenizer.php

@@ -114,7 +114,7 @@ class Tokenizer
      *
      * @return array
      */
-    protected function tokenizeEscapedString($s, $pos)
+    private function tokenizeEscapedString($s, $pos)
     {
         $quote = $s[$pos];
 
@@ -150,7 +150,7 @@ class Tokenizer
      *
      * @return string
      */
-    protected function unescapeStringLiteral($literal)
+    private function unescapeStringLiteral($literal)
     {
         return preg_replace_callback('#(\\\\(?:[A-Fa-f0-9]{1,6}(?:\r\n|\s)?|[^A-Fa-f0-9]))#', function ($matches) use ($literal)
         {
@@ -177,7 +177,7 @@ class Tokenizer
      *
      * @return array
      */
-    protected function tokenizeSymbol($s, $pos)
+    private function tokenizeSymbol($s, $pos)
     {
         $start = $pos;
 

+ 5 - 5
src/Symfony/Component/CssSelector/XPathExpr.php

@@ -21,11 +21,11 @@ namespace Symfony\Component\CssSelector;
  */
 class XPathExpr
 {
-    protected $prefix;
-    protected $path;
-    protected $element;
-    protected $condition;
-    protected $starPrefix;
+    private $prefix;
+    private $path;
+    private $element;
+    private $condition;
+    private $starPrefix;
 
     /**
      * Constructor.