| @@ -32,7 +32,7 @@ discard block | ||
| 32 | 32 |      { | 
| 33 | 33 |          $adapterName = $input->getArgument('adapter'); | 
| 34 | 34 |          if (!in_array($adapterName, $this->availableAdapters)) { | 
| 35 | -            $output->writeln('Invalid adapter name supplied! Adapters available: ' . implode(', ', $this->availableAdapters)); | |
| 35 | +            $output->writeln('Invalid adapter name supplied! Adapters available: '.implode(', ', $this->availableAdapters)); | |
| 36 | 36 | |
| 37 | 37 | return; | 
| 38 | 38 | } | 
| @@ -43,9 +43,9 @@ discard block | ||
| 43 | 43 |          $filename = $input->getArgument('filename'); | 
| 44 | 44 | |
| 45 | 45 |          if ($fileSystem->exists($filename)) { | 
| 46 | -            $output->writeln('File was found using adapter (' . $adapterName . ')'); | |
| 46 | +            $output->writeln('File was found using adapter ('.$adapterName.')'); | |
| 47 | 47 |          } else { | 
| 48 | -            $output->writeln('File not found using adapter (' . $adapterName . ')'); | |
| 48 | +            $output->writeln('File not found using adapter ('.$adapterName.')'); | |
| 49 | 49 | } | 
| 50 | 50 | } | 
| 51 | 51 | } | 
| @@ -38,7 +38,7 @@ | ||
| 38 | 38 |          $withoutExtensionAndWithoutQueryString = implode('.', $pathParts); | 
| 39 | 39 | |
| 40 | 40 |          if (count($extensionAndQueryStringParts) === 2) { | 
| 41 | - return $withoutExtensionAndWithoutQueryString . '?' . $extensionAndQueryStringParts[1]; | |
| 41 | + return $withoutExtensionAndWithoutQueryString.'?'.$extensionAndQueryStringParts[1]; | |
| 42 | 42 |          } else { | 
| 43 | 43 | return $withoutExtensionAndWithoutQueryString; | 
| 44 | 44 | } | 
| @@ -15,7 +15,7 @@ discard block | ||
| 15 | 15 | |
| 16 | 16 | public function testGetFilesInDirectoryIsRecursiveAndAlphabetical() | 
| 17 | 17 |      { | 
| 18 | - $files = ServerFileSystem::getFilesInDirectory(__DIR__ . '/../'); | |
| 18 | + $files = ServerFileSystem::getFilesInDirectory(__DIR__.'/../'); | |
| 19 | 19 | |
| 20 | 20 | $this->assertCount(6, $files); | 
| 21 | 21 |          $this->assertStringEndsWith('Unit/Adapter/LocalStorageTest.php', $files[0]); | 
| @@ -24,16 +24,16 @@ discard block | ||
| 24 | 24 | |
| 25 | 25 | public function testDeleteFilesInDirectoryRecursively() | 
| 26 | 26 |      { | 
| 27 | - $dir = __DIR__ . '/deleteFilesInDirectoryRecursively/'; | |
| 27 | + $dir = __DIR__.'/deleteFilesInDirectoryRecursively/'; | |
| 28 | 28 | |
| 29 | 29 |          if (!is_dir($dir)) { | 
| 30 | 30 | mkdir($dir); | 
| 31 | 31 | } | 
| 32 | - file_put_contents($dir . '1.txt', '1'); | |
| 33 | - file_put_contents($dir . '2.txt', '2'); | |
| 34 | - mkdir($dir . 'subdir'); | |
| 35 | - file_put_contents($dir . 'subdir/3.txt', '3'); | |
| 36 | - file_put_contents($dir . 'subdir/4.txt', '4'); | |
| 32 | + file_put_contents($dir.'1.txt', '1'); | |
| 33 | + file_put_contents($dir.'2.txt', '2'); | |
| 34 | + mkdir($dir.'subdir'); | |
| 35 | + file_put_contents($dir.'subdir/3.txt', '3'); | |
| 36 | + file_put_contents($dir.'subdir/4.txt', '4'); | |
| 37 | 37 | |
| 38 | 38 | $filesBefore = ServerFileSystem::getFilesInDirectory($dir); | 
| 39 | 39 | $this->assertCount(4, $filesBefore); | 
| @@ -69,6 +69,6 @@ | ||
| 69 | 69 |          $this->factory = new FileSystemFactory('amazon_s3', $this->config, '/tmp'); | 
| 70 | 70 | |
| 71 | 71 |          $s3Adaptor = $this->factory->build('amazon_s3'); | 
| 72 | -        $this->assertInstanceOf('Partnermarketing\FileSystemBundle\Adapter\AmazonS3',$s3Adaptor); | |
| 72 | +        $this->assertInstanceOf('Partnermarketing\FileSystemBundle\Adapter\AmazonS3', $s3Adaptor); | |
| 73 | 73 | } | 
| 74 | 74 | } | 
| @@ -169,8 +169,8 @@ discard block | ||
| 169 | 169 | /* | 
| 170 | 170 | * Add '/' character to the directories if necessary | 
| 171 | 171 | */ | 
| 172 | - $sourceDir = $sourceDir . (substr($sourceDir, -1) == '/' ? '' : '/'); | |
| 173 | - $targetDir = $targetDir . (substr($targetDir, -1) == '/' ? '' : '/'); | |
| 172 | + $sourceDir = $sourceDir.(substr($sourceDir, -1) == '/' ? '' : '/'); | |
| 173 | + $targetDir = $targetDir.(substr($targetDir, -1) == '/' ? '' : '/'); | |
| 174 | 174 | |
| 175 | 175 | $this->ensureBucketExists(); | 
| 176 | 176 | |
| @@ -179,7 +179,7 @@ discard block | ||
| 179 | 179 | $batch = array(); | 
| 180 | 180 |          for ($i = 0; $i < count($files); $i++) { | 
| 181 | 181 | $targetFile = str_replace($sourceDir, "", $files[$i]); | 
| 182 | -            $batch[] =  $this->service->getCommand('CopyObject', array( | |
| 182 | +            $batch[] = $this->service->getCommand('CopyObject', array( | |
| 183 | 183 | 'Bucket' => $targetBucket, | 
| 184 | 184 |                  'Key'        => "{$targetDir}{$targetFile}", | 
| 185 | 185 |                  'CopySource' => "{$sourceBucket}/{$files[$i]}", | 
| @@ -301,7 +301,7 @@ discard block | ||
| 301 | 301 |      { | 
| 302 | 302 | $content = $this->read($path); | 
| 303 | 303 | $extension = pathinfo($path, PATHINFO_EXTENSION); | 
| 304 | - $target = tempnam($this->localTmpDir, null) . '.' . $extension; | |
| 304 | + $target = tempnam($this->localTmpDir, null).'.'.$extension; | |
| 305 | 305 | |
| 306 | 306 | file_put_contents($target, $content); | 
| 307 | 307 | |
| @@ -30,7 +30,7 @@ discard block | ||
| 30 | 30 |      { | 
| 31 | 31 | $this->service = $service; | 
| 32 | 32 | |
| 33 | - $absolutePathNormalised = '/' . trim($parameters['path'], '/'); | |
| 33 | + $absolutePathNormalised = '/'.trim($parameters['path'], '/'); | |
| 34 | 34 |          if (is_dir($absolutePathNormalised) && realpath($absolutePathNormalised)) { | 
| 35 | 35 | $this->absolutePath = realpath($absolutePathNormalised); | 
| 36 | 36 |          } else { | 
| @@ -53,7 +53,7 @@ discard block | ||
| 53 | 53 | $fullPath = $path; | 
| 54 | 54 |          } else { | 
| 55 | 55 | $path = $this->pathOrUrlToPath($path); | 
| 56 | - $fullPath = $this->absolutePath . '/' . $path; | |
| 56 | + $fullPath = $this->absolutePath.'/'.$path; | |
| 57 | 57 | } | 
| 58 | 58 | |
| 59 | 59 | return (string) file_get_contents($fullPath); | 
| @@ -113,10 +113,10 @@ discard block | ||
| 113 | 113 |      { | 
| 114 | 114 | $directory = $this->pathOrUrlToPath($directory); | 
| 115 | 115 | |
| 116 | - $files = ServerFileSystem::getFilesInDirectory($this->absolutePath . '/' . $directory); | |
| 116 | + $files = ServerFileSystem::getFilesInDirectory($this->absolutePath.'/'.$directory); | |
| 117 | 117 | |
| 118 | -        return array_map(function ($file) { | |
| 119 | - return str_replace($this->absolutePath . '/', '', $file); | |
| 118 | +        return array_map(function($file) { | |
| 119 | + return str_replace($this->absolutePath.'/', '', $file); | |
| 120 | 120 | }, $files); | 
| 121 | 121 | } | 
| 122 | 122 | |
| @@ -203,7 +203,7 @@ discard block | ||
| 203 | 203 | */ | 
| 204 | 204 | public function getFileSize($path) | 
| 205 | 205 |      { | 
| 206 | - $fullPath = $this->absolutePath . '/' . $this->pathOrUrlToPath($path); | |
| 206 | + $fullPath = $this->absolutePath.'/'.$this->pathOrUrlToPath($path); | |
| 207 | 207 | |
| 208 | 208 | return filesize($fullPath); | 
| 209 | 209 | } | 
| @@ -215,7 +215,7 @@ discard block | ||
| 215 | 215 |      { | 
| 216 | 216 | $content = $this->read($path); | 
| 217 | 217 | $extension = pathinfo($path, PATHINFO_EXTENSION); | 
| 218 | - $target = tempnam($this->localTmpDir, null) . '.' . $extension; | |
| 218 | + $target = tempnam($this->localTmpDir, null).'.'.$extension; | |
| 219 | 219 | |
| 220 | 220 | file_put_contents($target, $content); | 
| 221 | 221 | |
| @@ -59,7 +59,7 @@ discard block | ||
| 59 | 59 | 'region' => $this->config['amazon_s3']['region'], | 
| 60 | 60 | 'version' => '2006-03-01' | 
| 61 | 61 | )); | 
| 62 | - $fileSystem = new AmazonS3($service , $this->config['amazon_s3']['bucket'], 'public-read', $this->tmpDir); | |
| 62 | + $fileSystem = new AmazonS3($service, $this->config['amazon_s3']['bucket'], 'public-read', $this->tmpDir); | |
| 63 | 63 | |
| 64 | 64 | $acl = 'public-read'; | 
| 65 | 65 | $allowedValues = [ | 
| @@ -71,14 +71,14 @@ discard block | ||
| 71 | 71 | 'bucket-owner-full-control' | 
| 72 | 72 | ]; | 
| 73 | 73 |          if (!empty($this->config['amazon_s3']['acl'])) { | 
| 74 | -            if(!in_array($this->config['amazon_s3']['acl'], $allowedValues)){ | |
| 74 | +            if (!in_array($this->config['amazon_s3']['acl'], $allowedValues)) { | |
| 75 | 75 |                  throw new \Exception('Invalid S3 acl value.'); | 
| 76 | 76 | } | 
| 77 | 77 | $acl = $this->config['amazon_s3']['acl']; | 
| 78 | 78 | } | 
| 79 | 79 | $bucket = $this->config['amazon_s3']['bucket']; | 
| 80 | 80 | |
| 81 | - $fileSystem = new AmazonS3($service , $bucket, $acl, $this->tmpDir); | |
| 81 | + $fileSystem = new AmazonS3($service, $bucket, $acl, $this->tmpDir); | |
| 82 | 82 | |
| 83 | 83 | |
| 84 | 84 | return $fileSystem; |