@@ -29,7 +29,7 @@ |
||
29 | 29 | */ |
30 | 30 | public function findFiles(FileNodeCollectionInterface $files) |
31 | 31 | { |
32 | - return $files->filter(function (FileNode $file) { |
|
32 | + return $files->filter(function(FileNode $file) { |
|
33 | 33 | $metadata = $file->getMetadata(); |
34 | 34 | if ($metadata) { |
35 | 35 | return ($this->filter->matches($file->getMetadata())); |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | |
68 | 68 | $this->log(LogLevel::INFO, "Merging files in collection $files into: {$target}"); |
69 | 69 | |
70 | - $filePaths = $files->map(function (LocalFile $item) { |
|
70 | + $filePaths = $files->map(function(LocalFile $item) { |
|
71 | 71 | return $item->getPath(); |
72 | 72 | }); |
73 | 73 | |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | |
106 | 106 | if (!$keepOld) { |
107 | 107 | $this->log(LogLevel::DEBUG, "Deleting old files in collection $files"); |
108 | - $files->map(function (LocalFile $item) { |
|
108 | + $files->map(function(LocalFile $item) { |
|
109 | 109 | if ($item->exists()) { |
110 | 110 | $item->delete(); |
111 | 111 | } |
@@ -51,8 +51,8 @@ |
||
51 | 51 | ); |
52 | 52 | |
53 | 53 | $output = $file->getClone() |
54 | - ->setPath($pathInfo['dirname'] . '/' . $outputFileName) |
|
55 | - ->setEncoding($encoding); |
|
54 | + ->setPath($pathInfo['dirname'] . '/' . $outputFileName) |
|
55 | + ->setEncoding($encoding); |
|
56 | 56 | |
57 | 57 | $cmd = "iconv " . |
58 | 58 | ($file->getEncoding() ? "--from-code={$file->getEncoding()} " : '') . |
@@ -88,7 +88,7 @@ |
||
88 | 88 | $outputFilePath = $pathInfo['dirname'] . '/' . $outputFileName; |
89 | 89 | |
90 | 90 | $output = $file->getClone() |
91 | - ->setPath($outputFilePath); |
|
91 | + ->setPath($outputFilePath); |
|
92 | 92 | |
93 | 93 | $this->log(LogLevel::INFO, "Retrieving the last {lines} from file {file}", [ |
94 | 94 | 'lines' => $this->lines, |
@@ -23,7 +23,7 @@ |
||
23 | 23 | return null; |
24 | 24 | } |
25 | 25 | |
26 | - $commonPath = $this->reduce(function ($commonPath, FileNodeInterface $file) { |
|
26 | + $commonPath = $this->reduce(function($commonPath, FileNodeInterface $file) { |
|
27 | 27 | if (is_null($commonPath)) { |
28 | 28 | return $file->getPath(); |
29 | 29 | } |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | $process->shouldReceive('isSuccessful')->andReturn(false); |
120 | 120 | |
121 | 121 | $this->processFactory->shouldReceive('createProcess') |
122 | - ->andReturn($process); |
|
122 | + ->andReturn($process); |
|
123 | 123 | |
124 | 124 | $file = new LocalFile(static::$dir . 'failed_find_encoding_process.test'); |
125 | 125 | $file->put('random stuff and things 2!'); |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | $process->shouldReceive('isSuccessful')->andReturn(false); |
136 | 136 | |
137 | 137 | $this->processFactory->shouldReceive('createProcess') |
138 | - ->andReturn($process); |
|
138 | + ->andReturn($process); |
|
139 | 139 | |
140 | 140 | $file = new LocalFile(static::$dir . 'failed_find_encoding_process.test'); |
141 | 141 | $file->put('random stuff and things 2!'); |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | $process->shouldReceive('getOutput')->andReturn('text/plain; charset=utf-8 compressed-encoding=application/lzop; charset=binary; charset=binary'); |
154 | 154 | |
155 | 155 | $this->processFactory->shouldReceive('createProcess') |
156 | - ->andReturn($process); |
|
156 | + ->andReturn($process); |
|
157 | 157 | |
158 | 158 | $file = new LocalFile(static::$dir . 'unknown_compression.test'); |
159 | 159 | $file->put('random stuff and things 2!'); |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | $process->shouldReceive('getOutput')->andReturn('some random stuff with no charset'); |
170 | 170 | |
171 | 171 | $this->processFactory->shouldReceive('createProcess') |
172 | - ->andReturn($process); |
|
172 | + ->andReturn($process); |
|
173 | 173 | |
174 | 174 | $file = new LocalFile(static::$dir . 'unknown_compression.test'); |
175 | 175 | $file->put('random stuff and things 2!'); |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | $process = m::mock(Process::class)->makePartial(); |
95 | 95 | $processFactory = m::mock(ProcessFactory::class); |
96 | 96 | $processFactory->shouldReceive('createProcess') |
97 | - ->andReturn($process); |
|
97 | + ->andReturn($process); |
|
98 | 98 | $this->gzip->setProcessFactory($processFactory); |
99 | 99 | $process->shouldReceive('run')->once(); |
100 | 100 | $process->shouldReceive('isSuccessful')->once()->andReturn(false); |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | $process = m::mock(Process::class)->makePartial(); |
119 | 119 | $processFactory = m::mock(ProcessFactory::class); |
120 | 120 | $processFactory->shouldReceive('createProcess') |
121 | - ->andReturn($process); |
|
121 | + ->andReturn($process); |
|
122 | 122 | $this->gzip->setProcessFactory($processFactory); |
123 | 123 | $process->shouldReceive('run')->once(); |
124 | 124 | $process->shouldReceive('isSuccessful')->once()->andReturn(false); |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | { |
104 | 104 | $process = m::mock(Process::class)->makePartial(); |
105 | 105 | $this->processFactory->shouldReceive('createProcess') |
106 | - ->andReturn($process); |
|
106 | + ->andReturn($process); |
|
107 | 107 | $process->shouldReceive('run')->once(); |
108 | 108 | $process->shouldReceive('isSuccessful')->once()->andReturn(false); |
109 | 109 | $process->shouldReceive('getCommandLine')->andReturn(''); |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | { |
126 | 126 | $process = m::mock(Process::class)->makePartial(); |
127 | 127 | $this->processFactory->shouldReceive('createProcess') |
128 | - ->andReturn($process); |
|
128 | + ->andReturn($process); |
|
129 | 129 | $process->shouldReceive('run')->once(); |
130 | 130 | $process->shouldReceive('isSuccessful')->once()->andReturn(false); |
131 | 131 | $process->shouldReceive('getCommandLine')->andReturn(''); |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | $file->getContents() |
194 | 194 | ); |
195 | 195 | |
196 | - $exists = $collection->filter(function (FileNodeInterface $item) { |
|
196 | + $exists = $collection->filter(function(FileNodeInterface $item) { |
|
197 | 197 | return $item->exists(); |
198 | 198 | }); |
199 | 199 | |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | $file->getContents() |
244 | 244 | ); |
245 | 245 | |
246 | - $exists = $collection->filter(function (FileNodeInterface $item) { |
|
246 | + $exists = $collection->filter(function(FileNodeInterface $item) { |
|
247 | 247 | return $item->exists(); |
248 | 248 | }); |
249 | 249 | |
@@ -296,7 +296,7 @@ discard block |
||
296 | 296 | $file->getContents() |
297 | 297 | ); |
298 | 298 | |
299 | - $exists = $collection->filter(function (FileNodeInterface $item) { |
|
299 | + $exists = $collection->filter(function(FileNodeInterface $item) { |
|
300 | 300 | return $item->exists(); |
301 | 301 | }); |
302 | 302 | |
@@ -329,7 +329,7 @@ discard block |
||
329 | 329 | |
330 | 330 | static::assertFalse(file_exists($collection->getAll()[0]->getDirectory())); |
331 | 331 | |
332 | - $exists = $collection->filter(function (FileNodeInterface $item) { |
|
332 | + $exists = $collection->filter(function(FileNodeInterface $item) { |
|
333 | 333 | return $item->exists(); |
334 | 334 | }); |
335 | 335 |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | { |
47 | 47 | $collection = m::mock(FileNodeCollectionInterface::class); |
48 | 48 | $collection->shouldReceive('getIterator') |
49 | - ->andReturn([]); |
|
49 | + ->andReturn([]); |
|
50 | 50 | |
51 | 51 | $node = m::mock(LocalFile::class); |
52 | 52 | static::assertTrue($this->merge->canContract($collection, $node)); |
@@ -57,9 +57,9 @@ discard block |
||
57 | 57 | $collection = new FileNodeCollection(); |
58 | 58 | $file1 = m::mock(LocalFile::class); |
59 | 59 | $file1->shouldReceive('exists') |
60 | - ->andReturn(true); |
|
60 | + ->andReturn(true); |
|
61 | 61 | $file1->shouldReceive('getCompression') |
62 | - ->andReturn(CompressionFactory::TYPE_NONE); |
|
62 | + ->andReturn(CompressionFactory::TYPE_NONE); |
|
63 | 63 | $collection->add($file1); |
64 | 64 | |
65 | 65 | $out = m::mock(LocalFile::class); |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | |
69 | 69 | $file2 = m::mock(FileNodeInterface::class); |
70 | 70 | $file2->shouldReceive('getCompression') |
71 | - ->andReturn(CompressionFactory::TYPE_NONE); |
|
71 | + ->andReturn(CompressionFactory::TYPE_NONE); |
|
72 | 72 | $collection->add($file2); |
73 | 73 | |
74 | 74 | static::assertFalse($this->merge->canContract($collection, $out)); |
@@ -79,9 +79,9 @@ discard block |
||
79 | 79 | $collection = new FileNodeCollection(); |
80 | 80 | $file1 = m::mock(LocalFile::class); |
81 | 81 | $file1->shouldReceive('exists') |
82 | - ->andReturn(true); |
|
82 | + ->andReturn(true); |
|
83 | 83 | $file1->shouldReceive('getCompression') |
84 | - ->andReturn(CompressionFactory::TYPE_NONE); |
|
84 | + ->andReturn(CompressionFactory::TYPE_NONE); |
|
85 | 85 | $collection->add($file1); |
86 | 86 | |
87 | 87 | $out = m::mock(LocalFile::class); |
@@ -90,9 +90,9 @@ discard block |
||
90 | 90 | |
91 | 91 | $file2 = m::mock(LocalFile::class); |
92 | 92 | $file2->shouldReceive('exists') |
93 | - ->andReturn(false); |
|
93 | + ->andReturn(false); |
|
94 | 94 | $file2->shouldReceive('getCompression') |
95 | - ->andReturn(CompressionFactory::TYPE_NONE); |
|
95 | + ->andReturn(CompressionFactory::TYPE_NONE); |
|
96 | 96 | $collection->add($file2); |
97 | 97 | |
98 | 98 | static::assertFalse($this->merge->canContract($collection, $out)); |
@@ -103,9 +103,9 @@ discard block |
||
103 | 103 | $collection = new FileNodeCollection(); |
104 | 104 | $file1 = m::mock(LocalFile::class); |
105 | 105 | $file1->shouldReceive('exists') |
106 | - ->andReturn(true); |
|
106 | + ->andReturn(true); |
|
107 | 107 | $file1->shouldReceive('getCompression') |
108 | - ->andReturn(CompressionFactory::TYPE_NONE); |
|
108 | + ->andReturn(CompressionFactory::TYPE_NONE); |
|
109 | 109 | $collection->add($file1); |
110 | 110 | |
111 | 111 | $out = m::mock(LocalFile::class); |
@@ -114,9 +114,9 @@ discard block |
||
114 | 114 | |
115 | 115 | $file2 = m::mock(LocalFile::class); |
116 | 116 | $file2->shouldReceive('exists') |
117 | - ->andReturn(true); |
|
117 | + ->andReturn(true); |
|
118 | 118 | $file2->shouldReceive('getCompression') |
119 | - ->andReturn(Gzip::NAME); |
|
119 | + ->andReturn(Gzip::NAME); |
|
120 | 120 | $collection->add($file2); |
121 | 121 | |
122 | 122 | static::assertFalse($this->merge->canContract($collection, $out)); |
@@ -127,9 +127,9 @@ discard block |
||
127 | 127 | $collection = new FileNodeCollection(); |
128 | 128 | $file = m::mock(LocalFile::class); |
129 | 129 | $file->shouldReceive('exists') |
130 | - ->andReturn(false); |
|
130 | + ->andReturn(false); |
|
131 | 131 | $file->shouldReceive('getCompression') |
132 | - ->andReturn(CompressionFactory::TYPE_NONE); |
|
132 | + ->andReturn(CompressionFactory::TYPE_NONE); |
|
133 | 133 | $collection->add($file); |
134 | 134 | |
135 | 135 | $target = m::mock(LocalFile::class); |
@@ -144,9 +144,9 @@ discard block |
||
144 | 144 | $collection = new FileNodeCollection(); |
145 | 145 | $file = m::mock(LocalFile::class); |
146 | 146 | $file->shouldReceive('exists') |
147 | - ->andReturn(true); |
|
147 | + ->andReturn(true); |
|
148 | 148 | $file->shouldReceive('getCompression') |
149 | - ->andReturn(CompressionFactory::TYPE_NONE); |
|
149 | + ->andReturn(CompressionFactory::TYPE_NONE); |
|
150 | 150 | $collection->add($file); |
151 | 151 | |
152 | 152 | $target = m::mock(FileNodeInterface::class); |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | { |
244 | 244 | $process = m::mock('Symfony\Component\Process\Process')->makePartial(); |
245 | 245 | $this->processFactory->shouldReceive('createProcess') |
246 | - ->andReturn($process); |
|
246 | + ->andReturn($process); |
|
247 | 247 | |
248 | 248 | $process->shouldReceive('isSuccessful')->andReturn(false); |
249 | 249 |