Completed
Pull Request — master (#14)
by
unknown
03:56
created
src/DockerCompose/DockerComposeService.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -41,21 +41,21 @@  discard block
 block discarded – undo
41 41
         }
42 42
 
43 43
         $finder = new Finder();
44
-        $dockerComposeFileFilter = function (\SplFileInfo $file) {
44
+        $dockerComposeFileFilter = function(\SplFileInfo $file) {
45 45
             return $file->isFile() && preg_match('/^docker-compose(.)*\.(yaml|yml)$/', $file->getFilename());
46 46
         };
47 47
         $finder->files()->filter($dockerComposeFileFilter)->in($containerProjectDir)->depth('== 0');
48 48
 
49 49
         if (!$finder->hasResults()) {
50 50
             $this->log->info("no docker-compose file found, let's create it");
51
-            $this->createDockerComposeFile($containerProjectDir . '/docker-compose.yml');
51
+            $this->createDockerComposeFile($containerProjectDir.'/docker-compose.yml');
52 52
             return;
53 53
         }
54 54
 
55 55
         /** @var \SplFileInfo $file */
56 56
         foreach ($finder as $file) {
57 57
             $this->files[] = new DockerComposeFile($file);
58
-            $this->log->info($file->getFilename() . ' has been found');
58
+            $this->log->info($file->getFilename().' has been found');
59 59
         }
60 60
 
61 61
         /*if (count($this->files) === 1) {
@@ -88,12 +88,12 @@  discard block
 block discarded – undo
88 88
     private function createDockerComposeFile(string $path): void
89 89
     {
90 90
         // TODO ask questions about version and so on!
91
-        file_put_contents($path, "version: '" . self::VERSION . "'");
91
+        file_put_contents($path, "version: '".self::VERSION."'");
92 92
         chown($path, 1000);
93 93
         chgrp($path, 1000);
94 94
         $file = new DockerComposeFile(new \SplFileInfo($path));
95 95
         $this->files[] = $file;
96
-        $this->log->info($file->getFilename() . ' was successfully created!');
96
+        $this->log->info($file->getFilename().' was successfully created!');
97 97
     }
98 98
 
99 99
     /**
@@ -103,20 +103,20 @@  discard block
 block discarded – undo
103 103
      */
104 104
     public static function dockerComposeServiceSerialize(Service $service, string $version = self::VERSION): array
105 105
     {
106
-        $portMap = function (array $port): string {
107
-            return $port['source'] . ':' . $port['target'];
106
+        $portMap = function(array $port): string {
107
+            return $port['source'].':'.$port['target'];
108 108
         };
109
-        $labelMap = function (array $label): string {
109
+        $labelMap = function(array $label): string {
110 110
             return $label['value'];
111 111
         };
112
-        $envMap = function (EnvVariable $e): string {
112
+        $envMap = function(EnvVariable $e): string {
113 113
             return $e->getValue();
114 114
         };
115 115
         /**
116 116
          * @param NamedVolume|BindVolume|TmpfsVolume $v
117 117
          * @return array
118 118
          */
119
-        $volumeMap = function ($v): array {
119
+        $volumeMap = function($v): array {
120 120
             $array = [
121 121
                 'type' => $v->getType(),
122 122
                 'source' => $v->getSource(),
Please login to merge, or discard this patch.
src/YamlTools/YamlTools.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -6,8 +6,8 @@
 block discarded – undo
6 6
 
7 7
 class YamlTools
8 8
 {
9
-    public const TMP_YAML_FILE = __DIR__ . '/tmp.yml';
10
-    public const TMP_MERGED_FILE = __DIR__ . '/tmp-merge.yml';
9
+    public const TMP_YAML_FILE = __DIR__.'/tmp.yml';
10
+    public const TMP_MERGED_FILE = __DIR__.'/tmp-merge.yml';
11 11
 
12 12
     /**
13 13
      * Merge the content of $inputFile2 with $inputFile1's one, then write it into $outputFile (or stdout if empty)
Please login to merge, or discard this patch.