@@ -35,8 +35,8 @@ discard block |
||
35 | 35 | */ |
36 | 36 | public function not(callable $filter): self |
37 | 37 | { |
38 | - return $this->where(function (string $class, string $file) use ($filter): bool { |
|
39 | - return ! $filter($class, $file); |
|
38 | + return $this->where(function(string $class, string $file) use ($filter): bool { |
|
39 | + return !$filter($class, $file); |
|
40 | 40 | }); |
41 | 41 | } |
42 | 42 | |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | */ |
58 | 58 | public function every(\Closure $then): self |
59 | 59 | { |
60 | - return $this->where(function (string $class, string $file) use ($then): bool { |
|
60 | + return $this->where(function(string $class, string $file) use ($then): bool { |
|
61 | 61 | $then($conjunction = new Conjunction()); |
62 | 62 | |
63 | 63 | return $conjunction->match($class, $file); |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | */ |
71 | 71 | public function any(\Closure $then): self |
72 | 72 | { |
73 | - return $this->where(function (string $class, string $file) use ($then): bool { |
|
73 | + return $this->where(function(string $class, string $file) use ($then): bool { |
|
74 | 74 | $then($disjunction = new Disjunction()); |
75 | 75 | |
76 | 76 | return $disjunction->match($class, $file); |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | */ |
84 | 84 | public function fqn(string $fqn): self |
85 | 85 | { |
86 | - return $this->where(function (string $class) use ($fqn): bool { |
|
86 | + return $this->where(function(string $class) use ($fqn): bool { |
|
87 | 87 | return \trim($class, '\\') === \trim($fqn, '\\'); |
88 | 88 | }); |
89 | 89 | } |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | { |
97 | 97 | $name = \trim($name, '\\'); |
98 | 98 | |
99 | - return $this->where(function (string $fqn) use ($name): bool { |
|
99 | + return $this->where(function(string $fqn) use ($name): bool { |
|
100 | 100 | return \substr($fqn, -\strlen($name)) === $name; |
101 | 101 | }); |
102 | 102 | } |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | { |
110 | 110 | $prefix = \trim($prefix, '\\'); |
111 | 111 | |
112 | - return $this->where(function (string $class) use ($prefix): bool { |
|
112 | + return $this->where(function(string $class) use ($prefix): bool { |
|
113 | 113 | return \strpos(\trim($class, '\\'), $prefix) === 0; |
114 | 114 | }); |
115 | 115 | } |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | */ |
121 | 121 | public function fileName(string $name): self |
122 | 122 | { |
123 | - return $this->where(function (string $_, string $file) use ($name): bool { |
|
123 | + return $this->where(function(string $_, string $file) use ($name): bool { |
|
124 | 124 | $file = \str_replace('\\', '/', $file); |
125 | 125 | |
126 | 126 | return \pathinfo($file, \PATHINFO_FILENAME) === $name; |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | { |
136 | 136 | $regex = $this->regex($regex, false); |
137 | 137 | |
138 | - return $this->where(function (string $_, string $file) use ($regex): bool { |
|
138 | + return $this->where(function(string $_, string $file) use ($regex): bool { |
|
139 | 139 | return \preg_match($regex, $file) !== 0; |
140 | 140 | }); |
141 | 141 | } |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | { |
149 | 149 | $regex = $this->regex($regex); |
150 | 150 | |
151 | - return $this->where(function (string $_, string $file) use ($regex): bool { |
|
151 | + return $this->where(function(string $_, string $file) use ($regex): bool { |
|
152 | 152 | return \preg_match($regex, \pathinfo($file, \PATHINFO_FILENAME)) !== 0; |
153 | 153 | }); |
154 | 154 | } |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | { |
162 | 162 | $regex = $this->regex($regex, true); |
163 | 163 | |
164 | - return $this->where(function (string $fqn) use ($regex): bool { |
|
164 | + return $this->where(function(string $fqn) use ($regex): bool { |
|
165 | 165 | $class = \basename(\str_replace('\\', '/', $fqn)); |
166 | 166 | |
167 | 167 | return \preg_match($regex, $class) !== 0; |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | { |
177 | 177 | $regex = $this->regex($regex); |
178 | 178 | |
179 | - return $this->where(function (string $fqn) use ($regex): bool { |
|
179 | + return $this->where(function(string $fqn) use ($regex): bool { |
|
180 | 180 | return \preg_match($regex, $fqn) !== 0; |
181 | 181 | }); |
182 | 182 | } |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | */ |
189 | 189 | private function regex(string $regex, bool $strict = false): string |
190 | 190 | { |
191 | - $regex = $strict ? '^' . $regex . '$' : $regex; |
|
191 | + $regex = $strict ? '^'.$regex.'$' : $regex; |
|
192 | 192 | |
193 | 193 | return \sprintf('#%s#isuS', \str_replace('#', '\\#', $regex)); |
194 | 194 | } |