@@ -10,6 +10,6 @@ |
||
| 10 | 10 | */ |
| 11 | 11 | public function __construct() |
| 12 | 12 | { |
| 13 | - parent::__construct('environment variable ' . PheromoneEnum::PHEROMONE_CONTAINER_PROJECT_DIR . ' is empty'); |
|
| 13 | + parent::__construct('environment variable '.PheromoneEnum::PHEROMONE_CONTAINER_PROJECT_DIR.' is empty'); |
|
| 14 | 14 | } |
| 15 | 15 | } |
@@ -31,21 +31,21 @@ discard block |
||
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | $finder = new Finder(); |
| 34 | - $dockerComposeFileFilter = function (\SplFileInfo $file) { |
|
| 34 | + $dockerComposeFileFilter = function(\SplFileInfo $file) { |
|
| 35 | 35 | return $file->isFile() && preg_match('/^docker-compose(.)*\.(yaml|yml)$/', $file->getFilename()); |
| 36 | 36 | }; |
| 37 | 37 | $finder->files()->filter($dockerComposeFileFilter)->in($containerProjectDir)->depth('== 0'); |
| 38 | 38 | |
| 39 | 39 | if (!$finder->hasResults()) { |
| 40 | 40 | $this->log->info("no docker-compose file found, let's create it"); |
| 41 | - $this->createDockerComposeFile($containerProjectDir . '/docker-compose.yml'); |
|
| 41 | + $this->createDockerComposeFile($containerProjectDir.'/docker-compose.yml'); |
|
| 42 | 42 | return; |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | /** @var \SplFileInfo $file */ |
| 46 | 46 | foreach ($finder as $file) { |
| 47 | 47 | $this->files[] = new DockerComposeFile($file); |
| 48 | - $this->log->info($file->getFilename() . ' has been found'); |
|
| 48 | + $this->log->info($file->getFilename().' has been found'); |
|
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | /*if (count($this->files) === 1) { |
@@ -83,6 +83,6 @@ discard block |
||
| 83 | 83 | |
| 84 | 84 | $file = new DockerComposeFile(new \SplFileInfo($path)); |
| 85 | 85 | $this->files[] = $file; |
| 86 | - $this->log->info($file->getFilename() . ' was successfully created!'); |
|
| 86 | + $this->log->info($file->getFilename().' was successfully created!'); |
|
| 87 | 87 | } |
| 88 | 88 | } |
@@ -40,7 +40,7 @@ |
||
| 40 | 40 | |
| 41 | 41 | if (!empty($toDelete)) { |
| 42 | 42 | foreach ($toDelete as $file) { |
| 43 | - $this->log->info('Deleting ' . $file); |
|
| 43 | + $this->log->info('Deleting '.$file); |
|
| 44 | 44 | unlink($file); |
| 45 | 45 | } |
| 46 | 46 | } |
@@ -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; |
@@ -61,16 +61,16 @@ |
||
| 61 | 61 | */ |
| 62 | 62 | public function dockerComposeServiceSerialize(Service $service): array |
| 63 | 63 | { |
| 64 | - $portMap = function (array $port): string { |
|
| 65 | - return $port['source'] . ':' . $port['target']; |
|
| 64 | + $portMap = function(array $port): string { |
|
| 65 | + return $port['source'].':'.$port['target']; |
|
| 66 | 66 | }; |
| 67 | - $labelMap = function (string $key, array $label): string { |
|
| 68 | - return $key . '=' . $label['value']; |
|
| 67 | + $labelMap = function(string $key, array $label): string { |
|
| 68 | + return $key.'='.$label['value']; |
|
| 69 | 69 | }; |
| 70 | - $envMap = function (string $key, array $env): string { |
|
| 71 | - return $key . '=' . $env['value']; |
|
| 70 | + $envMap = function(string $key, array $env): string { |
|
| 71 | + return $key.'='.$env['value']; |
|
| 72 | 72 | }; |
| 73 | - $jsonSerializeMap = function (\JsonSerializable $obj): array { |
|
| 73 | + $jsonSerializeMap = function(\JsonSerializable $obj): array { |
|
| 74 | 74 | return $obj->jsonSerialize(); |
| 75 | 75 | }; |
| 76 | 76 | $dockerService = array( |
@@ -29,22 +29,22 @@ |
||
| 29 | 29 | foreach ($dockerComposeFilePathnames as $file) { |
| 30 | 30 | $ymlData = Yaml::parseFile($file); |
| 31 | 31 | if (array_key_exists('serviceName', $ymlData) && array_key_exists($payload['serviceName'], $ymlData['services'])) { |
| 32 | - $toDelete = 'services.' . $payload['serviceName']; |
|
| 32 | + $toDelete = 'services.'.$payload['serviceName']; |
|
| 33 | 33 | $question = $this->getDeleteConfirmationQuestion($toDelete); |
| 34 | 34 | $doDelete = $helper->ask($this->input, $this->output, $question); |
| 35 | 35 | if ($doDelete) { |
| 36 | - $this->log->info('deleting ' . $toDelete . ' in ' . $file); |
|
| 36 | + $this->log->info('deleting '.$toDelete.' in '.$file); |
|
| 37 | 37 | YamlTools::delete($toDelete, $file, $file); |
| 38 | 38 | } |
| 39 | 39 | } |
| 40 | 40 | if (array_key_exists('namedVolumes', $payload) && array_key_exists('volumes', $ymlData)) { |
| 41 | 41 | foreach ($payload['namedVolumes'] as $namedVolume) { |
| 42 | 42 | if (array_key_exists($namedVolume, $ymlData['volumes'])) { |
| 43 | - $toDelete = 'volumes.' . $namedVolume; |
|
| 43 | + $toDelete = 'volumes.'.$namedVolume; |
|
| 44 | 44 | $question = $this->getDeleteConfirmationQuestion($toDelete); |
| 45 | 45 | $doDelete = $helper->ask($this->input, $this->output, $question); |
| 46 | 46 | if ($doDelete) { |
| 47 | - $this->log->info('deleting ' . $toDelete . ' in ' . $file); |
|
| 47 | + $this->log->info('deleting '.$toDelete.' in '.$file); |
|
| 48 | 48 | YamlTools::delete($toDelete, $file, $file); |
| 49 | 49 | } |
| 50 | 50 | } |
@@ -6,7 +6,7 @@ |
||
| 6 | 6 | |
| 7 | 7 | class YamlTools |
| 8 | 8 | { |
| 9 | - public const TMP_YAML_FILE = __DIR__ . '/tmp.yml'; |
|
| 9 | + public const TMP_YAML_FILE = __DIR__.'/tmp.yml'; |
|
| 10 | 10 | |
| 11 | 11 | /** |
| 12 | 12 | * Merge the content of $inputFile2 with $inputFile1's one, then write it into $outputFile (or stdout if empty) |