Completed
Push — master ( 78e634...2972d6 )
by Richard
02:04
created
src/TSSFunction/Math.php 3 patches
Indentation   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -3,33 +3,33 @@
 block discarded – undo
3 3
 namespace Transphporm\TSSFunction;
4 4
 
5 5
 class Math implements \Transphporm\TSSFunction {
6
-    private $mode;
6
+	private $mode;
7 7
 
8
-    const ADD = 1;
9
-    const SUBTRACT = 2;
10
-    const MULTIPLY = 3;
11
-    const DIVIDE = 4;
8
+	const ADD = 1;
9
+	const SUBTRACT = 2;
10
+	const MULTIPLY = 3;
11
+	const DIVIDE = 4;
12 12
 
13
-    public function __construct($mode) {
14
-        $this->mode = $mode;
15
-    }
13
+	public function __construct($mode) {
14
+		$this->mode = $mode;
15
+	}
16 16
 
17
-    public function run(array $args, \DomElement $element) {
18
-        $result = $args[0];
19
-        for ($i = 1; $i < count($args); $i++) $result = $this->getModeResult($args[$i], $result);
20
-        return $result;
21
-    }
17
+	public function run(array $args, \DomElement $element) {
18
+		$result = $args[0];
19
+		for ($i = 1; $i < count($args); $i++) $result = $this->getModeResult($args[$i], $result);
20
+		return $result;
21
+	}
22 22
 
23
-    private function getModeResult($val, $prev) {
24
-        switch ($this->mode) {
25
-            case Math::ADD:
26
-                return $prev+$val;
27
-            case Math::SUBTRACT:
28
-                return $prev-$val;
29
-            case Math::MULTIPLY:
30
-                return $prev*$val;
31
-            case MATH::DIVIDE:
32
-                return $prev/$val;
33
-        }
34
-    }
23
+	private function getModeResult($val, $prev) {
24
+		switch ($this->mode) {
25
+			case Math::ADD:
26
+				return $prev+$val;
27
+			case Math::SUBTRACT:
28
+				return $prev-$val;
29
+			case Math::MULTIPLY:
30
+				return $prev*$val;
31
+			case MATH::DIVIDE:
32
+				return $prev/$val;
33
+		}
34
+	}
35 35
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -27,9 +27,9 @@
 block discarded – undo
27 27
             case Math::SUBTRACT:
28 28
                 return $prev-$val;
29 29
             case Math::MULTIPLY:
30
-                return $prev*$val;
30
+                return $prev * $val;
31 31
             case MATH::DIVIDE:
32
-                return $prev/$val;
32
+                return $prev / $val;
33 33
         }
34 34
     }
35 35
 }
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,9 @@
 block discarded – undo
16 16
 
17 17
     public function run(array $args, \DomElement $element) {
18 18
         $result = $args[0];
19
-        for ($i = 1; $i < count($args); $i++) $result = $this->getModeResult($args[$i], $result);
19
+        for ($i = 1; $i < count($args); $i++) {
20
+        	$result = $this->getModeResult($args[$i], $result);
21
+        }
20 22
         return $result;
21 23
     }
22 24
 
Please login to merge, or discard this patch.