Completed
Pull Request — master (#489)
by Helpful
03:34
created
code/tasks/DNMigrate1_1to1_2.php 3 patches
Indentation   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -1,39 +1,39 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Will convert the Filename to the version 1.2 of deploynaut where it
4
- * more or less is exactly is the same as the Name but with .rb
5
- */
3
+	 * Will convert the Filename to the version 1.2 of deploynaut where it
4
+	 * more or less is exactly is the same as the Name but with .rb
5
+	 */
6 6
 class DNMigrate1_1to1_2 extends BuildTask
7 7
 {
8
-    /**
9
-     * @param SS_HTTPRequest $request
10
-     */
11
-    public function run($request = null)
12
-    {
13
-        $projects = DNProject::get();
8
+	/**
9
+	 * @param SS_HTTPRequest $request
10
+	 */
11
+	public function run($request = null)
12
+	{
13
+		$projects = DNProject::get();
14 14
 
15
-        foreach ($projects as $project) {
16
-            $environments = $project->DNEnvironmentList();
17
-            foreach ($environments as $environment) {
18
-                $newFilename = basename($environment->Filename);
19
-                if ($environment->Filename != $newFilename) {
20
-                    echo 'Migrating "' . $environment->Filename . '" to ' . $newFilename . PHP_EOL;
21
-                    $environment->Filename = $newFilename;
22
-                    $environment->write();
23
-                }
24
-            }
25
-        }
15
+		foreach ($projects as $project) {
16
+			$environments = $project->DNEnvironmentList();
17
+			foreach ($environments as $environment) {
18
+				$newFilename = basename($environment->Filename);
19
+				if ($environment->Filename != $newFilename) {
20
+					echo 'Migrating "' . $environment->Filename . '" to ' . $newFilename . PHP_EOL;
21
+					$environment->Filename = $newFilename;
22
+					$environment->write();
23
+				}
24
+			}
25
+		}
26 26
 
27
-        $warnings = false;
28
-        // Check if all project folders exists
29
-        foreach ($projects as $project) {
30
-            if (!$project->projectFolderExists()) {
31
-                $warnings = true;
32
-                echo 'Project ' . $project->Name . ' don\'t have a cap project folder' . PHP_EOL;
33
-            }
34
-        }
35
-        if ($warnings) {
36
-            exit(1);
37
-        }
38
-    }
27
+		$warnings = false;
28
+		// Check if all project folders exists
29
+		foreach ($projects as $project) {
30
+			if (!$project->projectFolderExists()) {
31
+				$warnings = true;
32
+				echo 'Project ' . $project->Name . ' don\'t have a cap project folder' . PHP_EOL;
33
+			}
34
+		}
35
+		if ($warnings) {
36
+			exit(1);
37
+		}
38
+	}
39 39
 }
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -12,11 +12,11 @@  discard block
 block discarded – undo
12 12
     {
13 13
         $projects = DNProject::get();
14 14
 
15
-        foreach ($projects as $project) {
15
+        foreach($projects as $project) {
16 16
             $environments = $project->DNEnvironmentList();
17
-            foreach ($environments as $environment) {
17
+            foreach($environments as $environment) {
18 18
                 $newFilename = basename($environment->Filename);
19
-                if ($environment->Filename != $newFilename) {
19
+                if($environment->Filename != $newFilename) {
20 20
                     echo 'Migrating "' . $environment->Filename . '" to ' . $newFilename . PHP_EOL;
21 21
                     $environment->Filename = $newFilename;
22 22
                     $environment->write();
@@ -26,13 +26,13 @@  discard block
 block discarded – undo
26 26
 
27 27
         $warnings = false;
28 28
         // Check if all project folders exists
29
-        foreach ($projects as $project) {
30
-            if (!$project->projectFolderExists()) {
29
+        foreach($projects as $project) {
30
+            if(!$project->projectFolderExists()) {
31 31
                 $warnings = true;
32 32
                 echo 'Project ' . $project->Name . ' don\'t have a cap project folder' . PHP_EOL;
33 33
             }
34 34
         }
35
-        if ($warnings) {
35
+        if($warnings) {
36 36
             exit(1);
37 37
         }
38 38
     }
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -3,13 +3,11 @@
 block discarded – undo
3 3
  * Will convert the Filename to the version 1.2 of deploynaut where it
4 4
  * more or less is exactly is the same as the Name but with .rb
5 5
  */
6
-class DNMigrate1_1to1_2 extends BuildTask
7
-{
6
+class DNMigrate1_1to1_2 extends BuildTask {
8 7
     /**
9 8
      * @param SS_HTTPRequest $request
10 9
      */
11
-    public function run($request = null)
12
-    {
10
+    public function run($request = null) {
13 11
         $projects = DNProject::get();
14 12
 
15 13
         foreach ($projects as $project) {
Please login to merge, or discard this patch.
code/tasks/FilesystemSyncTask.php 2 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Surface Filesystem::sync() as a dev task in case CMS has not been included.
4
- */
3
+	 * Surface Filesystem::sync() as a dev task in case CMS has not been included.
4
+	 */
5 5
 class CMSFilesystemSyncTask extends BuildTask
6 6
 {
7
-    public function run($request = null)
8
-    {
9
-        Filesystem::sync();
10
-    }
7
+	public function run($request = null)
8
+	{
9
+		Filesystem::sync();
10
+	}
11 11
 }
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -2,10 +2,8 @@
 block discarded – undo
2 2
 /**
3 3
  * Surface Filesystem::sync() as a dev task in case CMS has not been included.
4 4
  */
5
-class CMSFilesystemSyncTask extends BuildTask
6
-{
7
-    public function run($request = null)
8
-    {
5
+class CMSFilesystemSyncTask extends BuildTask {
6
+    public function run($request = null) {
9 7
         Filesystem::sync();
10 8
     }
11 9
 }
Please login to merge, or discard this patch.
code/tasks/SyncProjectsAndEnvironments.php 3 patches
Indentation   +172 added lines, -172 removed lines patch added patch discarded remove patch
@@ -2,176 +2,176 @@
 block discarded – undo
2 2
 
3 3
 class SyncProjectsAndEnvironments extends BuildTask
4 4
 {
5
-    /**
6
-     * @param SS_HTTPRequest|null $request
7
-     */
8
-    public function run($request = null)
9
-    {
10
-        // should syncing remove obsolete records?
11
-        $remove = true;
12
-        $dryRun = true;
13
-
14
-        if ($request && $request->requestVar('remove') !== null) {
15
-            $remove = (bool)$request->requestVar('remove');
16
-        }
17
-
18
-        if ($request && $request->requestVar('dryrun') !== null) {
19
-            $dryRun = (bool)$request->requestVar('dryrun');
20
-        }
21
-
22
-        if ($dryRun) {
23
-            echo "Running in dry run mode, no changes commited, ";
24
-            echo "the output shows a prediction on what will happen." . PHP_EOL;
25
-            echo "To skip dryrun, run the task like this:" . PHP_EOL;
26
-            echo "./framework/sake dev/tasks/SyncProjectsAndEnvironments dryrun=0" . PHP_EOL . PHP_EOL;
27
-            sleep(3);
28
-        }
29
-
30
-        $data = DNData::inst();
31
-        $projectPaths = $data->getProjectPaths();
32
-
33
-        // Sync projects
34
-        $projects = DNProject::get();
35
-        if ($remove) {
36
-            $this->echoHeader('Removing obsolete projects');
37
-            $this->removeObsoleteProjects($projectPaths, $dryRun);
38
-        }
39
-        $this->echoHeader('Adding new projects');
40
-        $this->syncProjectPaths($projectPaths, $dryRun);
41
-
42
-        $this->echoHeader('Syncing environment files');
43
-        foreach ($projects as $project) {
44
-            $this->echoHeader($project->Name);
45
-            // Sync environments for each project
46
-            $environmentPaths = $data->getEnvironmentPaths($project->Name);
47
-            $this->removeObsoleteEnvironments($environmentPaths, $project, $dryRun);
48
-            $this->syncEnvironmentPaths($environmentPaths, $project, $dryRun);
49
-        }
50
-    }
51
-
52
-    /**
53
-     * Remove environment files that can't be found on disk
54
-     *
55
-     * @param array $paths Array of pathnames
56
-     * @param DNProject
57
-     * @param bool $dryRun
58
-     */
59
-    protected function removeObsoleteEnvironments($paths, $project, $dryRun = false)
60
-    {
61
-        $list = $project->Environments();
62
-
63
-        $basePaths = array_map(function ($path) {
64
-            return basename($path);
65
-        }, $paths);
66
-
67
-        $removeList = $list->filter('Filename:not', $basePaths);
68
-        if ($removeList->count() === 0) {
69
-            return;
70
-        }
71
-
72
-        foreach ($removeList as $remove) {
73
-            $this->message('Removing "' . basename($remove->Name) . '" from db');
74
-            if (!$dryRun) {
75
-                $removeList->remove($remove);
76
-            }
77
-        }
78
-    }
79
-
80
-    /**
81
-     * Remove projects that don't exists on disk but in the database
82
-     *
83
-     * @todo add a archive functionality
84
-     *
85
-     * @param array $paths
86
-     */
87
-    protected function removeObsoleteProjects($paths, $dryrun = false)
88
-    {
89
-        $removeList = DNProject::get()->filter('Name:not', $paths);
90
-        if ($removeList->count() == 0) {
91
-            return;
92
-        }
93
-
94
-        foreach ($removeList as $remove) {
95
-            $this->message($remove->Name . ' ' . $remove->Path);
96
-            if (!$dryrun) {
97
-                $removeList->remove($remove);
98
-            }
99
-        }
100
-    }
101
-
102
-    /**
103
-     * Sync the in-db project list with a list of file paths
104
-     *
105
-     * @param array $paths Array of pathnames
106
-     * @param DNProject
107
-     * @param bool $dryRun
108
-     */
109
-    protected function syncEnvironmentPaths($paths, $project, $dryRun = false)
110
-    {
111
-        $list = $project->Environments();
112
-
113
-        // Normalise paths in DB
114
-        foreach ($list as $item) {
115
-            $real = realpath($item->Filename);
116
-            if ($real && $real != $item->Filename) {
117
-                $item->Filename = $real;
118
-                $item->write();
119
-            }
120
-        }
121
-
122
-        foreach ($paths as $path) {
123
-            $path = basename($path);
124
-            if ($list->filter('Filename', $path)->count()) {
125
-                continue;
126
-            }
127
-
128
-            $this->message('Adding "' . basename($path) . '" to db');
129
-            if (!$dryRun) {
130
-                $environment = DNEnvironment::create_from_path($path);
131
-                $environment->ProjectID = $project->ID;
132
-                $environment->write();
133
-            }
134
-        }
135
-    }
136
-
137
-    /**
138
-     * Sync the in-db project list with a list of file paths
139
-     *
140
-     * @param array $paths Array of pathnames
141
-     * @param boolean $dryRun
142
-     */
143
-    public function syncProjectPaths($paths, $dryRun = false)
144
-    {
145
-        foreach ($paths as $path) {
146
-            if (!DNProject::get()->filter('Name', $path)->count()) {
147
-                $this->message($path);
148
-                if (!$dryRun) {
149
-                    DNProject::create_from_path($path)->write();
150
-                }
151
-            }
152
-        }
153
-    }
154
-
155
-    /**
156
-     * @param string $text
157
-     */
158
-    protected function message($text)
159
-    {
160
-        if (PHP_SAPI !== 'cli') {
161
-            $text = '<p>' . $text . '</p>' . PHP_EOL;
162
-        }
163
-        echo ' - ' . $text . PHP_EOL;
164
-    }
165
-
166
-    /**
167
-     * @param string $text
168
-     */
169
-    protected function echoHeader($text)
170
-    {
171
-        if (PHP_SAPI !== 'cli') {
172
-            echo '<h2>' . $text . '</h2>' . PHP_EOL;
173
-        } else {
174
-            echo '# ' . $text . PHP_EOL;
175
-        }
176
-    }
5
+	/**
6
+	 * @param SS_HTTPRequest|null $request
7
+	 */
8
+	public function run($request = null)
9
+	{
10
+		// should syncing remove obsolete records?
11
+		$remove = true;
12
+		$dryRun = true;
13
+
14
+		if ($request && $request->requestVar('remove') !== null) {
15
+			$remove = (bool)$request->requestVar('remove');
16
+		}
17
+
18
+		if ($request && $request->requestVar('dryrun') !== null) {
19
+			$dryRun = (bool)$request->requestVar('dryrun');
20
+		}
21
+
22
+		if ($dryRun) {
23
+			echo "Running in dry run mode, no changes commited, ";
24
+			echo "the output shows a prediction on what will happen." . PHP_EOL;
25
+			echo "To skip dryrun, run the task like this:" . PHP_EOL;
26
+			echo "./framework/sake dev/tasks/SyncProjectsAndEnvironments dryrun=0" . PHP_EOL . PHP_EOL;
27
+			sleep(3);
28
+		}
29
+
30
+		$data = DNData::inst();
31
+		$projectPaths = $data->getProjectPaths();
32
+
33
+		// Sync projects
34
+		$projects = DNProject::get();
35
+		if ($remove) {
36
+			$this->echoHeader('Removing obsolete projects');
37
+			$this->removeObsoleteProjects($projectPaths, $dryRun);
38
+		}
39
+		$this->echoHeader('Adding new projects');
40
+		$this->syncProjectPaths($projectPaths, $dryRun);
41
+
42
+		$this->echoHeader('Syncing environment files');
43
+		foreach ($projects as $project) {
44
+			$this->echoHeader($project->Name);
45
+			// Sync environments for each project
46
+			$environmentPaths = $data->getEnvironmentPaths($project->Name);
47
+			$this->removeObsoleteEnvironments($environmentPaths, $project, $dryRun);
48
+			$this->syncEnvironmentPaths($environmentPaths, $project, $dryRun);
49
+		}
50
+	}
51
+
52
+	/**
53
+	 * Remove environment files that can't be found on disk
54
+	 *
55
+	 * @param array $paths Array of pathnames
56
+	 * @param DNProject
57
+	 * @param bool $dryRun
58
+	 */
59
+	protected function removeObsoleteEnvironments($paths, $project, $dryRun = false)
60
+	{
61
+		$list = $project->Environments();
62
+
63
+		$basePaths = array_map(function ($path) {
64
+			return basename($path);
65
+		}, $paths);
66
+
67
+		$removeList = $list->filter('Filename:not', $basePaths);
68
+		if ($removeList->count() === 0) {
69
+			return;
70
+		}
71
+
72
+		foreach ($removeList as $remove) {
73
+			$this->message('Removing "' . basename($remove->Name) . '" from db');
74
+			if (!$dryRun) {
75
+				$removeList->remove($remove);
76
+			}
77
+		}
78
+	}
79
+
80
+	/**
81
+	 * Remove projects that don't exists on disk but in the database
82
+	 *
83
+	 * @todo add a archive functionality
84
+	 *
85
+	 * @param array $paths
86
+	 */
87
+	protected function removeObsoleteProjects($paths, $dryrun = false)
88
+	{
89
+		$removeList = DNProject::get()->filter('Name:not', $paths);
90
+		if ($removeList->count() == 0) {
91
+			return;
92
+		}
93
+
94
+		foreach ($removeList as $remove) {
95
+			$this->message($remove->Name . ' ' . $remove->Path);
96
+			if (!$dryrun) {
97
+				$removeList->remove($remove);
98
+			}
99
+		}
100
+	}
101
+
102
+	/**
103
+	 * Sync the in-db project list with a list of file paths
104
+	 *
105
+	 * @param array $paths Array of pathnames
106
+	 * @param DNProject
107
+	 * @param bool $dryRun
108
+	 */
109
+	protected function syncEnvironmentPaths($paths, $project, $dryRun = false)
110
+	{
111
+		$list = $project->Environments();
112
+
113
+		// Normalise paths in DB
114
+		foreach ($list as $item) {
115
+			$real = realpath($item->Filename);
116
+			if ($real && $real != $item->Filename) {
117
+				$item->Filename = $real;
118
+				$item->write();
119
+			}
120
+		}
121
+
122
+		foreach ($paths as $path) {
123
+			$path = basename($path);
124
+			if ($list->filter('Filename', $path)->count()) {
125
+				continue;
126
+			}
127
+
128
+			$this->message('Adding "' . basename($path) . '" to db');
129
+			if (!$dryRun) {
130
+				$environment = DNEnvironment::create_from_path($path);
131
+				$environment->ProjectID = $project->ID;
132
+				$environment->write();
133
+			}
134
+		}
135
+	}
136
+
137
+	/**
138
+	 * Sync the in-db project list with a list of file paths
139
+	 *
140
+	 * @param array $paths Array of pathnames
141
+	 * @param boolean $dryRun
142
+	 */
143
+	public function syncProjectPaths($paths, $dryRun = false)
144
+	{
145
+		foreach ($paths as $path) {
146
+			if (!DNProject::get()->filter('Name', $path)->count()) {
147
+				$this->message($path);
148
+				if (!$dryRun) {
149
+					DNProject::create_from_path($path)->write();
150
+				}
151
+			}
152
+		}
153
+	}
154
+
155
+	/**
156
+	 * @param string $text
157
+	 */
158
+	protected function message($text)
159
+	{
160
+		if (PHP_SAPI !== 'cli') {
161
+			$text = '<p>' . $text . '</p>' . PHP_EOL;
162
+		}
163
+		echo ' - ' . $text . PHP_EOL;
164
+	}
165
+
166
+	/**
167
+	 * @param string $text
168
+	 */
169
+	protected function echoHeader($text)
170
+	{
171
+		if (PHP_SAPI !== 'cli') {
172
+			echo '<h2>' . $text . '</h2>' . PHP_EOL;
173
+		} else {
174
+			echo '# ' . $text . PHP_EOL;
175
+		}
176
+	}
177 177
 }
Please login to merge, or discard this patch.
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -11,15 +11,15 @@  discard block
 block discarded – undo
11 11
         $remove = true;
12 12
         $dryRun = true;
13 13
 
14
-        if ($request && $request->requestVar('remove') !== null) {
14
+        if($request && $request->requestVar('remove') !== null) {
15 15
             $remove = (bool)$request->requestVar('remove');
16 16
         }
17 17
 
18
-        if ($request && $request->requestVar('dryrun') !== null) {
18
+        if($request && $request->requestVar('dryrun') !== null) {
19 19
             $dryRun = (bool)$request->requestVar('dryrun');
20 20
         }
21 21
 
22
-        if ($dryRun) {
22
+        if($dryRun) {
23 23
             echo "Running in dry run mode, no changes commited, ";
24 24
             echo "the output shows a prediction on what will happen." . PHP_EOL;
25 25
             echo "To skip dryrun, run the task like this:" . PHP_EOL;
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 
33 33
         // Sync projects
34 34
         $projects = DNProject::get();
35
-        if ($remove) {
35
+        if($remove) {
36 36
             $this->echoHeader('Removing obsolete projects');
37 37
             $this->removeObsoleteProjects($projectPaths, $dryRun);
38 38
         }
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
         $this->syncProjectPaths($projectPaths, $dryRun);
41 41
 
42 42
         $this->echoHeader('Syncing environment files');
43
-        foreach ($projects as $project) {
43
+        foreach($projects as $project) {
44 44
             $this->echoHeader($project->Name);
45 45
             // Sync environments for each project
46 46
             $environmentPaths = $data->getEnvironmentPaths($project->Name);
@@ -60,18 +60,18 @@  discard block
 block discarded – undo
60 60
     {
61 61
         $list = $project->Environments();
62 62
 
63
-        $basePaths = array_map(function ($path) {
63
+        $basePaths = array_map(function($path) {
64 64
             return basename($path);
65 65
         }, $paths);
66 66
 
67 67
         $removeList = $list->filter('Filename:not', $basePaths);
68
-        if ($removeList->count() === 0) {
68
+        if($removeList->count() === 0) {
69 69
             return;
70 70
         }
71 71
 
72
-        foreach ($removeList as $remove) {
72
+        foreach($removeList as $remove) {
73 73
             $this->message('Removing "' . basename($remove->Name) . '" from db');
74
-            if (!$dryRun) {
74
+            if(!$dryRun) {
75 75
                 $removeList->remove($remove);
76 76
             }
77 77
         }
@@ -87,13 +87,13 @@  discard block
 block discarded – undo
87 87
     protected function removeObsoleteProjects($paths, $dryrun = false)
88 88
     {
89 89
         $removeList = DNProject::get()->filter('Name:not', $paths);
90
-        if ($removeList->count() == 0) {
90
+        if($removeList->count() == 0) {
91 91
             return;
92 92
         }
93 93
 
94
-        foreach ($removeList as $remove) {
94
+        foreach($removeList as $remove) {
95 95
             $this->message($remove->Name . ' ' . $remove->Path);
96
-            if (!$dryrun) {
96
+            if(!$dryrun) {
97 97
                 $removeList->remove($remove);
98 98
             }
99 99
         }
@@ -111,22 +111,22 @@  discard block
 block discarded – undo
111 111
         $list = $project->Environments();
112 112
 
113 113
         // Normalise paths in DB
114
-        foreach ($list as $item) {
114
+        foreach($list as $item) {
115 115
             $real = realpath($item->Filename);
116
-            if ($real && $real != $item->Filename) {
116
+            if($real && $real != $item->Filename) {
117 117
                 $item->Filename = $real;
118 118
                 $item->write();
119 119
             }
120 120
         }
121 121
 
122
-        foreach ($paths as $path) {
122
+        foreach($paths as $path) {
123 123
             $path = basename($path);
124
-            if ($list->filter('Filename', $path)->count()) {
124
+            if($list->filter('Filename', $path)->count()) {
125 125
                 continue;
126 126
             }
127 127
 
128 128
             $this->message('Adding "' . basename($path) . '" to db');
129
-            if (!$dryRun) {
129
+            if(!$dryRun) {
130 130
                 $environment = DNEnvironment::create_from_path($path);
131 131
                 $environment->ProjectID = $project->ID;
132 132
                 $environment->write();
@@ -142,10 +142,10 @@  discard block
 block discarded – undo
142 142
      */
143 143
     public function syncProjectPaths($paths, $dryRun = false)
144 144
     {
145
-        foreach ($paths as $path) {
146
-            if (!DNProject::get()->filter('Name', $path)->count()) {
145
+        foreach($paths as $path) {
146
+            if(!DNProject::get()->filter('Name', $path)->count()) {
147 147
                 $this->message($path);
148
-                if (!$dryRun) {
148
+                if(!$dryRun) {
149 149
                     DNProject::create_from_path($path)->write();
150 150
                 }
151 151
             }
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
      */
158 158
     protected function message($text)
159 159
     {
160
-        if (PHP_SAPI !== 'cli') {
160
+        if(PHP_SAPI !== 'cli') {
161 161
             $text = '<p>' . $text . '</p>' . PHP_EOL;
162 162
         }
163 163
         echo ' - ' . $text . PHP_EOL;
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
      */
169 169
     protected function echoHeader($text)
170 170
     {
171
-        if (PHP_SAPI !== 'cli') {
171
+        if(PHP_SAPI !== 'cli') {
172 172
             echo '<h2>' . $text . '</h2>' . PHP_EOL;
173 173
         } else {
174 174
             echo '# ' . $text . PHP_EOL;
Please login to merge, or discard this patch.
Braces   +8 added lines, -16 removed lines patch added patch discarded remove patch
@@ -1,12 +1,10 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-class SyncProjectsAndEnvironments extends BuildTask
4
-{
3
+class SyncProjectsAndEnvironments extends BuildTask {
5 4
     /**
6 5
      * @param SS_HTTPRequest|null $request
7 6
      */
8
-    public function run($request = null)
9
-    {
7
+    public function run($request = null) {
10 8
         // should syncing remove obsolete records?
11 9
         $remove = true;
12 10
         $dryRun = true;
@@ -56,8 +54,7 @@  discard block
 block discarded – undo
56 54
      * @param DNProject
57 55
      * @param bool $dryRun
58 56
      */
59
-    protected function removeObsoleteEnvironments($paths, $project, $dryRun = false)
60
-    {
57
+    protected function removeObsoleteEnvironments($paths, $project, $dryRun = false) {
61 58
         $list = $project->Environments();
62 59
 
63 60
         $basePaths = array_map(function ($path) {
@@ -84,8 +81,7 @@  discard block
 block discarded – undo
84 81
      *
85 82
      * @param array $paths
86 83
      */
87
-    protected function removeObsoleteProjects($paths, $dryrun = false)
88
-    {
84
+    protected function removeObsoleteProjects($paths, $dryrun = false) {
89 85
         $removeList = DNProject::get()->filter('Name:not', $paths);
90 86
         if ($removeList->count() == 0) {
91 87
             return;
@@ -106,8 +102,7 @@  discard block
 block discarded – undo
106 102
      * @param DNProject
107 103
      * @param bool $dryRun
108 104
      */
109
-    protected function syncEnvironmentPaths($paths, $project, $dryRun = false)
110
-    {
105
+    protected function syncEnvironmentPaths($paths, $project, $dryRun = false) {
111 106
         $list = $project->Environments();
112 107
 
113 108
         // Normalise paths in DB
@@ -140,8 +135,7 @@  discard block
 block discarded – undo
140 135
      * @param array $paths Array of pathnames
141 136
      * @param boolean $dryRun
142 137
      */
143
-    public function syncProjectPaths($paths, $dryRun = false)
144
-    {
138
+    public function syncProjectPaths($paths, $dryRun = false) {
145 139
         foreach ($paths as $path) {
146 140
             if (!DNProject::get()->filter('Name', $path)->count()) {
147 141
                 $this->message($path);
@@ -155,8 +149,7 @@  discard block
 block discarded – undo
155 149
     /**
156 150
      * @param string $text
157 151
      */
158
-    protected function message($text)
159
-    {
152
+    protected function message($text) {
160 153
         if (PHP_SAPI !== 'cli') {
161 154
             $text = '<p>' . $text . '</p>' . PHP_EOL;
162 155
         }
@@ -166,8 +159,7 @@  discard block
 block discarded – undo
166 159
     /**
167 160
      * @param string $text
168 161
      */
169
-    protected function echoHeader($text)
170
-    {
162
+    protected function echoHeader($text) {
171 163
         if (PHP_SAPI !== 'cli') {
172 164
             echo '<h2>' . $text . '</h2>' . PHP_EOL;
173 165
         } else {
Please login to merge, or discard this patch.