| @@ -55,7 +55,7 @@ discard block | ||
| 55 | 55 | * | 
| 56 | 56 | * @param \SS_HTTPRequest $request | 
| 57 | 57 | * | 
| 58 | - * @return \HTMLText|\SS_HTTPResponse | |
| 58 | + * @return SS_HTTPResponse|null | |
| 59 | 59 | */ | 
| 60 | 60 |  	public function index(\SS_HTTPRequest $request) { | 
| 61 | 61 | return $this->redirect(\Controller::join_links($this->Link(), 'history'), 302); | 
| @@ -174,7 +174,7 @@ discard block | ||
| 174 | 174 | * | 
| 175 | 175 | * @param SS_HTTPRequest $request | 
| 176 | 176 | * | 
| 177 | - * @return string | |
| 177 | + * @return SS_HTTPResponse|null | |
| 178 | 178 | * @throws SS_HTTPResponse_Exception | 
| 179 | 179 | */ | 
| 180 | 180 |  	public function log(SS_HTTPRequest $request) { | 
| @@ -68,21 +68,21 @@ discard block | ||
| 68 | 68 | $data = []; | 
| 69 | 69 | $list = $this->DeployHistory(); | 
| 70 | 70 |  		$page = $request->getVar('page') ?: 1; | 
| 71 | -		if ($page > $list->TotalPages()) { | |
| 71 | +		if($page > $list->TotalPages()) { | |
| 72 | 72 | $page = 1; | 
| 73 | 73 | } | 
| 74 | -		if ($page < 1) { | |
| 74 | +		if($page < 1) { | |
| 75 | 75 | $page = 1; | 
| 76 | 76 | } | 
| 77 | 77 | $start = ($page - 1) * $list->getPageLength(); | 
| 78 | - $list->setPageStart((int) $start); | |
| 79 | -		if (empty($list)) { | |
| 78 | + $list->setPageStart((int)$start); | |
| 79 | +		if(empty($list)) { | |
| 80 | 80 | return $this->getAPIResponse(['list' => []], 200); | 
| 81 | 81 | } | 
| 82 | 82 | |
| 83 | 83 | $currentBuild = $this->environment->CurrentBuild(); | 
| 84 | 84 | |
| 85 | -		foreach ($list as $deployment) { | |
| 85 | +		foreach($list as $deployment) { | |
| 86 | 86 | $data[] = [ | 
| 87 | 87 | 'DeploymentID' => $deployment->ID, | 
| 88 | 88 | 'CreatedDate' => $deployment->Created, | 
| @@ -112,7 +112,7 @@ discard block | ||
| 112 | 112 | */ | 
| 113 | 113 |  	public function currentbuild(SS_HTTPRequest $request) { | 
| 114 | 114 | $currentBuild = $this->environment->CurrentBuild(); | 
| 115 | -		if (!$currentBuild) { | |
| 115 | +		if(!$currentBuild) { | |
| 116 | 116 | return $this->getAPIResponse(['build' => []], 200); | 
| 117 | 117 | } | 
| 118 | 118 | |
| @@ -101,7 +101,7 @@ discard block | ||
| 101 | 101 | } | 
| 102 | 102 | |
| 103 | 103 |  	public function LogLink() { | 
| 104 | - return $this->Link() . '/log'; | |
| 104 | + return $this->Link().'/log'; | |
| 105 | 105 | } | 
| 106 | 106 | |
| 107 | 107 |  	public function canView($member = null) { | 
| @@ -177,18 +177,18 @@ discard block | ||
| 177 | 177 | */ | 
| 178 | 178 |  	public function getCommitURL() { | 
| 179 | 179 | $environment = $this->Environment(); | 
| 180 | -		if (!$environment) { | |
| 180 | +		if(!$environment) { | |
| 181 | 181 | return null; | 
| 182 | 182 | } | 
| 183 | 183 | $project = $environment->Project(); | 
| 184 | -		if (!$project) { | |
| 184 | +		if(!$project) { | |
| 185 | 185 | return null; | 
| 186 | 186 | } | 
| 187 | 187 | $interface = $project->getRepositoryInterface(); | 
| 188 | -		if (!$interface) { | |
| 188 | +		if(!$interface) { | |
| 189 | 189 | return null; | 
| 190 | 190 | } | 
| 191 | - return $interface->CommitURL . '/' . $this->SHA; | |
| 191 | + return $interface->CommitURL.'/'.$this->SHA; | |
| 192 | 192 | } | 
| 193 | 193 | |
| 194 | 194 | /** | 
| @@ -237,12 +237,12 @@ discard block | ||
| 237 | 237 | */ | 
| 238 | 238 |  	public function getFullDeployMessages() { | 
| 239 | 239 | $strategy = $this->getDeploymentStrategy(); | 
| 240 | - if ($strategy->getActionCode()!=='full') return null; | |
| 240 | + if($strategy->getActionCode() !== 'full') return null; | |
| 241 | 241 | |
| 242 | 242 | $changes = $strategy->getChangesModificationNeeded(); | 
| 243 | 243 | $messages = []; | 
| 244 | -		foreach ($changes as $change => $details) { | |
| 245 | - if ($change==='Code version') continue; | |
| 244 | +		foreach($changes as $change => $details) { | |
| 245 | + if($change === 'Code version') continue; | |
| 246 | 246 | |
| 247 | 247 | $messages[] = [ | 
| 248 | 248 | 'Flag' => sprintf( | 
| @@ -253,7 +253,7 @@ discard block | ||
| 253 | 253 | ]; | 
| 254 | 254 | } | 
| 255 | 255 | |
| 256 | -		if (empty($messages)) { | |
| 256 | +		if(empty($messages)) { | |
| 257 | 257 | $messages[] = [ | 
| 258 | 258 | 'Flag' => '', | 
| 259 | 259 | 'Text' => '<i>Environment changes have been made.</i>' | 
| @@ -302,7 +302,7 @@ discard block | ||
| 302 | 302 | |
| 303 | 303 | // if there is a compare URL, and a description or a change (something actually changed) | 
| 304 | 304 | // then show the URL. Otherwise don't show anything, as there is no comparison to be made. | 
| 305 | -			if ($changed || $description) { | |
| 305 | +			if($changed || $description) { | |
| 306 | 306 | $compareUrl = isset($change['compareUrl']) ? $change['compareUrl'] : ''; | 
| 307 | 307 | } | 
| 308 | 308 | |
| @@ -366,7 +366,7 @@ discard block | ||
| 366 | 366 | |
| 367 | 367 |  	public function getSigFile() { | 
| 368 | 368 | $dir = DNData::inst()->getSignalDir(); | 
| 369 | -		if (!is_dir($dir)) { | |
| 369 | +		if(!is_dir($dir)) { | |
| 370 | 370 | `mkdir $dir`; | 
| 371 | 371 | } | 
| 372 | 372 | return sprintf( |