@@ -27,12 +27,12 @@ discard block |
||
| 27 | 27 | */ |
| 28 | 28 | public static function dockerComposeServiceSerialize(Service $service, array $envFileNames = [], string $version = self::VERSION): array |
| 29 | 29 | { |
| 30 | - $portMap = function (array $port): string { |
|
| 31 | - return $port['source'] . ':' . $port['target']; |
|
| 30 | + $portMap = function(array $port): string { |
|
| 31 | + return $port['source'].':'.$port['target']; |
|
| 32 | 32 | }; |
| 33 | 33 | $envMapDockerCompose = self::getEnvironmentVariablesForDockerCompose($service); |
| 34 | 34 | |
| 35 | - $envMap = function (EnvVariable $e) { |
|
| 35 | + $envMap = function(EnvVariable $e) { |
|
| 36 | 36 | if ($e->getComment() !== null) { |
| 37 | 37 | return new CommentedItem($e->getValue(), $e->getComment()); |
| 38 | 38 | } |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | * @param NamedVolume|BindVolume|TmpfsVolume $v |
| 43 | 43 | * @return array |
| 44 | 44 | */ |
| 45 | - $volumeMap = function ($v): array { |
|
| 45 | + $volumeMap = function($v): array { |
|
| 46 | 46 | $array = [ |
| 47 | 47 | 'type' => $v->getType(), |
| 48 | 48 | 'source' => $v->getSource(), |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | // Therefore, we need to remove the env_file before checking. |
| 96 | 96 | $strFile = \file_get_contents($pathname); |
| 97 | 97 | if ($strFile === false) { |
| 98 | - throw new \RuntimeException('Unable to load file ' . $pathname); |
|
| 98 | + throw new \RuntimeException('Unable to load file '.$pathname); |
|
| 99 | 99 | } |
| 100 | 100 | $content = Yaml::parse($strFile); |
| 101 | 101 | if (isset($content['services'])) { |
@@ -44,9 +44,9 @@ discard block |
||
| 44 | 44 | if ($fileName === 'docker-compose.yml') { |
| 45 | 45 | $envPrefix = ''; |
| 46 | 46 | } else { |
| 47 | - $envPrefix = '-' . Manifest::mustGetMetadata(CommonMetadata::ENV_NAME_KEY); |
|
| 47 | + $envPrefix = '-'.Manifest::mustGetMetadata(CommonMetadata::ENV_NAME_KEY); |
|
| 48 | 48 | } |
| 49 | - $dockerComposePath = Pheromone::getContainerProjectDirectory() . '/' . $fileName; |
|
| 49 | + $dockerComposePath = Pheromone::getContainerProjectDirectory().'/'.$fileName; |
|
| 50 | 50 | |
| 51 | 51 | $this->getAentHelper()->title($fileName); |
| 52 | 52 | |
@@ -74,9 +74,9 @@ discard block |
||
| 74 | 74 | */ |
| 75 | 75 | foreach ($envMapDotEnvFile as $key => $sharedEnvVariable) { |
| 76 | 76 | // TODO: name of file is certainly impacted by name of docker-compose file. |
| 77 | - $envFilePath = '.' . $sharedEnvVariable->getContainerId() . $envPrefix . '.env'; |
|
| 77 | + $envFilePath = '.'.$sharedEnvVariable->getContainerId().$envPrefix.'.env'; |
|
| 78 | 78 | $envFilePaths[] = $envFilePath; |
| 79 | - $dotEnvFile = new EnvFile(Pheromone::getContainerProjectDirectory() . '/' . $envFilePath); |
|
| 79 | + $dotEnvFile = new EnvFile(Pheromone::getContainerProjectDirectory().'/'.$envFilePath); |
|
| 80 | 80 | $dotEnvFile->set($key, $sharedEnvVariable->getValue(), $sharedEnvVariable->getComment()); |
| 81 | 81 | } |
| 82 | 82 | $envFilePaths = array_unique($envFilePaths); |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | $formattedPayload = DockerComposeService::dockerComposeServiceSerialize($service, $envFilePaths); |
| 86 | 86 | $this->log->debug(\GuzzleHttp\json_encode($formattedPayload, JSON_PRETTY_PRINT)); |
| 87 | 87 | |
| 88 | - $dockerComposePath = Pheromone::getContainerProjectDirectory() . '/' . $fileName; |
|
| 88 | + $dockerComposePath = Pheromone::getContainerProjectDirectory().'/'.$fileName; |
|
| 89 | 89 | DockerComposeService::mergeContentInDockerComposeFile($formattedPayload, $dockerComposePath, true); |
| 90 | 90 | |
| 91 | 91 | $this->output->writeln("Service <info>$serviceName</info> has been successfully added in <info>$fileName</info>!"); |