@@ -4,7 +4,6 @@ |
||
4 | 4 | |
5 | 5 | use Graze\DataFile\Modify\Compress\CompressionType; |
6 | 6 | use League\Flysystem\Adapter\Local; |
7 | -use League\Flysystem\Filesystem; |
|
8 | 7 | |
9 | 8 | class LocalFile extends FileNode implements LocalFileNodeInterface |
10 | 9 | { |
@@ -2,7 +2,6 @@ |
||
2 | 2 | |
3 | 3 | namespace Graze\DataFile\Test\Unit\Format; |
4 | 4 | |
5 | -use Graze\DataFile\Format\FormatAwareInterface; |
|
6 | 5 | use Graze\DataFile\Test\Format\FakeFormatAware; |
7 | 6 | use Graze\DataFile\Test\TestCase; |
8 | 7 | use Mockery as m; |
@@ -9,7 +9,6 @@ |
||
9 | 9 | use Graze\DataFile\Node\FileNode; |
10 | 10 | use Graze\DataFile\Node\FileNodeCollection; |
11 | 11 | use Graze\DataFile\Test\TestCase; |
12 | -use Hamcrest\Core\AllOf; |
|
13 | 12 | use Mockery as m; |
14 | 13 | |
15 | 14 | class MetadataFinderTest extends TestCase |
@@ -24,9 +24,9 @@ discard block |
||
24 | 24 | { |
25 | 25 | $file = m::mock(FileNode::class); |
26 | 26 | $file->shouldReceive('getMetadata') |
27 | - ->andReturn([ |
|
28 | - 'name' => 'test', |
|
29 | - ]); |
|
27 | + ->andReturn([ |
|
28 | + 'name' => 'test', |
|
29 | + ]); |
|
30 | 30 | $collection = new FileNodeCollection(); |
31 | 31 | $collection->add($file); |
32 | 32 | |
@@ -41,14 +41,14 @@ discard block |
||
41 | 41 | { |
42 | 42 | $file = m::mock(FileNode::class); |
43 | 43 | $file->shouldReceive('getMetadata') |
44 | - ->andReturn([ |
|
45 | - 'name' => 'test', |
|
46 | - ]); |
|
44 | + ->andReturn([ |
|
45 | + 'name' => 'test', |
|
46 | + ]); |
|
47 | 47 | $file2 = m::mock(FileNode::class); |
48 | 48 | $file2->shouldReceive('getMetadata') |
49 | - ->andReturn([ |
|
50 | - 'name' => 'test2', |
|
51 | - ]); |
|
49 | + ->andReturn([ |
|
50 | + 'name' => 'test2', |
|
51 | + ]); |
|
52 | 52 | $collection = new FileNodeCollection(); |
53 | 53 | $collection->add($file); |
54 | 54 | $collection->add($file2); |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | { |
68 | 68 | $file = m::mock(FileNode::class); |
69 | 69 | $file->shouldReceive('getMetadata') |
70 | - ->andReturn(false); |
|
70 | + ->andReturn(false); |
|
71 | 71 | $collection = new FileNodeCollection(); |
72 | 72 | $collection->add($file); |
73 | 73 |
@@ -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())); |
@@ -40,8 +40,8 @@ discard block |
||
40 | 40 | } |
41 | 41 | |
42 | 42 | $outputFile = $node->getClone() |
43 | - ->setPath($pathInfo['dirname'] . '/' . $pathInfo['filename'] . '.' . $this->getExtension()) |
|
44 | - ->setCompression($this->getCompression()); |
|
43 | + ->setPath($pathInfo['dirname'] . '/' . $pathInfo['filename'] . '.' . $this->getExtension()) |
|
44 | + ->setCompression($this->getCompression()); |
|
45 | 45 | |
46 | 46 | $this->log(LogLevel::INFO, "Compressing file: {file} into {target} using {compression}", [ |
47 | 47 | 'file' => $node, |
@@ -76,8 +76,8 @@ discard block |
||
76 | 76 | } |
77 | 77 | |
78 | 78 | $outputFile = $node->getClone() |
79 | - ->setPath($pathInfo['dirname'] . '/' . $pathInfo['filename']) |
|
80 | - ->setCompression(CompressionType::NONE); |
|
79 | + ->setPath($pathInfo['dirname'] . '/' . $pathInfo['filename']) |
|
80 | + ->setCompression(CompressionType::NONE); |
|
81 | 81 | |
82 | 82 | $this->log(LogLevel::INFO, "DeCompressing file: {file} into {target} using {compression}", [ |
83 | 83 | 'file' => $node, |
@@ -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 | } |