@@ -6,8 +6,8 @@ |
||
| 6 | 6 | |
| 7 | 7 | class YamlTools |
| 8 | 8 | { |
| 9 | - public const TMP_YAML_FILE = __DIR__ . '/tmp.yml'; |
|
| 10 | - public const TMP_MERGED_FILE = __DIR__ . '/tmp-merge.yml'; |
|
| 9 | + public const TMP_YAML_FILE = __DIR__.'/tmp.yml'; |
|
| 10 | + public const TMP_MERGED_FILE = __DIR__.'/tmp-merge.yml'; |
|
| 11 | 11 | |
| 12 | 12 | /** |
| 13 | 13 | * Merge the content of $inputFile2 with $inputFile1's one, then write it into $outputFile (or stdout if empty) |
@@ -41,21 +41,21 @@ discard block |
||
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | $finder = new Finder(); |
| 44 | - $dockerComposeFileFilter = function (\SplFileInfo $file) { |
|
| 44 | + $dockerComposeFileFilter = function(\SplFileInfo $file) { |
|
| 45 | 45 | return $file->isFile() && preg_match('/^docker-compose(.)*\.(yaml|yml)$/', $file->getFilename()); |
| 46 | 46 | }; |
| 47 | 47 | $finder->files()->filter($dockerComposeFileFilter)->in($containerProjectDir)->depth('== 0'); |
| 48 | 48 | |
| 49 | 49 | if (!$finder->hasResults()) { |
| 50 | 50 | $this->log->info("no docker-compose file found, let's create it"); |
| 51 | - $this->createDockerComposeFile($containerProjectDir . '/docker-compose.yml'); |
|
| 51 | + $this->createDockerComposeFile($containerProjectDir.'/docker-compose.yml'); |
|
| 52 | 52 | return; |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | /** @var \SplFileInfo $file */ |
| 56 | 56 | foreach ($finder as $file) { |
| 57 | 57 | $this->files[] = new DockerComposeFile($file); |
| 58 | - $this->log->info($file->getFilename() . ' has been found'); |
|
| 58 | + $this->log->info($file->getFilename().' has been found'); |
|
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | /*if (count($this->files) === 1) { |
@@ -94,13 +94,13 @@ discard block |
||
| 94 | 94 | // fwrite($fp, ); |
| 95 | 95 | // fclose($fp); |
| 96 | 96 | |
| 97 | - file_put_contents($path, "version: '" . self::VERSION . "'"); |
|
| 97 | + file_put_contents($path, "version: '".self::VERSION."'"); |
|
| 98 | 98 | chown($path, fileowner(\dirname($path))); |
| 99 | 99 | chgrp($path, filegroup(\dirname($path))); |
| 100 | 100 | |
| 101 | 101 | $file = new DockerComposeFile(new \SplFileInfo($path)); |
| 102 | 102 | $this->files[] = $file; |
| 103 | - $this->log->info($file->getFilename() . ' was successfully created!'); |
|
| 103 | + $this->log->info($file->getFilename().' was successfully created!'); |
|
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | /** |
@@ -110,20 +110,20 @@ discard block |
||
| 110 | 110 | */ |
| 111 | 111 | public static function dockerComposeServiceSerialize(Service $service, string $version = self::VERSION): array |
| 112 | 112 | { |
| 113 | - $portMap = function (array $port): string { |
|
| 114 | - return $port['source'] . ':' . $port['target']; |
|
| 113 | + $portMap = function(array $port): string { |
|
| 114 | + return $port['source'].':'.$port['target']; |
|
| 115 | 115 | }; |
| 116 | - $labelMap = function (array $label): string { |
|
| 116 | + $labelMap = function(array $label): string { |
|
| 117 | 117 | return $label['value']; |
| 118 | 118 | }; |
| 119 | - $envMap = function (EnvVariable $e): string { |
|
| 119 | + $envMap = function(EnvVariable $e): string { |
|
| 120 | 120 | return $e->getValue(); |
| 121 | 121 | }; |
| 122 | 122 | /** |
| 123 | 123 | * @param NamedVolume|BindVolume|TmpfsVolume $v |
| 124 | 124 | * @return array |
| 125 | 125 | */ |
| 126 | - $volumeMap = function ($v): array { |
|
| 126 | + $volumeMap = function($v): array { |
|
| 127 | 127 | $array = [ |
| 128 | 128 | 'type' => $v->getType(), |
| 129 | 129 | 'source' => $v->getSource(), |