@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | private $pseudo; |
| 11 | 11 | private $depth; |
| 12 | 12 | private $index; |
| 13 | - private $file; |
|
| 13 | + private $file; |
|
| 14 | 14 | private $line; |
| 15 | 15 | private $properties = []; |
| 16 | 16 | private $lastRun = 0; |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | $this->pseudo = $pseudo; |
| 27 | 27 | $this->depth = $depth; |
| 28 | 28 | $this->index = $index; |
| 29 | - $this->file = $file; |
|
| 29 | + $this->file = $file; |
|
| 30 | 30 | $this->line = $line; |
| 31 | 31 | $this->properties = $properties; |
| 32 | 32 | } |
@@ -40,7 +40,7 @@ |
||
| 40 | 40 | private function getTemplateContent($newNode, $tss) { |
| 41 | 41 | $result = []; |
| 42 | 42 | foreach ($newNode->childNodes as $node) { |
| 43 | - if (isset($node->tagName) && $node->tagName === 'template') $result[] = $this->getTemplateContent($node, $tss); |
|
| 43 | + if (isset($node->tagName) && $node->tagName === 'template') $result[] = $this->getTemplateContent($node, $tss); |
|
| 44 | 44 | else $result[] = $this->getClonedElement($node, $tss); |
| 45 | 45 | } |
| 46 | 46 | return $result; |
@@ -7,11 +7,11 @@ discard block |
||
| 7 | 7 | namespace Transphporm\Pseudo; |
| 8 | 8 | class Not implements \Transphporm\Pseudo { |
| 9 | 9 | private $cssToXpath; |
| 10 | - private $config; |
|
| 10 | + private $config; |
|
| 11 | 11 | |
| 12 | 12 | public function __construct(\Transphporm\Parser\CssToXpath $cssToXpath, \Transphporm\Config $config) { |
| 13 | 13 | $this->cssToXpath = $cssToXpath; |
| 14 | - $this->config = $config; |
|
| 14 | + $this->config = $config; |
|
| 15 | 15 | } |
| 16 | 16 | |
| 17 | 17 | public function match($name, $args, \DomElement $element) { |
@@ -26,19 +26,19 @@ discard block |
||
| 26 | 26 | foreach ($css as $selector) { |
| 27 | 27 | $tokenizer = new \Transphporm\Parser\Tokenizer($selector); |
| 28 | 28 | $xpathString = $this->cssToXpath->getXpath($tokenizer->getTokens()); |
| 29 | - $pseudo = $this->cssToXpath->getPseudo($tokenizer->getTokens()); |
|
| 30 | - $pseudoMatcher = $this->config->createPseudoMatcher($pseudo); |
|
| 29 | + $pseudo = $this->cssToXpath->getPseudo($tokenizer->getTokens()); |
|
| 30 | + $pseudoMatcher = $this->config->createPseudoMatcher($pseudo); |
|
| 31 | 31 | if ($this->matches($xpath->query($xpathString), $element, $pseudoMatcher)) return false; |
| 32 | 32 | } |
| 33 | 33 | return true; |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | - private function matches($foundElements, $element, $pseudoMatcher) { |
|
| 37 | - //Find all nodes matched by the expressions in the brackets :not(EXPR) |
|
| 38 | - foreach ($foundElements as $matchedElement) { |
|
| 39 | - //Check to see whether this node was matched by the not query |
|
| 40 | - if ($pseudoMatcher->matches($matchedElement) && $element->isSameNode($matchedElement)) return true; |
|
| 41 | - } |
|
| 42 | - return false; |
|
| 43 | - } |
|
| 36 | + private function matches($foundElements, $element, $pseudoMatcher) { |
|
| 37 | + //Find all nodes matched by the expressions in the brackets :not(EXPR) |
|
| 38 | + foreach ($foundElements as $matchedElement) { |
|
| 39 | + //Check to see whether this node was matched by the not query |
|
| 40 | + if ($pseudoMatcher->matches($matchedElement) && $element->isSameNode($matchedElement)) return true; |
|
| 41 | + } |
|
| 42 | + return false; |
|
| 43 | + } |
|
| 44 | 44 | } |
@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | private $rules; |
| 11 | 11 | private $configLine; |
| 12 | 12 | private $file; |
| 13 | - private $filePath; |
|
| 13 | + private $filePath; |
|
| 14 | 14 | private $line; |
| 15 | 15 | private $valueParser; |
| 16 | 16 | private $pseudoMatcher; |
@@ -18,11 +18,11 @@ discard block |
||
| 18 | 18 | private $functionSet; |
| 19 | 19 | |
| 20 | 20 | public function __construct(array $rules, &$configLine, $file, $line, PseudoMatcher $pseudoMatcher, |
| 21 | - \Transphporm\Parser\Value $valueParser, \Transphporm\FunctionSet $functionSet, \Transphporm\FilePath $filePath) { |
|
| 21 | + \Transphporm\Parser\Value $valueParser, \Transphporm\FunctionSet $functionSet, \Transphporm\FilePath $filePath) { |
|
| 22 | 22 | $this->rules = $rules; |
| 23 | 23 | $this->configLine = &$configLine; |
| 24 | 24 | $this->file = $file; |
| 25 | - $this->filePath = $filePath; |
|
| 25 | + $this->filePath = $filePath; |
|
| 26 | 26 | $this->line = $line; |
| 27 | 27 | $this->valueParser = $valueParser; |
| 28 | 28 | $this->pseudoMatcher = $pseudoMatcher; |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | |
| 32 | 32 | public function run(\DomElement $element) { |
| 33 | 33 | //Set the baseDir so that all files for this rule are relative to the file it came from |
| 34 | - if ($this->file !== null) $this->filePath->setBaseDir(dirname(realpath($this->file))); |
|
| 34 | + if ($this->file !== null) $this->filePath->setBaseDir(dirname(realpath($this->file))); |
|
| 35 | 35 | $this->functionSet->setElement($element); |
| 36 | 36 | $this->configLine = $this->line; |
| 37 | 37 | try { |
@@ -53,9 +53,9 @@ |
||
| 53 | 53 | $this->last = $value; |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | - public function makeTraversing() { |
|
| 57 | - $this->traversing = true; |
|
| 58 | - } |
|
| 56 | + public function makeTraversing() { |
|
| 57 | + $this->traversing = true; |
|
| 58 | + } |
|
| 59 | 59 | |
| 60 | 60 | //Applies the current operation to whatever is in $last based on $mode |
| 61 | 61 | public function process() { |
@@ -148,7 +148,7 @@ |
||
| 148 | 148 | } |
| 149 | 149 | else $parsedVal = null; |
| 150 | 150 | |
| 151 | - $this->result->postProcess($this->data, $val, $parsedVal, $this->allowNullResult); |
|
| 151 | + $this->result->postProcess($this->data, $val, $parsedVal, $this->allowNullResult); |
|
| 152 | 152 | |
| 153 | 153 | $this->last->clear(); |
| 154 | 154 | } |
@@ -92,10 +92,10 @@ |
||
| 92 | 92 | return $ranges; |
| 93 | 93 | } |
| 94 | 94 | |
| 95 | - private function add2DayRanges(&$ranges, $property, $when) { |
|
| 96 | - $rangeVal = $when === "before" ? 2 : -2; |
|
| 97 | - array_unshift($ranges, [$rangeVal, $rangeVal, $property, 1, '']); |
|
| 98 | - } |
|
| 95 | + private function add2DayRanges(&$ranges, $property, $when) { |
|
| 96 | + $rangeVal = $when === "before" ? 2 : -2; |
|
| 97 | + array_unshift($ranges, [$rangeVal, $rangeVal, $property, 1, '']); |
|
| 98 | + } |
|
| 99 | 99 | |
| 100 | 100 | /** Converts "week" to "weeks", "month" to "months" etc when plural is required using language from $locale */ |
| 101 | 101 | private function getPlural($strings, $num, $interval) { |
@@ -6,39 +6,39 @@ |
||
| 6 | 6 | * @version 1.2 */ |
| 7 | 7 | namespace Transphporm\Parser; |
| 8 | 8 | class TokenFilterIterator implements \Iterator { |
| 9 | - private $ignore; |
|
| 10 | - private $tokens; |
|
| 9 | + private $ignore; |
|
| 10 | + private $tokens; |
|
| 11 | 11 | |
| 12 | - public function __construct(Tokens $tokens, array $ignore) { |
|
| 13 | - $this->ignore = $ignore; |
|
| 14 | - $this->tokens = $tokens; |
|
| 15 | - } |
|
| 12 | + public function __construct(Tokens $tokens, array $ignore) { |
|
| 13 | + $this->ignore = $ignore; |
|
| 14 | + $this->tokens = $tokens; |
|
| 15 | + } |
|
| 16 | 16 | |
| 17 | - public function current() { |
|
| 18 | - return $this->tokens->current(); |
|
| 19 | - } |
|
| 17 | + public function current() { |
|
| 18 | + return $this->tokens->current(); |
|
| 19 | + } |
|
| 20 | 20 | |
| 21 | - public function key() { |
|
| 22 | - return $this->tokens->key(); |
|
| 23 | - } |
|
| 21 | + public function key() { |
|
| 22 | + return $this->tokens->key(); |
|
| 23 | + } |
|
| 24 | 24 | |
| 25 | - public function valid() { |
|
| 26 | - return $this->tokens->valid(); |
|
| 27 | - } |
|
| 25 | + public function valid() { |
|
| 26 | + return $this->tokens->valid(); |
|
| 27 | + } |
|
| 28 | 28 | |
| 29 | - public function next() { |
|
| 30 | - do { |
|
| 31 | - $this->tokens->next(); |
|
| 32 | - } |
|
| 33 | - while ($this->shouldContinue()); |
|
| 34 | - } |
|
| 29 | + public function next() { |
|
| 30 | + do { |
|
| 31 | + $this->tokens->next(); |
|
| 32 | + } |
|
| 33 | + while ($this->shouldContinue()); |
|
| 34 | + } |
|
| 35 | 35 | |
| 36 | - public function rewind() { |
|
| 37 | - $this->tokens->rewind(); |
|
| 38 | - while ($this->shouldContinue()) $this->tokens->next(); |
|
| 39 | - } |
|
| 36 | + public function rewind() { |
|
| 37 | + $this->tokens->rewind(); |
|
| 38 | + while ($this->shouldContinue()) $this->tokens->next(); |
|
| 39 | + } |
|
| 40 | 40 | |
| 41 | - private function shouldContinue() { |
|
| 42 | - return $this->tokens->valid() && in_array($this->tokens->current()['type'], $this->ignore); |
|
| 43 | - } |
|
| 41 | + private function shouldContinue() { |
|
| 42 | + return $this->tokens->valid() && in_array($this->tokens->current()['type'], $this->ignore); |
|
| 43 | + } |
|
| 44 | 44 | } |
@@ -2,5 +2,5 @@ |
||
| 2 | 2 | namespace Transphporm\Property; |
| 3 | 3 | |
| 4 | 4 | interface ContentPseudo { |
| 5 | - public function run($value, $pseudoArgs, $element, \Transphporm\Hook\PseudoMatcher $pseudoMatcher); |
|
| 5 | + public function run($value, $pseudoArgs, $element, \Transphporm\Hook\PseudoMatcher $pseudoMatcher); |
|
| 6 | 6 | } |