Completed
Pull Request — master (#488)
by Helpful
1295:51 queued 1292:33
created
code/api/nouns/APIEnvironment.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -112,9 +112,9 @@  discard block
 block discarded – undo
112 112
 		$ping->write();
113 113
 		$ping->start();
114 114
 
115
-		$location = Director::absoluteBaseURL() . $this->Link() . '/ping/' . $ping->ID;
115
+		$location = Director::absoluteBaseURL().$this->Link().'/ping/'.$ping->ID;
116 116
 		$output = array(
117
-			'message' => 'Ping queued as job ' . $ping->ResqueToken,
117
+			'message' => 'Ping queued as job '.$ping->ResqueToken,
118 118
 			'href' => $location,
119 119
 		);
120 120
 
@@ -164,9 +164,9 @@  discard block
 block discarded – undo
164 164
 		));
165 165
 		$deploy = $strategy->createDeployment();
166 166
 		$deploy->start();
167
-		$location = Director::absoluteBaseURL() . $this->Link() . '/deploy/' . $deploy->ID;
167
+		$location = Director::absoluteBaseURL().$this->Link().'/deploy/'.$deploy->ID;
168 168
 		$output = array(
169
-			'message' => 'Deploy queued as job ' . $deploy->ResqueToken,
169
+			'message' => 'Deploy queued as job '.$deploy->ResqueToken,
170 170
 			'href' => $location,
171 171
 		);
172 172
 		$response = $this->getAPIResponse($output);
Please login to merge, or discard this patch.
code/api/DeploynautAPI.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
 	 */
106 106
 	protected function project404Response() {
107 107
 		$projectName = Convert::raw2xml($this->getRequest()->latestParam('Project'));
108
-		return new SS_HTTPResponse('Project "' . $projectName . '" not found.', 404);
108
+		return new SS_HTTPResponse('Project "'.$projectName.'" not found.', 404);
109 109
 	}
110 110
 
111 111
 	/**
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
 	 */
114 114
 	protected function environment404Response() {
115 115
 		$envName = Convert::raw2xml($this->getRequest()->latestParam('Environment'));
116
-		return new SS_HTTPResponse('Environment "' . $envName . '" not found.', 404);
116
+		return new SS_HTTPResponse('Environment "'.$envName.'" not found.', 404);
117 117
 	}
118 118
 
119 119
 	/**
Please login to merge, or discard this patch.
code/jobs/DeployJob.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
 	}
17 17
 
18 18
 	public function perform() {
19
-		echo "[-] DeployJob starting" . PHP_EOL;
19
+		echo "[-] DeployJob starting".PHP_EOL;
20 20
 		$log = new DeploynautLogFile($this->args['logfile']);
21 21
 
22 22
 		$deployment = DNDeployment::get()->byID($this->args['deploymentID']);
@@ -50,11 +50,11 @@  discard block
 block discarded – undo
50 50
 				$this->args
51 51
 			);
52 52
 		} catch(Exception $e) {
53
-			echo "[-] DeployJob failed" . PHP_EOL;
53
+			echo "[-] DeployJob failed".PHP_EOL;
54 54
 			throw $e;
55 55
 		}
56 56
 		$this->updateStatus('Finished');
57
-		echo "[-] DeployJob finished" . PHP_EOL;
57
+		echo "[-] DeployJob finished".PHP_EOL;
58 58
 	}
59 59
 
60 60
 	/**
Please login to merge, or discard this patch.
code/jobs/PingJob.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@
 block discarded – undo
31 31
 	 * Do the actual job by calling the appropiate backend
32 32
 	 */
33 33
 	public function perform() {
34
-		echo "[-] PingJob starting" . PHP_EOL;
34
+		echo "[-] PingJob starting".PHP_EOL;
35 35
 		$log = new DeploynautLogFile($this->args['logfile']);
36 36
 
37 37
 		$ping = DNPing::get()->byID($this->args['pingID']);
Please login to merge, or discard this patch.
code/jobs/CreateEnvJob.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 	 *
20 20
 	 */
21 21
 	public function perform() {
22
-		echo "[-] CreateEnvJob starting" . PHP_EOL;
22
+		echo "[-] CreateEnvJob starting".PHP_EOL;
23 23
 		// This is a bit icky, but there is no easy way of capturing a failed deploy by using the PHP Resque
24 24
 		try {
25 25
 			$envCreate = DNCreateEnvironment::get()->byId($this->args['createID']);
@@ -31,11 +31,11 @@  discard block
 block discarded – undo
31 31
 			$envCreate->createEnvironment();
32 32
 
33 33
 		} catch(Exception $e) {
34
-			echo "[-] CreateEnvJob failed" . PHP_EOL;
34
+			echo "[-] CreateEnvJob failed".PHP_EOL;
35 35
 			throw $e;
36 36
 		}
37 37
 		$this->updateStatus('Finished');
38
-		echo "[-] CreateEnvJob finished" . PHP_EOL;
38
+		echo "[-] CreateEnvJob finished".PHP_EOL;
39 39
 	}
40 40
 
41 41
 	/**
Please login to merge, or discard this patch.
code/jobs/DataTransferJob.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 	}
21 21
 
22 22
 	public function perform() {
23
-		echo "[-] DataTransferJob starting" . PHP_EOL;
23
+		echo "[-] DataTransferJob starting".PHP_EOL;
24 24
 		$log = new DeploynautLogFile($this->args['logfile']);
25 25
 		$dataTransfer = DNDataTransfer::get()->byID($this->args['dataTransferID']);
26 26
 		$environment = $dataTransfer->Environment();
@@ -83,12 +83,12 @@  discard block
 block discarded – undo
83 83
 		} catch(RuntimeException $exc) {
84 84
 			$log->write($exc->getMessage());
85 85
 
86
-			echo "[-] DataTransferJob failed" . PHP_EOL;
86
+			echo "[-] DataTransferJob failed".PHP_EOL;
87 87
 			throw $exc;
88 88
 		}
89 89
 
90 90
 		$this->updateStatus('Finished');
91
-		echo "[-] DataTransferJob finished" . PHP_EOL;
91
+		echo "[-] DataTransferJob finished".PHP_EOL;
92 92
 	}
93 93
 
94 94
 	/**
Please login to merge, or discard this patch.
code/control/DNRoot.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -189,8 +189,8 @@  discard block
 block discarded – undo
189 189
 		Requirements::javascript('deploynaut/javascript/material.js');
190 190
 
191 191
 		// Load the buildable dependencies only if not loaded centrally.
192
-		if (!is_dir(BASE_PATH . DIRECTORY_SEPARATOR . 'static')) {
193
-			if (\Director::isDev()) {
192
+		if(!is_dir(BASE_PATH.DIRECTORY_SEPARATOR.'static')) {
193
+			if(\Director::isDev()) {
194 194
 				\Requirements::javascript('deploynaut/static/bundle-debug.js');
195 195
 			} else {
196 196
 				\Requirements::javascript('deploynaut/static/bundle.js');
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
 		}
254 254
 
255 255
 		// Block framework jquery
256
-		Requirements::block(FRAMEWORK_DIR . '/thirdparty/jquery/jquery.js');
256
+		Requirements::block(FRAMEWORK_DIR.'/thirdparty/jquery/jquery.js');
257 257
 
258 258
 		self::include_requirements();
259 259
 	}
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
 	 * @return \SS_HTTPResponse
273 273
 	 */
274 274
 	public function index(SS_HTTPRequest $request) {
275
-		return $this->redirect($this->Link() . 'projects/');
275
+		return $this->redirect($this->Link().'projects/');
276 276
 	}
277 277
 
278 278
 	/**
@@ -432,7 +432,7 @@  discard block
 block discarded – undo
432 432
 		$form->disableSecurityToken();
433 433
 		$form->addExtraClass('fields-wide');
434 434
 		// Tweak the action so it plays well with our fake URL structure.
435
-		$form->setFormAction($project->Link() . '/UploadSnapshotForm');
435
+		$form->setFormAction($project->Link().'/UploadSnapshotForm');
436 436
 
437 437
 		return $form;
438 438
 	}
@@ -482,7 +482,7 @@  discard block
 block discarded – undo
482 482
 		$dataArchive->DataTransfers()->add($dataTransfer);
483 483
 		$form->saveInto($dataArchive);
484 484
 		$dataArchive->write();
485
-		$workingDir = TEMP_FOLDER . DIRECTORY_SEPARATOR . 'deploynaut-transfer-' . $dataTransfer->ID;
485
+		$workingDir = TEMP_FOLDER.DIRECTORY_SEPARATOR.'deploynaut-transfer-'.$dataTransfer->ID;
486 486
 
487 487
 		$cleanupFn = function() use($workingDir, $dataTransfer, $dataArchive) {
488 488
 			$process = new Process(sprintf('rm -rf %s', escapeshellarg($workingDir)));
@@ -582,7 +582,7 @@  discard block
 block discarded – undo
582 582
 		$form->disableSecurityToken();
583 583
 		$form->addExtraClass('fields-wide');
584 584
 		// Tweak the action so it plays well with our fake URL structure.
585
-		$form->setFormAction($project->Link() . '/PostSnapshotForm');
585
+		$form->setFormAction($project->Link().'/PostSnapshotForm');
586 586
 
587 587
 		return $form;
588 588
 	}
@@ -720,7 +720,7 @@  discard block
 block discarded – undo
720 720
 		$branchName = $request->getVar('name');
721 721
 		$branch = $project->DNBranchList()->byName($branchName);
722 722
 		if(!$branch) {
723
-			return new SS_HTTPResponse("Branch '" . Convert::raw2xml($branchName) . "' not found.", 404);
723
+			return new SS_HTTPResponse("Branch '".Convert::raw2xml($branchName)."' not found.", 404);
724 724
 		}
725 725
 
726 726
 		return $this->render(array(
@@ -954,7 +954,7 @@  discard block
 block discarded – undo
954 954
 		);
955 955
 
956 956
 		// Tweak the action so it plays well with our fake URL structure.
957
-		$form->setFormAction($project->Link() . '/CreateEnvironmentForm');
957
+		$form->setFormAction($project->Link().'/CreateEnvironmentForm');
958 958
 
959 959
 		return $form;
960 960
 	}
@@ -987,7 +987,7 @@  discard block
 block discarded – undo
987 987
 		$job->write();
988 988
 		$job->start();
989 989
 
990
-		return $this->redirect($project->Link('createenv') . '/' . $job->ID);
990
+		return $this->redirect($project->Link('createenv').'/'.$job->ID);
991 991
 	}
992 992
 
993 993
 	/**
@@ -1045,7 +1045,7 @@  discard block
 block discarded – undo
1045 1045
 	 */
1046 1046
 	public function getPlatformSpecificStrings() {
1047 1047
 		$strings = $this->config()->platform_specific_strings;
1048
-		if ($strings) {
1048
+		if($strings) {
1049 1049
 			return new ArrayList($strings);
1050 1050
 		}
1051 1051
 	}
@@ -1169,7 +1169,7 @@  discard block
 block discarded – undo
1169 1169
 			return $body;
1170 1170
 		}
1171 1171
 
1172
-		$form->setFormAction($this->getRequest()->getURL() . '/DeployForm');
1172
+		$form->setFormAction($this->getRequest()->getURL().'/DeployForm');
1173 1173
 		return $form;
1174 1174
 	}
1175 1175
 
@@ -1444,7 +1444,7 @@  discard block
 block discarded – undo
1444 1444
 		$deployment->start();
1445 1445
 
1446 1446
 		return json_encode(array(
1447
-			'url' => Director::absoluteBaseURL() . $deployment->Link()
1447
+			'url' => Director::absoluteBaseURL().$deployment->Link()
1448 1448
 		), JSON_PRETTY_PRINT);
1449 1449
 	}
1450 1450
 
@@ -1551,7 +1551,7 @@  discard block
 block discarded – undo
1551 1551
 					->addExtraClass('btn')
1552 1552
 			)
1553 1553
 		);
1554
-		$form->setFormAction($this->getRequest()->getURL() . '/DataTransferForm');
1554
+		$form->setFormAction($this->getRequest()->getURL().'/DataTransferForm');
1555 1555
 
1556 1556
 		return $form;
1557 1557
 	}
@@ -1753,7 +1753,7 @@  discard block
 block discarded – undo
1753 1753
 					->addExtraClass('btn')
1754 1754
 			)
1755 1755
 		);
1756
-		$form->setFormAction($project->Link() . '/DataTransferRestoreForm');
1756
+		$form->setFormAction($project->Link().'/DataTransferRestoreForm');
1757 1757
 
1758 1758
 		return $form;
1759 1759
 	}
@@ -1851,7 +1851,7 @@  discard block
 block discarded – undo
1851 1851
 					->addExtraClass('btn')
1852 1852
 			)
1853 1853
 		);
1854
-		$form->setFormAction($project->Link() . '/DeleteForm');
1854
+		$form->setFormAction($project->Link().'/DeleteForm');
1855 1855
 
1856 1856
 		return $form;
1857 1857
 	}
@@ -1957,7 +1957,7 @@  discard block
 block discarded – undo
1957 1957
 					->addExtraClass('btn')
1958 1958
 			)
1959 1959
 		);
1960
-		$form->setFormAction($this->getCurrentProject()->Link() . '/MoveForm');
1960
+		$form->setFormAction($this->getCurrentProject()->Link().'/MoveForm');
1961 1961
 
1962 1962
 		return $form;
1963 1963
 	}
@@ -2256,7 +2256,7 @@  discard block
 block discarded – undo
2256 2256
 	 */
2257 2257
 	protected function project404Response() {
2258 2258
 		return new SS_HTTPResponse(
2259
-			"Project '" . Convert::raw2xml($this->getRequest()->param('Project')) . "' not found.",
2259
+			"Project '".Convert::raw2xml($this->getRequest()->param('Project'))."' not found.",
2260 2260
 			404
2261 2261
 		);
2262 2262
 	}
@@ -2266,7 +2266,7 @@  discard block
 block discarded – undo
2266 2266
 	 */
2267 2267
 	protected function environment404Response() {
2268 2268
 		$envName = Convert::raw2xml($this->getRequest()->param('Environment'));
2269
-		return new SS_HTTPResponse("Environment '" . $envName . "' not found.", 404);
2269
+		return new SS_HTTPResponse("Environment '".$envName."' not found.", 404);
2270 2270
 	}
2271 2271
 
2272 2272
 	/**
@@ -2333,7 +2333,7 @@  discard block
 block discarded – undo
2333 2333
 	public function AmbientMenu() {
2334 2334
 		$list = new ArrayList();
2335 2335
 
2336
-		if (Member::currentUserID()) {
2336
+		if(Member::currentUserID()) {
2337 2337
 			$list->push(new ArrayData(array(
2338 2338
 				'Classes' => 'logout',
2339 2339
 				'FaIcon' => 'sign-out',
@@ -2438,7 +2438,7 @@  discard block
 block discarded – undo
2438 2438
 			} else {
2439 2439
 				$form->sessionMessage('Unable to write the stack to the database.', 'bad');
2440 2440
 			}
2441
-		} catch (ValidationException $e) {
2441
+		} catch(ValidationException $e) {
2442 2442
 			$form->sessionMessage($e->getMessage(), 'bad');
2443 2443
 		}
2444 2444
 		return $this->redirectBack();
@@ -2513,7 +2513,7 @@  discard block
 block discarded – undo
2513 2513
 			try {
2514 2514
 				$fetch->perform();
2515 2515
 				$canAccessRepo = true;
2516
-			} catch (RuntimeException $e) {
2516
+			} catch(RuntimeException $e) {
2517 2517
 				$canAccessRepo = false;
2518 2518
 			}
2519 2519
 			$data = ['canAccessRepo' => $canAccessRepo];
Please login to merge, or discard this patch.