Passed
Pull Request — master (#23)
by Keoghan
02:43
created
config/database.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
     'connections' => [
16 16
         'default' => [
17 17
             'driver'   => 'sqlite',
18
-            'database' => env('LIBRARY_PATH').'/database.sqlite',
18
+            'database' => env('LIBRARY_PATH') . '/database.sqlite',
19 19
         ],
20 20
     ],
21 21
 ];
Please login to merge, or discard this patch.
app/Support/Dnsmasq/Container.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@
 block discarded – undo
17 17
 
18 18
     public function updateDomain($from, $to)
19 19
     {
20
-        $filePath = app(PorterLibrary::class)->configPath().'/dnsmasq/dnsmasq.conf';
20
+        $filePath = app(PorterLibrary::class)->configPath() . '/dnsmasq/dnsmasq.conf';
21 21
 
22 22
         $newConfig = preg_replace("/\/.{$from}\//", "/.{$to}/", file_get_contents($filePath));
23 23
 
Please login to merge, or discard this patch.
app/Support/Mechanics/Windows.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
      */
12 12
     public function getUserHomePath()
13 13
     {
14
-        return $this->serverBag->get('HOME') ?? $this->serverBag->get('HOMEDRIVE').$this->serverBag->get('HOMEPATH');
14
+        return $this->serverBag->get('HOME') ?? $this->serverBag->get('HOMEDRIVE') . $this->serverBag->get('HOMEPATH');
15 15
     }
16 16
 
17 17
     /**
Please login to merge, or discard this patch.
app/Support/Mechanics/MacOs.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
 
17 17
         $command = "sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain {$pem}";
18 18
 
19
-        if($this->isTesting()) {
19
+        if ($this->isTesting()) {
20 20
             $this->consoleWriter->info("Did not trust CA during testing.");
21 21
             return;
22 22
         }
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 
37 37
         $command = "sudo security add-trusted-cert -d -r trustAsRoot -k /Library/Keychains/System.keychain {$crt}";
38 38
 
39
-        if($this->isTesting()) {
39
+        if ($this->isTesting()) {
40 40
             $this->consoleWriter->info("Did not trust Certificate during testing.");
41 41
             return;
42 42
         }
Please login to merge, or discard this patch.
app/Support/FilePublisher.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
      */
65 65
     protected function publishFile($from, $to)
66 66
     {
67
-        if (! $this->files->exists($to) || $this->force) {
67
+        if (!$this->files->exists($to) || $this->force) {
68 68
             $this->createParentDirectory(dirname($to));
69 69
 
70 70
             $this->files->copy($from, $to);
@@ -95,8 +95,8 @@  discard block
 block discarded – undo
95 95
     protected function moveManagedFiles($manager)
96 96
     {
97 97
         foreach ($manager->listContents('from://', true) as $file) {
98
-            if ($file['type'] === 'file' && (! $manager->has('to://'.$file['path']) || $this->force)) {
99
-                $manager->put('to://'.$file['path'], $manager->read('from://'.$file['path']));
98
+            if ($file['type'] === 'file' && (!$manager->has('to://' . $file['path']) || $this->force)) {
99
+                $manager->put('to://' . $file['path'], $manager->read('from://' . $file['path']));
100 100
             }
101 101
         }
102 102
     }
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
      */
110 110
     protected function createParentDirectory($directory)
111 111
     {
112
-        if (! $this->files->isDirectory($directory)) {
112
+        if (!$this->files->isDirectory($directory)) {
113 113
             $this->files->makeDirectory($directory, 0755, true);
114 114
         }
115 115
     }
Please login to merge, or discard this patch.
app/Models/Site.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
     {
34 34
         $name = static::nameFromPath($path ?: app(Cli::class)->currentWorkingDirectory());
35 35
 
36
-        if (! $name) {
36
+        if (!$name) {
37 37
             return null;
38 38
         }
39 39
 
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
     {
53 53
         $site = static::resolveFromPathOrCurrentWorkingDirectory($path);
54 54
 
55
-        if (! $site) {
55
+        if (!$site) {
56 56
             throw new \Exception("Site not found.");
57 57
         }
58 58
 
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
      */
67 67
     public function getUrlAttribute()
68 68
     {
69
-        return $this->name.'.'.setting('domain');
69
+        return $this->name . '.' . setting('domain');
70 70
     }
71 71
 
72 72
     /**
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
      */
77 77
     public function getSchemeAttribute()
78 78
     {
79
-        return ($this->secure ? 'https' : 'http').'://';
79
+        return ($this->secure ? 'https' : 'http') . '://';
80 80
     }
81 81
 
82 82
     /**
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
      */
87 87
     public function getNginxConfPathAttribute()
88 88
     {
89
-        return app(PorterLibrary::class)->configPath()."/nginx/conf.d/{$this->name}.conf";
89
+        return app(PorterLibrary::class)->configPath() . "/nginx/conf.d/{$this->name}.conf";
90 90
     }
91 91
 
92 92
     /**
Please login to merge, or discard this patch.
app/Commands/Begin.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 
33 33
         $lib = app(PorterLibrary::class);
34 34
 
35
-        if ($lib->alreadySetUp() && ! $force) {
35
+        if ($lib->alreadySetUp() && !$force) {
36 36
             $this->error("Already began, so we've stopped to avoid wiping your settings.");
37 37
             $this->error("If you definitely want to continue, you can force with the --force flag.");
38 38
             return;
@@ -45,12 +45,12 @@  discard block
 block discarded – undo
45 45
 
46 46
         $lib->setup($this->app, $force);
47 47
 
48
-        if (! $lib->path()) {
48
+        if (!$lib->path()) {
49 49
             $this->error('Failed detecting and setting the library path for Porter');
50 50
             die();
51 51
         }
52 52
 
53
-        $this->info("Your Porter settings are stored in ".$lib->path());
53
+        $this->info("Your Porter settings are stored in " . $lib->path());
54 54
         $this->info("");
55 55
 
56 56
         $this->callSilent('home', ['path' => $home]);
Please login to merge, or discard this patch.
app/Providers/AppServiceProvider.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -29,23 +29,23 @@
 block discarded – undo
29 29
      */
30 30
     public function register(): void
31 31
     {
32
-        $this->app->singleton(ServerBag::class, function () {
32
+        $this->app->singleton(ServerBag::class, function() {
33 33
             return new ServerBag;
34 34
         });
35
-        $this->app->bind(CliContract::class, function () {
35
+        $this->app->bind(CliContract::class, function() {
36 36
             return new Cli;
37 37
         });
38
-        $this->app->bind(ImageSetRepositoryContract::class, function () {
38
+        $this->app->bind(ImageSetRepositoryContract::class, function() {
39 39
             return (new ImageSetRepository)->addLocation(app(PorterLibrary::class)->dockerImagesPath());
40 40
         });
41 41
 
42
-        $this->app->singleton(PorterLibrary::class, function () {
42
+        $this->app->singleton(PorterLibrary::class, function() {
43 43
             return new PorterLibrary(app(FilePublisher::class), config('porter.library_path'));
44 44
         });
45 45
 
46 46
         $this->app->singleton(Porter::class);
47 47
         $this->app->singleton(ConsoleWriter::class);
48
-        $this->app->singleton(CertificateBuilder::class, function () {
48
+        $this->app->singleton(CertificateBuilder::class, function() {
49 49
             return new CertificateBuilder(app(PorterLibrary::class)->sslPath());
50 50
         });
51 51
     }
Please login to merge, or discard this patch.
app/PorterLibrary.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -30,27 +30,27 @@  discard block
 block discarded – undo
30 30
 
31 31
     public function configPath()
32 32
     {
33
-        return $this->path.'/config';
33
+        return $this->path . '/config';
34 34
     }
35 35
 
36 36
     public function databaseFile()
37 37
     {
38
-        return $this->path.'/database.sqlite';
38
+        return $this->path . '/database.sqlite';
39 39
     }
40 40
 
41 41
     public function dockerComposeFile()
42 42
     {
43
-        return $this->path.'/docker-compose.yaml';
43
+        return $this->path . '/docker-compose.yaml';
44 44
     }
45 45
 
46 46
     public function dockerImagesPath()
47 47
     {
48
-        return $this->path.'/docker';
48
+        return $this->path . '/docker';
49 49
     }
50 50
 
51 51
     public function sslPath()
52 52
     {
53
-        return $this->path.'/ssl';
53
+        return $this->path . '/ssl';
54 54
     }
55 55
 
56 56
     public function path()
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 
61 61
     public function viewsPath()
62 62
     {
63
-        return $this->path.'/views';
63
+        return $this->path . '/views';
64 64
     }
65 65
 
66 66
     public function alreadySetUp()
@@ -70,12 +70,12 @@  discard block
 block discarded – undo
70 70
 
71 71
     public function setUp(Application $app, $force = false)
72 72
     {
73
-        if ($this->alreadySetUp() && ! $force) {
73
+        if ($this->alreadySetUp() && !$force) {
74 74
             return;
75 75
         }
76 76
 
77
-        if (! $this->path) {
78
-            $this->path = ChooseMechanic::forOS()->getUserHomePath().'/.porter';
77
+        if (!$this->path) {
78
+            $this->path = ChooseMechanic::forOS()->getUserHomePath() . '/.porter';
79 79
 
80 80
             $this->moveExistingConfig();
81 81
             $this->publishEnv();
@@ -104,11 +104,11 @@  discard block
 block discarded – undo
104 104
 
105 105
     protected function moveExistingConfig()
106 106
     {
107
-        if (! $this->alreadySetUp()) {
107
+        if (!$this->alreadySetUp()) {
108 108
             return;
109 109
         }
110 110
 
111
-        $this->files->moveDirectory($this->path(), $this->path().'_'.now()->format('YmdHis'));
111
+        $this->files->moveDirectory($this->path(), $this->path() . '_' . now()->format('YmdHis'));
112 112
     }
113 113
 
114 114
     protected function createDatabase()
Please login to merge, or discard this patch.