Passed
Push — master ( 7807e3...e79efc )
by Kirill
02:44 queued 52s
created
src/Filter/Filter.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
     {
45 45
         $this->stream = Stream::new(32);
46 46
 
47
-        $this->stream->onRead(function (string $sources) {
47
+        $this->stream->onRead(function(string $sources) {
48 48
             foreach ($this->then as $handler) {
49 49
                 $sources = $handler($sources);
50 50
             }
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
             return $sources;
53 53
         });
54 54
 
55
-        $this->where(function (string $class, string $pathname) use ($vendorDirectory): bool {
55
+        $this->where(function(string $class, string $pathname) use ($vendorDirectory): bool {
56 56
             if ($this->vendor) {
57 57
                 return true;
58 58
             }
@@ -109,10 +109,10 @@  discard block
 block discarded – undo
109 109
      */
110 110
     public function through(CacheInterface $cache, callable $then): self
111 111
     {
112
-        return $this->then(function (string $sources) use ($cache, $then) {
112
+        return $this->then(function(string $sources) use ($cache, $then) {
113 113
             $key = \md5($sources);
114 114
 
115
-            if (! $cache->has($key)) {
115
+            if (!$cache->has($key)) {
116 116
                 $cache->set($key, $then($sources));
117 117
             }
118 118
 
Please login to merge, or discard this patch.
src/Filter/Conjunction.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@
 block discarded – undo
22 22
     public function match(string $class, string $path): bool
23 23
     {
24 24
         foreach ($this->filters as $filter) {
25
-            if (! $filter($class, $path)) {
25
+            if (!$filter($class, $path)) {
26 26
                 return false;
27 27
             }
28 28
         }
Please login to merge, or discard this patch.
src/Stream.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
      * @var string
29 29
      */
30 30
     private const STREAM_DUPLICATION_EXCEPTION =
31
-        'Could not create stream "%s", because stream ' .
31
+        'Could not create stream "%s", because stream '.
32 32
         'with same name already has been registered.';
33 33
 
34 34
     /**
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
     {
80 80
         \assert($complexity > 0, 'Name complexity should be greater than 0');
81 81
 
82
-        $name = 'stream' . \bin2hex(\random_bytes(\random_int(1, $complexity)));
82
+        $name = 'stream'.\bin2hex(\random_bytes(\random_int(1, $complexity)));
83 83
 
84 84
         return static::create($name, $wrapper);
85 85
     }
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
      */
148 148
     public static function get(string $protocol): StreamInterface
149 149
     {
150
-        if (! isset(static::$streams[$protocol])) {
150
+        if (!isset(static::$streams[$protocol])) {
151 151
             $error = \sprintf('Protocol "%s://" should be registered', $protocol);
152 152
             throw new StreamCreatingException($error);
153 153
         }
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
      */
248 248
     private function assertIsFile(string $pathname): void
249 249
     {
250
-        if (! \is_file($pathname)) {
250
+        if (!\is_file($pathname)) {
251 251
             $error = \sprintf('File %s not found', $pathname);
252 252
             throw new NotFoundException($error);
253 253
         }
@@ -260,7 +260,7 @@  discard block
 block discarded – undo
260 260
      */
261 261
     private function assertIsReadable(string $pathname): void
262 262
     {
263
-        if (! \is_readable($pathname)) {
263
+        if (!\is_readable($pathname)) {
264 264
             $error = \sprintf('File %s not readable', $pathname);
265 265
             throw new NotReadableException($error);
266 266
         }
Please login to merge, or discard this patch.
src/helpers.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@
 block discarded – undo
10 10
 use Serafim\Stream\Stream;
11 11
 use Serafim\Stream\StreamInterface;
12 12
 
13
-if (! \function_exists('\\restream')) {
13
+if (!\function_exists('\\restream')) {
14 14
     /**
15 15
      * @param string $protocol
16 16
      * @param Closure $then
Please login to merge, or discard this patch.
src/Wrapper/ReadStreamWrapper.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -52,10 +52,10 @@  discard block
 block discarded – undo
52 52
 
53 53
         $this->stream = Stream::get($this->protocol);
54 54
 
55
-        if (\STREAM_USE_PATH & $options && ! \is_file($this->pathname)) {
55
+        if (\STREAM_USE_PATH & $options && !\is_file($this->pathname)) {
56 56
             $trace = \debug_backtrace(\DEBUG_BACKTRACE_IGNORE_ARGS);
57 57
 
58
-            $this->pathname = \dirname($trace[1]['file']) . '/' . $this->pathname;
58
+            $this->pathname = \dirname($trace[1]['file']).'/'.$this->pathname;
59 59
         }
60 60
 
61 61
         $this->resource = \fopen('php://memory', 'rb+');
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
      */
89 89
     public function stream_read(int $length): string
90 90
     {
91
-        return ! \feof($this->resource) ? \fread($this->resource, $length) : '';
91
+        return !\feof($this->resource) ? \fread($this->resource, $length) : '';
92 92
     }
93 93
 
94 94
     /**
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
      */
128 128
     public function stream_tell(): int
129 129
     {
130
-        return (int)\ftell($this->resource);
130
+        return (int) \ftell($this->resource);
131 131
     }
132 132
 
133 133
     /**
Please login to merge, or discard this patch.
src/ClassLoader.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -101,7 +101,7 @@
 block discarded – undo
101 101
             return false;
102 102
         }
103 103
 
104
-        if (! \is_string($file = $this->composer->findFile($class))) {
104
+        if (!\is_string($file = $this->composer->findFile($class))) {
105 105
             return false;
106 106
         }
107 107
 
Please login to merge, or discard this patch.
src/Filter/BaseFilter.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -35,8 +35,8 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
     }
Please login to merge, or discard this patch.