Completed
Push — master ( 8f1125...aa557b )
by Tom
02:47
created
src/Hook/Formatter.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -8,11 +8,15 @@
 block discarded – undo
8 8
 	}
9 9
 
10 10
 	public function format($value, $rules) {
11
-		if (!isset($rules['format'])) return $value;
11
+		if (!isset($rules['format'])) {
12
+			return $value;
13
+		}
12 14
 		$format = new \Transphporm\StringExtractor($rules['format']);
13 15
 		$options = explode(' ', $format);
14 16
 		$functionName = array_shift($options);
15
-		foreach ($options as &$f) $f = trim($format->rebuild($f), '"');
17
+		foreach ($options as &$f) {
18
+			$f = trim($format->rebuild($f), '"');
19
+		}
16 20
 
17 21
 		return $this->processFormat($options, $functionName, $value);		
18 22
 	}
Please login to merge, or discard this patch.
src/Property/Display.php 1 patch
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -7,7 +7,10 @@
 block discarded – undo
7 7
 namespace Transphporm\Property;
8 8
 class Display implements \Transphporm\Property {
9 9
 	public function run($value, \DomElement $element, \Transphporm\Hook\Rule $rule) {
10
-		if (strtolower($value[0]) === 'none') $element->setAttribute('transphporm', 'remove');
11
-		else $element->setAttribute('transphporm', 'show');
10
+		if (strtolower($value[0]) === 'none') {
11
+			$element->setAttribute('transphporm', 'remove');
12
+		} else {
13
+			$element->setAttribute('transphporm', 'show');
14
+		}
12 15
 	}
13 16
 }
14 17
\ No newline at end of file
Please login to merge, or discard this patch.
src/Property/Bind.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
 		$this->data = $data;
13 13
 	}
14 14
 
15
-	public function run($value, \DomElement $element, \Transphporm\Hook\Rule $rule)  {
15
+	public function run($value, \DomElement $element, \Transphporm\Hook\Rule $rule) {
16 16
 		$this->data->bind($element, $value);
17 17
 	}
18 18
 }
19 19
\ No newline at end of file
Please login to merge, or discard this patch.
src/Property/Content.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@
 block discarded – undo
40 40
 
41 41
 	private function pseudoBefore($value, $element, $rule) {
42 42
 		if (in_array('before', $rule->getPseudoMatcher()->getPseudo())) {
43
-			$element->firstChild->nodeValue = implode('', $value) . $element->firstChild->nodeValue;
43
+			$element->firstChild->nodeValue = implode('', $value).$element->firstChild->nodeValue;
44 44
 			return true;
45 45
 		}
46 46
 	}
Please login to merge, or discard this patch.
Braces   +8 added lines, -3 removed lines patch added patch discarded remove patch
@@ -22,8 +22,11 @@  discard block
 block discarded – undo
22 22
 			//Remove the current contents
23 23
 			$this->removeAllChildren($element);
24 24
 			//Now make a text node
25
-			if ($this->getContentMode($rule->getRules()) === 'replace') $this->replaceContent($element, $value);
26
-			else $this->appendContent($element, $value);
25
+			if ($this->getContentMode($rule->getRules()) === 'replace') {
26
+				$this->replaceContent($element, $value);
27
+			} else {
28
+				$this->appendContent($element, $value);
29
+			}
27 30
 		}
28 31
 	}
29 32
 
@@ -88,6 +91,8 @@  discard block
 block discarded – undo
88 91
 	}
89 92
 
90 93
 	private function removeAllChildren($element) {
91
-		while ($element->hasChildNodes()) $element->removeChild($element->firstChild);
94
+		while ($element->hasChildNodes()) {
95
+			$element->removeChild($element->firstChild);
96
+		}
92 97
 	}
93 98
 }
94 99
\ No newline at end of file
Please login to merge, or discard this patch.
src/Property/Repeat.php 3 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
 		$this->data = $data;
13 13
 	}
14 14
 
15
-	public function run($value, \DomElement $element, \Transphporm\Hook\Rule $rule)  {
15
+	public function run($value, \DomElement $element, \Transphporm\Hook\Rule $rule) {
16 16
 		if ($element->getAttribute('transphporm') === 'added') return $element->parentNode->removeChild($element);
17 17
 
18 18
 		foreach ($value as $key => $iteration) {
Please login to merge, or discard this patch.
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -13,7 +13,9 @@  discard block
 block discarded – undo
13 13
 	}
14 14
 
15 15
 	public function run($value, \DomElement $element, \Transphporm\Hook\Rule $rule)  {
16
-		if ($element->getAttribute('transphporm') === 'added') return $element->parentNode->removeChild($element);
16
+		if ($element->getAttribute('transphporm') === 'added') {
17
+			return $element->parentNode->removeChild($element);
18
+		}
17 19
 
18 20
 		foreach ($value as $key => $iteration) {
19 21
 			$clone = $element->cloneNode(true);
@@ -37,7 +39,9 @@  discard block
 block discarded – undo
37 39
 
38 40
 	private function createHook($newRules, $rule) {
39 41
 		$hook = new \Transphporm\Hook\Rule($newRules, $rule->getPseudoMatcher(), $this->data);
40
-		foreach ($rule->getProperties() as $name => $property) $hook->registerProperty($name, $property);
42
+		foreach ($rule->getProperties() as $name => $property) {
43
+			$hook->registerProperty($name, $property);
44
+		}
41 45
 		return $hook;
42 46
 	}
43 47
 }
44 48
\ No newline at end of file
Please login to merge, or discard this patch.
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -35,6 +35,9 @@
 block discarded – undo
35 35
 		return false;
36 36
 	}
37 37
 
38
+	/**
39
+	 * @param \Transphporm\Hook\Rule $rule
40
+	 */
38 41
 	private function createHook($newRules, $rule) {
39 42
 		$hook = new \Transphporm\Hook\Rule($newRules, $rule->getPseudoMatcher(), $this->data);
40 43
 		foreach ($rule->getProperties() as $name => $property) $hook->registerProperty($name, $property);
Please login to merge, or discard this patch.
src/Builder.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 
37 37
 		$cachedOutput = $this->loadTemplate();
38 38
 		//To be a valid XML document it must have a root element, automatically wrap it in <template> to ensure it does
39
-		$template = new Template($this->isValidDoc($cachedOutput['body']) ? str_ireplace('<!doctype', '<!DOCTYPE', $cachedOutput['body']) : '<template>' . $cachedOutput['body'] . '</template>' );
39
+		$template = new Template($this->isValidDoc($cachedOutput['body']) ? str_ireplace('<!doctype', '<!DOCTYPE', $cachedOutput['body']) : '<template>'.$cachedOutput['body'].'</template>');
40 40
 
41 41
 		//Allow $time to be set via arguments to spoof time passage during tests
42 42
 		foreach ($this->getRules($template) as $rule) {
@@ -92,11 +92,11 @@  discard block
 block discarded – undo
92 92
 	//N.b. only files can be cached
93 93
 	private function getRules($template) {		
94 94
 		if (is_file($this->tss)) {
95
-			$this->baseDir = dirname(realpath($this->tss)) . DIRECTORY_SEPARATOR;
95
+			$this->baseDir = dirname(realpath($this->tss)).DIRECTORY_SEPARATOR;
96 96
 			//The cache for the key: the filename and template prefix
97 97
 			//Each template may have a different prefix which changes the parsed TSS,
98 98
 			//Because of this the cache needs to be generated for each template prefix.
99
-			$key = $this->tss . $template->getPrefix() . $this->baseDir;
99
+			$key = $this->tss.$template->getPrefix().$this->baseDir;
100 100
 			//Try to load the cached rules, if not set in the cache (or expired) parse the supplied sheet
101 101
 			$rules = $this->cache->load($key, filemtime($this->tss));
102 102
 			if (!$rules) return $this->cache->write($key, (new Sheet(file_get_contents($this->tss), $this->baseDir, $template->getPrefix()))->parse());
@@ -111,8 +111,8 @@  discard block
 block discarded – undo
111 111
 
112 112
 	private function getLocale() {
113 113
 		if (is_array($this->locale)) return $this->locale;
114
-		else if (strlen($this->locale) > 0) return json_decode(file_get_contents(__DIR__ . DIRECTORY_SEPARATOR . 'Formatter' . DIRECTORY_SEPARATOR . 'Locale' . DIRECTORY_SEPARATOR . $this->locale . '.json'), true);
115
-		else return json_decode(file_get_contents(__DIR__ . DIRECTORY_SEPARATOR . 'Formatter' . DIRECTORY_SEPARATOR . 'Locale' . DIRECTORY_SEPARATOR . 'enGB.json'), true);
114
+		else if (strlen($this->locale) > 0) return json_decode(file_get_contents(__DIR__.DIRECTORY_SEPARATOR.'Formatter'.DIRECTORY_SEPARATOR.'Locale'.DIRECTORY_SEPARATOR.$this->locale.'.json'), true);
115
+		else return json_decode(file_get_contents(__DIR__.DIRECTORY_SEPARATOR.'Formatter'.DIRECTORY_SEPARATOR.'Locale'.DIRECTORY_SEPARATOR.'enGB.json'), true);
116 116
 	}
117 117
 
118 118
 	public function registerProperty($name, Property $property) {
Please login to merge, or discard this patch.
Braces   +25 added lines, -10 removed lines patch added patch discarded remove patch
@@ -41,7 +41,9 @@  discard block
 block discarded – undo
41 41
 
42 42
 		//Allow $time to be set via arguments to spoof time passage during tests
43 43
 		foreach ($this->getRules($template, $valueParser) as $rule) {
44
-			if ($rule->shouldRun($this->time)) $this->executeTssRule($rule, $template, $data, $valueParser);			
44
+			if ($rule->shouldRun($this->time)) {
45
+				$this->executeTssRule($rule, $template, $data, $valueParser);
46
+			}
45 47
 		}
46 48
 		
47 49
 		$result = ['body' => $template->output($document), 'headers' => array_merge($cachedOutput['headers'], $headers)];
@@ -58,7 +60,9 @@  discard block
 block discarded – undo
58 60
 		$formatter->register(new Formatter\Date($locale));
59 61
 		$formatter->register(new Formatter\StringFormatter());
60 62
 		
61
-		foreach ($this->formatters as $format) $formatter->register($format);
63
+		foreach ($this->formatters as $format) {
64
+			$formatter->register($format);
65
+		}
62 66
 
63 67
 		$this->registerProperty('content', new Property\Content($data, $headers, $formatter));
64 68
 		$this->registerProperty('repeat', new Property\Repeat($data));
@@ -76,7 +80,9 @@  discard block
 block discarded – undo
76 80
 	private function executeTssRule($rule, $template, $data, $valueParser) {
77 81
 		$rule->touch();
78 82
 		$hook = new Hook\Rule($rule->properties, new Hook\PseudoMatcher($rule->pseudo, $data), $valueParser);
79
-		foreach ($this->registeredProperties as $name => $property) $hook->registerProperty($name, $property);
83
+		foreach ($this->registeredProperties as $name => $property) {
84
+			$hook->registerProperty($name, $property);
85
+		}
80 86
 		$template->addHook($rule->query, $hook);
81 87
 	}
82 88
 
@@ -85,8 +91,9 @@  discard block
 block discarded – undo
85 91
 		if (trim($this->template)[0] !== '<') {			
86 92
 			$xml = $this->cache->load($this->template, filemtime($this->template));
87 93
 			return $xml ? $xml : ['body' => file_get_contents($this->template), 'headers' => []];
94
+		} else {
95
+			return ['body' => $this->template, 'headers' => []];
88 96
 		}
89
-		else return ['body' => $this->template, 'headers' => []];	
90 97
 	}
91 98
 
92 99
 	//Load the TSS rules either from a file or as a string
@@ -100,10 +107,14 @@  discard block
 block discarded – undo
100 107
 			$key = $this->tss . $template->getPrefix() . $this->baseDir;
101 108
 			//Try to load the cached rules, if not set in the cache (or expired) parse the supplied sheet
102 109
 			$rules = $this->cache->load($key, filemtime($this->tss));
103
-			if (!$rules) return $this->cache->write($key, (new Sheet(file_get_contents($this->tss), $this->baseDir, $valueParser, $template->getPrefix()))->parse());
104
-			else return $rules;
110
+			if (!$rules) {
111
+				return $this->cache->write($key, (new Sheet(file_get_contents($this->tss), $this->baseDir, $valueParser, $template->getPrefix()))->parse());
112
+			} else {
113
+				return $rules;
114
+			}
115
+		} else {
116
+			return (new Sheet($this->tss, $this->baseDir, $valueParser, $template->getPrefix()))->parse();
105 117
 		}
106
-		else return (new Sheet($this->tss, $this->baseDir, $valueParser, $template->getPrefix()))->parse();
107 118
 	}
108 119
 
109 120
 	public function setCache(\ArrayAccess $cache) {
@@ -111,9 +122,13 @@  discard block
 block discarded – undo
111 122
 	}
112 123
 
113 124
 	private function getLocale() {
114
-		if (is_array($this->locale)) return $this->locale;
115
-		else if (strlen($this->locale) > 0) return json_decode(file_get_contents(__DIR__ . DIRECTORY_SEPARATOR . 'Formatter' . DIRECTORY_SEPARATOR . 'Locale' . DIRECTORY_SEPARATOR . $this->locale . '.json'), true);
116
-		else return json_decode(file_get_contents(__DIR__ . DIRECTORY_SEPARATOR . 'Formatter' . DIRECTORY_SEPARATOR . 'Locale' . DIRECTORY_SEPARATOR . 'enGB.json'), true);
125
+		if (is_array($this->locale)) {
126
+			return $this->locale;
127
+		} else if (strlen($this->locale) > 0) {
128
+			return json_decode(file_get_contents(__DIR__ . DIRECTORY_SEPARATOR . 'Formatter' . DIRECTORY_SEPARATOR . 'Locale' . DIRECTORY_SEPARATOR . $this->locale . '.json'), true);
129
+		} else {
130
+			return json_decode(file_get_contents(__DIR__ . DIRECTORY_SEPARATOR . 'Formatter' . DIRECTORY_SEPARATOR . 'Locale' . DIRECTORY_SEPARATOR . 'enGB.json'), true);
131
+		}
117 132
 	}
118 133
 
119 134
 	public function registerProperty($name, Property $property) {
Please login to merge, or discard this patch.
src/ValueParser.php 3 patches
Doc Comments   +7 added lines patch added patch discarded remove patch
@@ -63,6 +63,9 @@  discard block
 block discarded – undo
63 63
 		return $array;
64 64
 	}
65 65
 
66
+	/**
67
+	 * @param null|\DOMElement $element
68
+	 */
66 69
 	private function callFunc($name, $params, $element) {
67 70
 		if ($name && is_callable([$this->dataFunction, $name])) {
68 71
 			return $this->dataFunction->$name($this->parse($params, $element), $element);	
@@ -70,6 +73,10 @@  discard block
 block discarded – undo
70 73
 		return false;
71 74
 	}
72 75
 
76
+	/**
77
+	 * @param string $remaining
78
+	 * @param null|\DOMElement $element
79
+	 */
73 80
 	private function parseNextValue($remaining, $result, $element) {
74 81
 		if (strlen($remaining) > 0 && $remaining[0] == ',') $result = array_merge($result, $this->parse(trim(substr($remaining, 1)), $element));
75 82
 		return $result;
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@
 block discarded – undo
64 64
 		$finalPos = $this->findMatchingPos($str, $marker);
65 65
 		$string = substr($str, 1, $finalPos-1);
66 66
 		//Now remove escape characters
67
-		return str_replace('\\' . $marker, $marker, $string);
67
+		return str_replace('\\'.$marker, $marker, $string);
68 68
 	}
69 69
 
70 70
 	private function parseFunction($function) {
Please login to merge, or discard this patch.
Braces   +20 added lines, -11 removed lines patch added patch discarded remove patch
@@ -27,14 +27,17 @@  discard block
 block discarded – undo
27 27
 
28 28
 			//Count the number of fresh opening ( before $close
29 29
 			$cPos = $open+1;
30
-			while (($cPos = strpos($function, '(', $cPos+1)) !== false && $cPos < $close) $close = strpos($function, ')', $close+1);
30
+			while (($cPos = strpos($function, '(', $cPos+1)) !== false && $cPos < $close) {
31
+				$close = strpos($function, ')', $close+1);
32
+			}
31 33
 
32 34
 			$name = substr($function, 0, $open);
33 35
 
34 36
 			$params = substr($function, $open+1, $close-$open-1);
35 37
 			return ['name' => $name, 'params' => $params, 'endPoint' => $close];
38
+		} else {
39
+			return ['name' => null, 'params' => $function, 'endPoint' => strlen($function)];
36 40
 		}
37
-		else return ['name' => null, 'params' => $function, 'endPoint' => strlen($function)];
38 41
 		
39 42
 	}
40 43
 
@@ -43,23 +46,26 @@  discard block
 block discarded – undo
43 46
 		if ($function && in_array($function[0], ['\'', '"'])) {
44 47
 			$finalPos = $this->findMatchingPos($function, $function[0]);
45 48
 			$result[] = $this->extractQuotedString($function[0], $function);
46
-		}
47
-		else {
49
+		} else {
48 50
 			$func = $this->parseFunction($function);
49 51
 			$finalPos = $func['endPoint'];			
50 52
 
51 53
 			if (($data = $this->callFunc($func['name'], $func['params'], $element)) !== false) {
52 54
 				$result = $this->appendToArray($result, $data);
53
-			} 
54
-			else $result[] = trim($function);
55
+			} else {
56
+				$result[] = trim($function);
57
+			}
55 58
 		}
56 59
 		$remaining = trim(substr($function, $finalPos+1));
57 60
 		return $this->parseNextValue($remaining, $result, $element);
58 61
 	}
59 62
 
60 63
 	private function appendToArray($array, $value) {
61
-		if (is_array($value)) $array += $value;
62
-		else $array[] = $value;
64
+		if (is_array($value)) {
65
+			$array += $value;
66
+		} else {
67
+			$array[] = $value;
68
+		}
63 69
 		return $array;
64 70
 	}
65 71
 
@@ -71,7 +77,9 @@  discard block
 block discarded – undo
71 77
 	}
72 78
 
73 79
 	private function parseNextValue($remaining, $result, $element) {
74
-		if (strlen($remaining) > 0 && $remaining[0] == ',') $result = array_merge($result, $this->parse(trim(substr($remaining, 1)), $element));
80
+		if (strlen($remaining) > 0 && $remaining[0] == ',') {
81
+			$result = array_merge($result, $this->parse(trim(substr($remaining, 1)), $element));
82
+		}
75 83
 		return $result;
76 84
 	}
77 85
 	
@@ -79,8 +87,9 @@  discard block
 block discarded – undo
79 87
 		$pos = $start+1;
80 88
 		$end = 0;
81 89
 		while ($end = strpos($string, $char, $pos)) {
82
-			if ($string[$end-1] === $escape) $pos = $end+1;
83
-			else {
90
+			if ($string[$end-1] === $escape) {
91
+				$pos = $end+1;
92
+			} else {
84 93
 				break;
85 94
 			}
86 95
 		}
Please login to merge, or discard this patch.
src/CssToXpath.php 2 patches
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -13,15 +13,15 @@  discard block
 block discarded – undo
13 13
 	private $valueParser;
14 14
 
15 15
 	public function __construct($css, ValueParser $valueParser, $prefix = '') {
16
-		$this->css = str_replace([' >', '> '],['>', '>'], trim($css));
16
+		$this->css = str_replace([' >', '> '], ['>', '>'], trim($css));
17 17
 		$this->valueParser = $valueParser;
18 18
 		$this->translators = [
19
-			' ' => function($string) use ($prefix) { return '//' . $prefix . $string;	},
20
-			'' => function($string) use ($prefix) { return '/' . $prefix . $string;	},
21
-			'>' => function($string) use ($prefix) { return '/' . $prefix  . $string; },
22
-			'#' => function($string) { return '[@id=\'' . $string . '\']'; },
23
-			'.' => function($string) { return '[contains(concat(\' \', normalize-space(@class), \' \'), \' ' . $string . ' \')]'; }, 
24
-			'[' => function($string) { return '[@' . $this->parseAttr($string) . ']';	},
19
+			' ' => function($string) use ($prefix) { return '//'.$prefix.$string; },
20
+			'' => function($string) use ($prefix) { return '/'.$prefix.$string; },
21
+			'>' => function($string) use ($prefix) { return '/'.$prefix.$string; },
22
+			'#' => function($string) { return '[@id=\''.$string.'\']'; },
23
+			'.' => function($string) { return '[contains(concat(\' \', normalize-space(@class), \' \'), \' '.$string.' \')]'; }, 
24
+			'[' => function($string) { return '[@'.$this->parseAttr($string).']'; },
25 25
 			']' => function() {	return ''; }
26 26
 		];
27 27
 	}
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 				$parts = explode($comparator, $attr);
41 41
 
42 42
 				foreach ($parts as &$part) $part = implode('', $this->valueParser->parse($part));
43
-				if (isset($parts[1])) $parts[1] = '"' . $parts[1] . '"';
43
+				if (isset($parts[1])) $parts[1] = '"'.$parts[1].'"';
44 44
 				return implode($comparator, $parts);
45 45
 			}
46 46
 		}
Please login to merge, or discard this patch.
Braces   +8 added lines, -3 removed lines patch added patch discarded remove patch
@@ -41,7 +41,9 @@  discard block
 block discarded – undo
41 41
 				$parts = array_map(function($val) {
42 42
 					return implode($this->valueParser->parse($val));
43 43
 				}, $parts);
44
-				if (isset($parts[1])) $parts[1] = '"' . $parts[1] . '"';
44
+				if (isset($parts[1])) {
45
+					$parts[1] = '"' . $parts[1] . '"';
46
+				}
45 47
 				return implode($comparator, $parts);
46 48
 			}
47 49
 		}
@@ -60,8 +62,9 @@  discard block
 block discarded – undo
60 62
 				$selector = $this->createSelector();
61 63
 				$selector->type = $css[$i];
62 64
 				$selectors[] = $selector;
65
+			} else {
66
+				$selector->string .= $css[$i];
63 67
 			}
64
-			else $selector->string .= $css[$i];			
65 68
 		}
66 69
 		return $selectors;
67 70
 	}
@@ -72,7 +75,9 @@  discard block
 block discarded – undo
72 75
 		$this->depth = count($selectors);
73 76
 		$xpath = '/';
74 77
 		foreach ($selectors as $selector) {
75
-			if (isset($this->translators[$selector->type])) $xpath .= $this->translators[$selector->type]($selector->string);
78
+			if (isset($this->translators[$selector->type])) {
79
+				$xpath .= $this->translators[$selector->type]($selector->string);
80
+			}
76 81
 		}
77 82
 
78 83
 		$xpath = str_replace('/[', '/*[', $xpath);
Please login to merge, or discard this patch.
src/Hook/Rule.php 1 patch
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -20,11 +20,15 @@  discard block
 block discarded – undo
20 20
 
21 21
 	public function run(\DomElement $element) {	
22 22
 		//Don't run if there's a pseudo element like nth-child() and this element doesn't match it
23
-		if (!$this->pseudoMatcher->matches($element)) return;
23
+		if (!$this->pseudoMatcher->matches($element)) {
24
+			return;
25
+		}
24 26
 
25 27
 		foreach ($this->rules as $name => $value) {
26 28
 			$result = $this->callProperty($name, $element, $this->valueParser->parse(trim($value), $element));
27
-			if ($result === false) break;
29
+			if ($result === false) {
30
+				break;
31
+			}
28 32
 		}
29 33
 	}
30 34
 
@@ -45,7 +49,9 @@  discard block
 block discarded – undo
45 49
 	}
46 50
 
47 51
 	private function callProperty($name, $element, $value) {
48
-		if (isset($this->properties[$name])) return $this->properties[$name]->run($value, $element, $this);
52
+		if (isset($this->properties[$name])) {
53
+			return $this->properties[$name]->run($value, $element, $this);
54
+		}
49 55
 		return false;
50 56
 	}
51 57
 
Please login to merge, or discard this patch.