[CssSelector] fixed coding standards: removed useless else statements
This commit is contained in:
parent
5d99cba7ab
commit
45a0d739b9
@ -117,10 +117,8 @@ class AttribNode implements NodeInterface
|
|||||||
{
|
{
|
||||||
return '@'.$this->attrib;
|
return '@'.$this->attrib;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
return sprintf('@%s:%s', $this->namespace, $this->attrib);
|
||||||
return sprintf('@%s:%s', $this->namespace, $this->attrib);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function formatAttrib()
|
protected function formatAttrib()
|
||||||
@ -129,9 +127,7 @@ class AttribNode implements NodeInterface
|
|||||||
{
|
{
|
||||||
return $this->attrib;
|
return $this->attrib;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
return sprintf('%s|%s', $this->namespace, $this->attrib);
|
||||||
return sprintf('%s|%s', $this->namespace, $this->attrib);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -45,10 +45,8 @@ class ElementNode implements NodeInterface
|
|||||||
{
|
{
|
||||||
return $this->element;
|
return $this->element;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
return sprintf('%s|%s', $this->namespace, $this->element);
|
||||||
return sprintf('%s|%s', $this->namespace, $this->element);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function toXpath()
|
public function toXpath()
|
||||||
|
@ -208,11 +208,13 @@ class FunctionNode implements NodeInterface
|
|||||||
{
|
{
|
||||||
return array(2, 1);
|
return array(2, 1);
|
||||||
}
|
}
|
||||||
elseif ($s == 'even')
|
|
||||||
|
if ($s == 'even')
|
||||||
{
|
{
|
||||||
return array(2, 0);
|
return array(2, 0);
|
||||||
}
|
}
|
||||||
elseif ($s == 'n')
|
|
||||||
|
if ($s == 'n')
|
||||||
{
|
{
|
||||||
return array(1, 0);
|
return array(1, 0);
|
||||||
}
|
}
|
||||||
|
@ -104,10 +104,8 @@ class Parser
|
|||||||
{
|
{
|
||||||
return $result[0];
|
return $result[0];
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
return new Node\OrNode($result);
|
||||||
return new Node\OrNode($result);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function parseSelector($stream)
|
protected function parseSelector($stream)
|
||||||
|
@ -52,18 +52,16 @@ class TokenStream
|
|||||||
|
|
||||||
return $this->peeked;
|
return $this->peeked;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
|
if (!count($this->tokens))
|
||||||
{
|
{
|
||||||
if (!count($this->tokens))
|
return null;
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
$next = array_shift($this->tokens);
|
|
||||||
$this->used[] = $next;
|
|
||||||
|
|
||||||
return $next;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$next = array_shift($this->tokens);
|
||||||
|
$this->used[] = $next;
|
||||||
|
|
||||||
|
return $next;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function peek()
|
public function peek()
|
||||||
|
Reference in New Issue
Block a user