@@ -46,7 +46,7 @@ |
||
46 | 46 | */ |
47 | 47 | public static function mergeContentIntoFile(string $content, string $file): void |
48 | 48 | { |
49 | - $tmpFile = __DIR__ . '/tmp-yaml-tools-file.yml'; |
|
49 | + $tmpFile = __DIR__.'/tmp-yaml-tools-file.yml'; |
|
50 | 50 | $fileSystem = new Filesystem(); |
51 | 51 | $fileSystem->dumpFile($tmpFile, $content); |
52 | 52 | self::mergeTwoFiles($file, $tmpFile); |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | ->ask(); |
35 | 35 | |
36 | 36 | if ($doDelete) { |
37 | - $this->log->debug('deleting ' . $elemToDelete . ' in ' . $file); |
|
37 | + $this->log->debug('deleting '.$elemToDelete.' in '.$file); |
|
38 | 38 | YamlTools::deleteYamlItem($elemToDelete, $file); |
39 | 39 | } |
40 | 40 | } |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | ->ask(); |
51 | 51 | |
52 | 52 | if ($doDelete) { |
53 | - $this->log->debug('deleting ' . $elemToDelete . ' in ' . $file); |
|
53 | + $this->log->debug('deleting '.$elemToDelete.' in '.$file); |
|
54 | 54 | YamlTools::deleteYamlItem($elemToDelete, $file); |
55 | 55 | } |
56 | 56 | } |
@@ -38,7 +38,7 @@ |
||
38 | 38 | |
39 | 39 | if (!empty($toDelete)) { |
40 | 40 | foreach ($toDelete as $file) { |
41 | - $this->log->info('Deleting ' . $file); |
|
41 | + $this->log->info('Deleting '.$file); |
|
42 | 42 | unlink($file); |
43 | 43 | } |
44 | 44 | } |
@@ -37,21 +37,21 @@ discard block |
||
37 | 37 | $containerProjectDir = Pheromone::getContainerProjectDirectory(); |
38 | 38 | |
39 | 39 | $finder = new Finder(); |
40 | - $dockerComposeFileFilter = function (\SplFileInfo $file) { |
|
40 | + $dockerComposeFileFilter = function(\SplFileInfo $file) { |
|
41 | 41 | return $file->isFile() && preg_match('/^docker-compose(.)*\.(yaml|yml)$/', $file->getFilename()); |
42 | 42 | }; |
43 | 43 | $finder->files()->filter($dockerComposeFileFilter)->in($containerProjectDir)->depth('== 0'); |
44 | 44 | |
45 | 45 | if (!$finder->hasResults()) { |
46 | 46 | $this->log->info("no docker-compose file found, let's create it"); |
47 | - $this->createDockerComposeFile($containerProjectDir . '/docker-compose.yml'); |
|
47 | + $this->createDockerComposeFile($containerProjectDir.'/docker-compose.yml'); |
|
48 | 48 | return; |
49 | 49 | } |
50 | 50 | |
51 | 51 | /** @var \SplFileInfo $file */ |
52 | 52 | foreach ($finder as $file) { |
53 | 53 | $this->files[] = new DockerComposeFile($file); |
54 | - $this->log->info($file->getFilename() . ' has been found'); |
|
54 | + $this->log->info($file->getFilename().' has been found'); |
|
55 | 55 | } |
56 | 56 | } |
57 | 57 | |
@@ -79,13 +79,13 @@ discard block |
||
79 | 79 | private function createDockerComposeFile(string $path): void |
80 | 80 | { |
81 | 81 | // TODO ask questions about version and so on! |
82 | - file_put_contents($path, "version: '" . self::VERSION . "'"); |
|
82 | + file_put_contents($path, "version: '".self::VERSION."'"); |
|
83 | 83 | chown($path, fileowner(\dirname($path))); |
84 | 84 | chgrp($path, filegroup(\dirname($path))); |
85 | 85 | |
86 | 86 | $file = new DockerComposeFile(new \SplFileInfo($path)); |
87 | 87 | $this->files[] = $file; |
88 | - $this->log->info($file->getFilename() . ' was successfully created!'); |
|
88 | + $this->log->info($file->getFilename().' was successfully created!'); |
|
89 | 89 | } |
90 | 90 | |
91 | 91 | /** |
@@ -95,20 +95,20 @@ discard block |
||
95 | 95 | */ |
96 | 96 | public static function dockerComposeServiceSerialize(Service $service, string $version = self::VERSION): array |
97 | 97 | { |
98 | - $portMap = function (array $port): string { |
|
99 | - return $port['source'] . ':' . $port['target']; |
|
98 | + $portMap = function(array $port): string { |
|
99 | + return $port['source'].':'.$port['target']; |
|
100 | 100 | }; |
101 | - $labelMap = function (array $label): string { |
|
101 | + $labelMap = function(array $label): string { |
|
102 | 102 | return $label['value']; |
103 | 103 | }; |
104 | - $envMap = function (EnvVariable $e): string { |
|
104 | + $envMap = function(EnvVariable $e): string { |
|
105 | 105 | return $e->getValue(); |
106 | 106 | }; |
107 | 107 | /** |
108 | 108 | * @param NamedVolume|BindVolume|TmpfsVolume $v |
109 | 109 | * @return array |
110 | 110 | */ |
111 | - $volumeMap = function ($v): array { |
|
111 | + $volumeMap = function($v): array { |
|
112 | 112 | $array = [ |
113 | 113 | 'type' => $v->getType(), |
114 | 114 | 'source' => $v->getSource(), |
@@ -179,8 +179,8 @@ discard block |
||
179 | 179 | */ |
180 | 180 | public static function mergeContentInDockerComposeFiles($content, array $files, bool $checkValidity = true): void |
181 | 181 | { |
182 | - $tmpFile = __DIR__ . '/tmp-merge-content-file.yml'; |
|
183 | - $tmpMergedFile = __DIR__ . '/tmp-merged-content-file.yml'; |
|
182 | + $tmpFile = __DIR__.'/tmp-merge-content-file.yml'; |
|
183 | + $tmpMergedFile = __DIR__.'/tmp-merged-content-file.yml'; |
|
184 | 184 | |
185 | 185 | if (\is_array($content)) { |
186 | 186 | $content = Yaml::dump($content, 256, 2, Yaml::DUMP_OBJECT_AS_MAP); |