@@ -27,7 +27,7 @@ |
||
| 27 | 27 | $content = \preg_replace("/^$key=.*/m", $key.'='.$value, $content); |
| 28 | 28 | } else { |
| 29 | 29 | $commentLines = \explode("\n", $comment ?? ''); |
| 30 | - $commentLines = \array_map(function (string $line) { |
|
| 30 | + $commentLines = \array_map(function(string $line) { |
|
| 31 | 31 | return '# '.$line; |
| 32 | 32 | }, $commentLines); |
| 33 | 33 | $comments = \implode("\n", $commentLines); |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | $fileName = Manifest::mustGetMetadata(CommonMetadata::DOCKER_COMPOSE_FILENAME_KEY); |
| 43 | - $dockerComposePath = Pheromone::getContainerProjectDirectory() . '/' . $fileName; |
|
| 43 | + $dockerComposePath = Pheromone::getContainerProjectDirectory().'/'.$fileName; |
|
| 44 | 44 | |
| 45 | 45 | $this->getAentHelper()->title($fileName); |
| 46 | 46 | |
@@ -64,8 +64,8 @@ discard block |
||
| 64 | 64 | $envFilePath = null; |
| 65 | 65 | if ($envMapDotEnvFile) { |
| 66 | 66 | // TODO: name of file is certainly impacted by name of docker-compose file. |
| 67 | - $envFilePath = '.env-' .$service->getServiceName(); |
|
| 68 | - $dotEnvFile = new EnvFile(Pheromone::getContainerProjectDirectory() . '/' . $envFilePath); |
|
| 67 | + $envFilePath = '.env-'.$service->getServiceName(); |
|
| 68 | + $dotEnvFile = new EnvFile(Pheromone::getContainerProjectDirectory().'/'.$envFilePath); |
|
| 69 | 69 | foreach ($envMapDotEnvFile as $key => $env) { |
| 70 | 70 | $dotEnvFile->set($key, $env->getValue(), $env->getComment()); |
| 71 | 71 | } |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | $formattedPayload = DockerComposeService::dockerComposeServiceSerialize($service, $envFilePath); |
| 77 | 77 | $this->log->debug(\GuzzleHttp\json_encode($formattedPayload, JSON_PRETTY_PRINT)); |
| 78 | 78 | |
| 79 | - $dockerComposePath = Pheromone::getContainerProjectDirectory() . '/' . $fileName; |
|
| 79 | + $dockerComposePath = Pheromone::getContainerProjectDirectory().'/'.$fileName; |
|
| 80 | 80 | DockerComposeService::mergeContentInDockerComposeFile($formattedPayload, $dockerComposePath, true); |
| 81 | 81 | |
| 82 | 82 | $this->output->writeln("Service <info>$serviceName</info> has been successfully added in <info>$fileName</info>!"); |
@@ -28,12 +28,12 @@ discard block |
||
| 28 | 28 | */ |
| 29 | 29 | public static function dockerComposeServiceSerialize(Service $service, ?string $envFileName = null, string $version = self::VERSION): array |
| 30 | 30 | { |
| 31 | - $portMap = function (array $port): string { |
|
| 32 | - return $port['source'] . ':' . $port['target']; |
|
| 31 | + $portMap = function(array $port): string { |
|
| 32 | + return $port['source'].':'.$port['target']; |
|
| 33 | 33 | }; |
| 34 | 34 | $envMapDockerCompose = self::getEnvironmentVariablesForDockerCompose($service); |
| 35 | 35 | |
| 36 | - $envMap = function (EnvVariable $e) { |
|
| 36 | + $envMap = function(EnvVariable $e) { |
|
| 37 | 37 | if ($e->getComment() !== null) { |
| 38 | 38 | return new CommentedItem($e->getValue(), $e->getComment()); |
| 39 | 39 | } |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | * @param NamedVolume|BindVolume|TmpfsVolume $v |
| 44 | 44 | * @return array |
| 45 | 45 | */ |
| 46 | - $volumeMap = function ($v): array { |
|
| 46 | + $volumeMap = function($v): array { |
|
| 47 | 47 | $array = [ |
| 48 | 48 | 'type' => $v->getType(), |
| 49 | 49 | 'source' => $v->getSource(), |