@@ -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(''); |
@@ -4,7 +4,6 @@ |
||
4 | 4 | |
5 | 5 | use Graze\DataFile\Helper\Process\ProcessFactory; |
6 | 6 | use Graze\DataFile\Modify\Compress\CompressionFactory; |
7 | -use Graze\DataFile\Modify\Compress\Compressor; |
|
8 | 7 | use Graze\DataFile\Modify\Compress\CompressorInterface; |
9 | 8 | use Graze\DataFile\Modify\Compress\DeCompressorInterface; |
10 | 9 | use Graze\DataFile\Modify\Compress\Zip; |
@@ -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 |
@@ -4,7 +4,6 @@ |
||
4 | 4 | |
5 | 5 | use Graze\DataFile\Helper\Process\ProcessFactory; |
6 | 6 | use Graze\DataFile\Modify\Compress\CompressionFactory; |
7 | -use Graze\DataFile\Modify\Compress\CompressionType; |
|
8 | 7 | use Graze\DataFile\Modify\Compress\Gzip; |
9 | 8 | use Graze\DataFile\Modify\Contract\FileContractorInterface; |
10 | 9 | use Graze\DataFile\Modify\Contract\MergeFiles; |
@@ -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 |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | { |
209 | 209 | $file = m::mock(FileNodeInterface::class); |
210 | 210 | $file->shouldReceive('__toString') |
211 | - ->andReturn('some/file/here'); |
|
211 | + ->andReturn('some/file/here'); |
|
212 | 212 | |
213 | 213 | $this->expectException(InvalidArgumentException::class); |
214 | 214 | |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | $process = m::mock(Process::class)->makePartial(); |
221 | 221 | $process->shouldReceive('isSuccessful')->andReturn(false); |
222 | 222 | $this->processFactory->shouldReceive('createProcess') |
223 | - ->andReturn($process); |
|
223 | + ->andReturn($process); |
|
224 | 224 | |
225 | 225 | $file = new LocalFile(static::$dir . 'failed_tail.test'); |
226 | 226 | $file->put('nothing interesting here'); |
@@ -31,8 +31,8 @@ |
||
31 | 31 | $this->logger->setLogger($logger); |
32 | 32 | |
33 | 33 | $logger->shouldReceive('log') |
34 | - ->with(LogLevel::INFO, 'Graze\DataFile\Test\Helper\FakeOptionalLogger: some text', []) |
|
35 | - ->once(); |
|
34 | + ->with(LogLevel::INFO, 'Graze\DataFile\Test\Helper\FakeOptionalLogger: some text', []) |
|
35 | + ->once(); |
|
36 | 36 | |
37 | 37 | $this->logger->doLog('some text'); |
38 | 38 | } |
@@ -5,8 +5,8 @@ |
||
5 | 5 | use Graze\DataFile\Test\Helper\FakeOptionalLogger; |
6 | 6 | use Graze\DataFile\Test\TestCase; |
7 | 7 | use Mockery as m; |
8 | -use Psr\Log\LoggerInterface; |
|
9 | 8 | use Psr\Log\LogLevel; |
9 | +use Psr\Log\LoggerInterface; |
|
10 | 10 | |
11 | 11 | class OptionalLoggerTraitTest extends TestCase |
12 | 12 | { |
@@ -17,8 +17,8 @@ |
||
17 | 17 | $directory = new FileNode($fileSystem, 'random/path'); |
18 | 18 | |
19 | 19 | $fileSystem->shouldReceive('createDir') |
20 | - ->with($directory->getDirectory(), ['visibility' => 'public']) |
|
21 | - ->andReturn(false); |
|
20 | + ->with($directory->getDirectory(), ['visibility' => 'public']) |
|
21 | + ->andReturn(false); |
|
22 | 22 | $this->expectException(MakedirectoryFailedException::class); |
23 | 23 | |
24 | 24 | $maker = new MakeDirectory(); |
@@ -2,7 +2,6 @@ |
||
2 | 2 | |
3 | 3 | namespace Graze\DataFile\Test\Unit\Modify; |
4 | 4 | |
5 | -use Graze\DataFile\Modify\Exception\MakeDirectoryFailedException; |
|
6 | 5 | use Graze\DataFile\Modify\MakeDirectory; |
7 | 6 | use Graze\DataFile\Node\FileNode; |
8 | 7 | use Graze\DataFile\Test\TestCase; |
@@ -17,8 +17,8 @@ |
||
17 | 17 | $file = new FileNode($fileSystem, 'not/exists'); |
18 | 18 | |
19 | 19 | $fileSystem->shouldReceive('has') |
20 | - ->with('not/exists') |
|
21 | - ->andReturn(false); |
|
20 | + ->with('not/exists') |
|
21 | + ->andReturn(false); |
|
22 | 22 | |
23 | 23 | static::assertEquals([], $file->getContents()); |
24 | 24 | } |
@@ -3,7 +3,6 @@ |
||
3 | 3 | namespace Graze\DataFile\Test\Integration\Node; |
4 | 4 | |
5 | 5 | use Graze\DataFile\Modify\Exception\CopyFailedException; |
6 | -use Graze\DataFile\Modify\MakeDirectory; |
|
7 | 6 | use Graze\DataFile\Node\FileNode; |
8 | 7 | use Graze\DataFile\Test\TestCase; |
9 | 8 | use League\Flysystem\FilesystemInterface; |
@@ -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, |
@@ -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, |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | { |
209 | 209 | $file = m::mock(FileNodeInterface::class); |
210 | 210 | $file->shouldReceive('__toString') |
211 | - ->andReturn('some/file/here'); |
|
211 | + ->andReturn('some/file/here'); |
|
212 | 212 | |
213 | 213 | $this->expectException(InvalidArgumentException::class); |
214 | 214 | |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | $process = m::mock(Process::class)->makePartial(); |
221 | 221 | $process->shouldReceive('isSuccessful')->andReturn(false); |
222 | 222 | $this->processFactory->shouldReceive('createProcess') |
223 | - ->andReturn($process); |
|
223 | + ->andReturn($process); |
|
224 | 224 | |
225 | 225 | $file = new LocalFile(static::$dir . 'failed_tail.test'); |
226 | 226 | $file->put('nothing interesting here'); |