Passed
Push — master ( 0df4f1...5c4201 )
by Siwapun
10:22
created
test/OrLogicallyTest.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -7,15 +7,15 @@
 block discarded – undo
7 7
 
8 8
 class OrLogicallyTest extends TestCase
9 9
 {
10
-  public function testOrLogicallyWithTrueAndFalse()
11
-  {
10
+    public function testOrLogicallyWithTrueAndFalse()
11
+    {
12 12
     $actual = orLogically(true)(false);
13 13
     $this->assertTrue($actual);
14
-  }
14
+    }
15 15
 
16
-  public function testOrLogicallyWithFalseAndFalse()
17
-  {
16
+    public function testOrLogicallyWithFalseAndFalse()
17
+    {
18 18
     $actual = orLogically(false)(false);
19 19
     $this->assertFalse($actual);
20
-  }
20
+    }
21 21
 }
Please login to merge, or discard this patch.
test/AndLogicallyTest.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -6,15 +6,15 @@
 block discarded – undo
6 6
 
7 7
 class AndLogicallyTest extends TestCase
8 8
 {
9
-  public function testAndLogicallyWithTrueAndTrue()
10
-  {
9
+    public function testAndLogicallyWithTrueAndTrue()
10
+    {
11 11
     $actual = andLogically(true)(true);
12 12
     $this->assertTrue($actual);
13
-  }
13
+    }
14 14
 
15
-  public function testAndLogicallyWithTrueAndFalse()
16
-  {
15
+    public function testAndLogicallyWithTrueAndFalse()
16
+    {
17 17
     $actual = andLogically(true)(false);
18 18
     $this->assertFalse($actual);
19
-  }
19
+    }
20 20
 }
Please login to merge, or discard this patch.
src/logic.php 2 patches
Indentation   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -8,22 +8,22 @@  discard block
 block discarded – undo
8 8
  */
9 9
 function andLogically()
10 10
 {
11
-  $and = function (bool $firstValue, bool $secondValue) {
11
+    $and = function (bool $firstValue, bool $secondValue) {
12 12
     return $firstValue && $secondValue;
13
-  };
14
-  $arguments = func_get_args();
15
-  $curried = curryN($and, 2);
16
-  return call_user_func_array($curried, $arguments);
13
+    };
14
+    $arguments = func_get_args();
15
+    $curried = curryN($and, 2);
16
+    return call_user_func_array($curried, $arguments);
17 17
 }
18 18
 
19 19
 function defaultTo()
20 20
 {
21
-  $defaultTo = function ($defaultValue, $value) {
21
+    $defaultTo = function ($defaultValue, $value) {
22 22
     return $value ? $value : $defaultValue;
23
-  };
24
-  $arguments = func_get_args();
25
-  $curried = curryN($defaultTo, 2);
26
-  return call_user_func_array($curried, $arguments);
23
+    };
24
+    $arguments = func_get_args();
25
+    $curried = curryN($defaultTo, 2);
26
+    return call_user_func_array($curried, $arguments);
27 27
 }
28 28
 
29 29
 /**
@@ -35,18 +35,18 @@  discard block
 block discarded – undo
35 35
  */
36 36
 function ifElse()
37 37
 {
38
-  $ifElse = function (callable $condition, callable $onTrue, callable $onFalse) {
38
+    $ifElse = function (callable $condition, callable $onTrue, callable $onFalse) {
39 39
     return function () use ($condition, $onTrue, $onFalse) {
40
-      $arguments = func_get_args();
41
-      if (call_user_func_array($condition, $arguments)) {
40
+        $arguments = func_get_args();
41
+        if (call_user_func_array($condition, $arguments)) {
42 42
         return call_user_func_array($onTrue, $arguments);
43
-      }
44
-      return call_user_func_array($onFalse, $arguments);
43
+        }
44
+        return call_user_func_array($onFalse, $arguments);
45 45
     };
46
-  };
47
-  $arguments = func_get_args();
48
-  $curried = curryN($ifElse, 3);
49
-  return call_user_func_array($curried, $arguments);
46
+    };
47
+    $arguments = func_get_args();
48
+    $curried = curryN($ifElse, 3);
49
+    return call_user_func_array($curried, $arguments);
50 50
 }
51 51
 
52 52
 /**
@@ -56,10 +56,10 @@  discard block
 block discarded – undo
56 56
  */
57 57
 function orLogically()
58 58
 {
59
-  $and = function (bool $firstValue, bool $secondValue) {
59
+    $and = function (bool $firstValue, bool $secondValue) {
60 60
     return $firstValue || $secondValue;
61
-  };
62
-  $arguments = func_get_args();
63
-  $curried = curryN($and, 2);
64
-  return call_user_func_array($curried, $arguments);
61
+    };
62
+    $arguments = func_get_args();
63
+    $curried = curryN($and, 2);
64
+    return call_user_func_array($curried, $arguments);
65 65
 }
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
  */
9 9
 function andLogically()
10 10
 {
11
-  $and = function (bool $firstValue, bool $secondValue) {
11
+  $and = function(bool $firstValue, bool $secondValue) {
12 12
     return $firstValue && $secondValue;
13 13
   };
14 14
   $arguments = func_get_args();
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 
19 19
 function defaultTo()
20 20
 {
21
-  $defaultTo = function ($defaultValue, $value) {
21
+  $defaultTo = function($defaultValue, $value) {
22 22
     return $value ? $value : $defaultValue;
23 23
   };
24 24
   $arguments = func_get_args();
@@ -35,8 +35,8 @@  discard block
 block discarded – undo
35 35
  */
36 36
 function ifElse()
37 37
 {
38
-  $ifElse = function (callable $condition, callable $onTrue, callable $onFalse) {
39
-    return function () use ($condition, $onTrue, $onFalse) {
38
+  $ifElse = function(callable $condition, callable $onTrue, callable $onFalse) {
39
+    return function() use ($condition, $onTrue, $onFalse) {
40 40
       $arguments = func_get_args();
41 41
       if (call_user_func_array($condition, $arguments)) {
42 42
         return call_user_func_array($onTrue, $arguments);
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
  */
57 57
 function orLogically()
58 58
 {
59
-  $and = function (bool $firstValue, bool $secondValue) {
59
+  $and = function(bool $firstValue, bool $secondValue) {
60 60
     return $firstValue || $secondValue;
61 61
   };
62 62
   $arguments = func_get_args();
Please login to merge, or discard this patch.