Passed
Push — master ( 7096b5...38b3e5 )
by Maxim
02:27
created
src/WS/Utils/Collections/Functions/Predicates.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -12,21 +12,21 @@  discard block
 block discarded – undo
12 12
 
13 13
     public static function lock(): Closure
14 14
     {
15
-        return static function (): bool {
15
+        return static function(): bool {
16 16
             return false;
17 17
         };
18 18
     }
19 19
 
20 20
     public static function notNull(): Closure
21 21
     {
22
-        return static function ($el): bool {
22
+        return static function($el): bool {
23 23
             return $el !== null;
24 24
         };
25 25
     }
26 26
 
27 27
     public static function notResistance(): Closure
28 28
     {
29
-        return static function (): bool {
29
+        return static function(): bool {
30 30
             return true;
31 31
         };
32 32
     }
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
     public static function eachEven(): Closure
35 35
     {
36 36
         $isEven = false;
37
-        return static function () use (& $isEven) {
37
+        return static function() use (& $isEven) {
38 38
             $res = $isEven;
39 39
             $isEven = !$isEven;
40 40
 
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
     public static function nth($number): Closure
46 46
     {
47 47
         $counter = 0;
48
-        return static function () use ($number, & $counter) {
48
+        return static function() use ($number, & $counter) {
49 49
             $res = ++$counter % $number === 0;
50 50
             if ($res) {
51 51
                 $counter = 0;
@@ -56,112 +56,112 @@  discard block
 block discarded – undo
56 56
 
57 57
     public static function equal($value): Closure
58 58
     {
59
-        return static function ($el) use ($value): bool {
59
+        return static function($el) use ($value): bool {
60 60
             return $el === $value;
61 61
         };
62 62
     }
63 63
 
64 64
     public static function lessThan($value): Closure
65 65
     {
66
-        return static function ($el) use ($value): bool {
66
+        return static function($el) use ($value): bool {
67 67
             return $el < $value;
68 68
         };
69 69
     }
70 70
 
71 71
     public static function lessOrEqual($value): Closure
72 72
     {
73
-        return static function ($el) use ($value): bool {
73
+        return static function($el) use ($value): bool {
74 74
             return $el <= $value;
75 75
         };
76 76
     }
77 77
 
78 78
     public static function moreThan($value): Closure
79 79
     {
80
-        return static function ($el) use ($value): bool {
80
+        return static function($el) use ($value): bool {
81 81
             return $el > $value;
82 82
         };
83 83
     }
84 84
 
85 85
     public static function moreOrEqual($value): Closure
86 86
     {
87
-        return static function ($el) use ($value): bool {
87
+        return static function($el) use ($value): bool {
88 88
             return $el >= $value;
89 89
         };
90 90
     }
91 91
 
92 92
     public static function not($value): Closure
93 93
     {
94
-        return static function ($el) use ($value): bool {
94
+        return static function($el) use ($value): bool {
95 95
             return $el !== $value;
96 96
         };
97 97
     }
98 98
 
99 99
     public static function in(array $values): Closure
100 100
     {
101
-        return static function ($el) use ($values): bool {
101
+        return static function($el) use ($values): bool {
102 102
             return in_array($el, $values, true);
103 103
         };
104 104
     }
105 105
 
106 106
     public static function notIn(array $values): Closure
107 107
     {
108
-        return static function ($el) use ($values): bool {
108
+        return static function($el) use ($values): bool {
109 109
             return !in_array($el, $values, true);
110 110
         };
111 111
     }
112 112
 
113 113
     public static function where(string $property, $value): Closure
114 114
     {
115
-        return static function ($ob) use ($property, $value) {
115
+        return static function($ob) use ($property, $value) {
116 116
             return $value === ObjectFunctions::getPropertyValue($ob, $property);
117 117
         };
118 118
     }
119 119
 
120 120
     public static function whereNot(string $property, $value): Closure
121 121
     {
122
-        return static function ($ob) use ($property, $value) {
122
+        return static function($ob) use ($property, $value) {
123 123
             return $value !== ObjectFunctions::getPropertyValue($ob, $property);
124 124
         };
125 125
     }
126 126
 
127 127
     public static function whereIn(string $property, array $values): Closure
128 128
     {
129
-        return static function ($ob) use ($property, $values) {
129
+        return static function($ob) use ($property, $values) {
130 130
             return in_array(ObjectFunctions::getPropertyValue($ob, $property), $values, true);
131 131
         };
132 132
     }
133 133
 
134 134
     public static function whereNotIn(string $property, array $values): Closure
135 135
     {
136
-        return static function ($ob) use ($property, $values) {
136
+        return static function($ob) use ($property, $values) {
137 137
             return !in_array(ObjectFunctions::getPropertyValue($ob, $property), $values, true);
138 138
         };
139 139
     }
140 140
 
141 141
     public static function whereMoreThan(string $property, $value): Closure
142 142
     {
143
-        return static function (object $ob) use ($property, $value) {
143
+        return static function(object $ob) use ($property, $value) {
144 144
             return ObjectFunctions::getPropertyValue($ob, $property) > $value;
145 145
         };
146 146
     }
147 147
 
148 148
     public static function whereLessThan(string $property, $value): Closure
149 149
     {
150
-        return static function (object $ob) use ($property, $value) {
150
+        return static function(object $ob) use ($property, $value) {
151 151
             return ObjectFunctions::getPropertyValue($ob, $property) < $value;
152 152
         };
153 153
     }
154 154
 
155 155
     public static function whereMoreOrEqual(string $property, $value): Closure
156 156
     {
157
-        return static function (object $ob) use ($property, $value) {
157
+        return static function(object $ob) use ($property, $value) {
158 158
             return ObjectFunctions::getPropertyValue($ob, $property) >= $value;
159 159
         };
160 160
     }
161 161
 
162 162
     public static function whereLessOrEqual(string $property, $value): Closure
163 163
     {
164
-        return static function (object $ob) use ($property, $value) {
164
+        return static function(object $ob) use ($property, $value) {
165 165
             return ObjectFunctions::getPropertyValue($ob, $property) <= $value;
166 166
         };
167 167
     }
Please login to merge, or discard this patch.