@@ -10,6 +10,6 @@ |
||
10 | 10 | */ |
11 | 11 | public static function emptyPayload(string $event): PayloadException |
12 | 12 | { |
13 | - return new self('payload missing for the event : ' . $event); |
|
13 | + return new self('payload missing for the event : '.$event); |
|
14 | 14 | } |
15 | 15 | } |
@@ -13,7 +13,7 @@ |
||
13 | 13 | |
14 | 14 | */ |
15 | 15 | |
16 | -require __DIR__ . '/../vendor/autoload.php'; |
|
16 | +require __DIR__.'/../vendor/autoload.php'; |
|
17 | 17 | |
18 | 18 | use TheAentMachine\AentApplication; |
19 | 19 | use TheAentMachine\AentDockerCompose\Command\AddEventCommand; |
@@ -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(), |