@@ -225,12 +225,12 @@ |
||
| 225 | 225 | $this->checkValidity(true); |
| 226 | 226 | } |
| 227 | 227 | |
| 228 | - $portMap = function ($port) { |
|
| 229 | - return $port['source'] . ':' . $port['target']; |
|
| 228 | + $portMap = function($port) { |
|
| 229 | + return $port['source'].':'.$port['target']; |
|
| 230 | 230 | }; |
| 231 | 231 | |
| 232 | - $keyValueMap = function ($item) { |
|
| 233 | - return $item['key'] . '=' . $item['value']; |
|
| 232 | + $keyValueMap = function($item) { |
|
| 233 | + return $item['key'].'='.$item['value']; |
|
| 234 | 234 | }; |
| 235 | 235 | |
| 236 | 236 | $dockerService = array( |
@@ -10,6 +10,6 @@ |
||
| 10 | 10 | public function __construct(string $emptyAttribute) |
| 11 | 11 | { |
| 12 | 12 | $this->emptyAttribute = $emptyAttribute; |
| 13 | - parent::__construct("empty attribute inside service : " . $emptyAttribute); |
|
| 13 | + parent::__construct("empty attribute inside service : ".$emptyAttribute); |
|
| 14 | 14 | } |
| 15 | 15 | } |
@@ -18,6 +18,6 @@ |
||
| 18 | 18 | { |
| 19 | 19 | $this->array = $array; |
| 20 | 20 | $this->missingKeys = $missingKeys; |
| 21 | - parent::__construct(json_encode($this->array) . " should have these keys : " . json_encode($this->missingKeys)); |
|
| 21 | + parent::__construct(json_encode($this->array)." should have these keys : ".json_encode($this->missingKeys)); |
|
| 22 | 22 | } |
| 23 | 23 | } |
@@ -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 | } |
@@ -25,15 +25,15 @@ |
||
| 25 | 25 | foreach ($dockerComposeFilePathnames as $file) { |
| 26 | 26 | $ymlData = Yaml::parseFile($file); |
| 27 | 27 | if (array_key_exists('serviceName', $ymlData) && array_key_exists($payload['serviceName'], $ymlData['services'])) { |
| 28 | - $toDelete = 'services.' . $payload['serviceName']; |
|
| 29 | - $this->log->info('deleting ' . $toDelete . ' in ' . $file); |
|
| 28 | + $toDelete = 'services.'.$payload['serviceName']; |
|
| 29 | + $this->log->info('deleting '.$toDelete.' in '.$file); |
|
| 30 | 30 | YamlTools::delete($toDelete, $file, $file); |
| 31 | 31 | } |
| 32 | 32 | if (array_key_exists('namedVolumes', $payload) && array_key_exists('volumes', $ymlData)) { |
| 33 | 33 | foreach ($payload['namedVolumes'] as $namedVolume) { |
| 34 | 34 | if (array_key_exists($namedVolume, $ymlData['volumes'])) { |
| 35 | - $toDelete = 'volumes.' . $namedVolume; |
|
| 36 | - $this->log->info('deleting ' . $toDelete . ' in ' . $file); |
|
| 35 | + $toDelete = 'volumes.'.$namedVolume; |
|
| 36 | + $this->log->info('deleting '.$toDelete.' in '.$file); |
|
| 37 | 37 | YamlTools::delete($toDelete, $file, $file); |
| 38 | 38 | } |
| 39 | 39 | } |
@@ -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; |
@@ -16,6 +16,6 @@ |
||
| 16 | 16 | public function __construct(string $invalidVolumeType) |
| 17 | 17 | { |
| 18 | 18 | $this->invalidVolumeType = $invalidVolumeType; |
| 19 | - parent::__construct($this->invalidVolumeType . " is not a valid volume type. Are accepted : " . json_encode(VolumeTypeEnum::getVolumeTypes())); |
|
| 19 | + parent::__construct($this->invalidVolumeType." is not a valid volume type. Are accepted : ".json_encode(VolumeTypeEnum::getVolumeTypes())); |
|
| 20 | 20 | } |
| 21 | 21 | } |