Completed
Push — master ( f01e17...9f64d6 )
by Tom
01:58
created
src/Hook/ElementData.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,9 @@
 block discarded – undo
25 25
 	/** Returns the data that has been bound to $element, or, if no data is bound to $element climb the DOM tree to find the data bound to a parent node*/
26 26
 	public function getData(\DomElement $element = null, $type = 'data') {
27 27
 		while ($element) {
28
-			if (isset($this->elementMap[$element]) && array_key_exists($type, $this->elementMap[$element])) return $this->elementMap[$element][$type];
28
+			if (isset($this->elementMap[$element]) && array_key_exists($type, $this->elementMap[$element])) {
29
+				return $this->elementMap[$element][$type];
30
+			}
29 31
 			$element = $element->parentNode;
30 32
 		}
31 33
 		return $this->data;
Please login to merge, or discard this patch.
src/Parser/Tokenizer/Literals.php 1 patch
Braces   +7 added lines, -3 removed lines patch added patch discarded remove patch
@@ -37,9 +37,13 @@
 block discarded – undo
37 37
 	}
38 38
 
39 39
 	private function processLiterals($tokens, $name, $str) {
40
-		if (is_numeric($name)) $tokens->add(['type' => Tokenizer::NUMERIC, 'value' => $name]);
41
-		else if (method_exists($this, $name)) $this->$name($tokens);
42
-		else $tokens->add(['type' => Tokenizer::NAME, 'value' => $name, 'line' => $str->lineNo()]);
40
+		if (is_numeric($name)) {
41
+			$tokens->add(['type' => Tokenizer::NUMERIC, 'value' => $name]);
42
+		} else if (method_exists($this, $name)) {
43
+			$this->$name($tokens);
44
+		} else {
45
+			$tokens->add(['type' => Tokenizer::NAME, 'value' => $name, 'line' => $str->lineNo()]);
46
+		}
43 47
 	}
44 48
 
45 49
 	private function true($tokens) {
Please login to merge, or discard this patch.
src/Parser/ValueResult.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -108,7 +108,7 @@
 block discarded – undo
108 108
 
109 109
 	//Postprocessing - replace values with null where allowed, or override a value at position
110 110
 	public function postProcess(ValueData $data, $val, $overrideVal, $allowNull) {
111
-        if ($this->getMode() !== Tokenizer::ARG) return;
111
+		if ($this->getMode() !== Tokenizer::ARG) return;
112 112
 		foreach ($this->getResult() as $i => $value) {
113 113
 			if (is_scalar($value)) {
114 114
 				$val = ($overrideVal == $val) ? $data->read($value) : $overrideVal;
Please login to merge, or discard this patch.
Braces   +11 added lines, -6 removed lines patch added patch discarded remove patch
@@ -33,14 +33,17 @@  discard block
 block discarded – undo
33 33
 		];
34 34
 
35 35
 		if ($funcs[$this->mode] === 'concat' && is_numeric($newValue)
36
-			&& is_numeric($this->result[count($this->result)-1]))
37
-			$this->add($newValue);
38
-		else
39
-			$this->{$funcs[$this->mode]}($newValue);
36
+			&& is_numeric($this->result[count($this->result)-1])) {
37
+					$this->add($newValue);
38
+		} else {
39
+					$this->{$funcs[$this->mode]}($newValue);
40
+		}
40 41
 	}
41 42
 
42 43
 	public function in($value) {
43
-		if (!is_array($value)) throw new \Exception(' `in` can only be used with arrays');
44
+		if (!is_array($value)) {
45
+			throw new \Exception(' `in` can only be used with arrays');
46
+		}
44 47
 		$this->result[count($this->result)-1] = in_array($this->result[count($this->result)-1], $value);
45 48
 	}
46 49
 
@@ -108,7 +111,9 @@  discard block
 block discarded – undo
108 111
 
109 112
 	//Postprocessing - replace values with null where allowed, or override a value at position
110 113
 	public function postProcess(ValueData $data, $val, $overrideVal, $allowNull) {
111
-        if ($this->getMode() !== Tokenizer::ARG) return;
114
+        if ($this->getMode() !== Tokenizer::ARG) {
115
+        	return;
116
+        }
112 117
 		foreach ($this->getResult() as $i => $value) {
113 118
 			if (is_scalar($value)) {
114 119
 				$val = ($overrideVal == $val) ? $data->read($value) : $overrideVal;
Please login to merge, or discard this patch.
src/FunctionSet.php 1 patch
Braces   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -26,11 +26,12 @@
 block discarded – undo
26 26
 	private function getArgs0($name, $args) {
27 27
 		if (isset($this->functions[$name]) && !($this->functions[$name] instanceof TSSFunction\Data)) {
28 28
 			$tokens = $args[0];
29
-			if ($tokens->count() == 0) return [];
29
+			if ($tokens->count() == 0) {
30
+				return [];
31
+			}
30 32
 			$parser = new \Transphporm\Parser\Value($this);
31 33
 			return $parser->parseTokens($tokens, $this->elementData->getData($this->element));
32
-		}
33
-		else {
34
+		} else {
34 35
 			return iterator_to_array($args[0]);
35 36
 		}
36 37
 
Please login to merge, or discard this patch.