| @@ -75,6 +75,7 @@ discard block | ||
| 75 | 75 | } | 
| 76 | 76 | |
| 77 | 77 | /** | 
| 78 | + * @param string $code | |
| 78 | 79 | */ | 
| 79 | 80 |  	public function setActionCode($code) { | 
| 80 | 81 | $this->actionCode = $code; | 
| @@ -89,6 +90,7 @@ discard block | ||
| 89 | 90 | |
| 90 | 91 | /** | 
| 91 | 92 | * @param int | 
| 93 | + * @param string $seconds | |
| 92 | 94 | */ | 
| 93 | 95 |  	public function setEstimatedTime($seconds) { | 
| 94 | 96 | $this->estimatedTime = $seconds; | 
| @@ -110,8 +110,12 @@ | ||
| 110 | 110 | // Normalise "empty" values into dashes so comparisons are done properly. | 
| 111 | 111 | // This means there is no diference between an empty string and a null | 
| 112 | 112 | // but "0" is considered to be non-empty. | 
| 113 | - if(empty($from) && !strlen($from)) $from = '-'; | |
| 114 | - if(empty($to) && !strlen($to)) $to = '-'; | |
| 113 | +		if(empty($from) && !strlen($from)) { | |
| 114 | + $from = '-'; | |
| 115 | + } | |
| 116 | +		if(empty($to) && !strlen($to)) { | |
| 117 | + $to = '-'; | |
| 118 | + } | |
| 115 | 119 | |
| 116 | 120 | return $this->changes[$title] = array( | 
| 117 | 121 | 'from' => $from, | 
| @@ -961,7 +961,7 @@ | ||
| 961 | 961 | * @param array $data | 
| 962 | 962 | * @param Form $form | 
| 963 | 963 | * | 
| 964 | - * @return bool|HTMLText|SS_HTTPResponse | |
| 964 | + * @return SS_HTTPResponse|null | |
| 965 | 965 | */ | 
| 966 | 966 |  	public function doCreateEnvironment($data, Form $form) { | 
| 967 | 967 | $this->setCurrentActionType(self::ACTION_ENVIRONMENTS); | 
| @@ -205,12 +205,16 @@ | ||
| 205 | 205 | */ | 
| 206 | 206 |  	public function getFullDeployMessages() { | 
| 207 | 207 | $strategy = $this->getDeploymentStrategy(); | 
| 208 | - if ($strategy->getActionCode()!=='full') return null; | |
| 208 | +		if ($strategy->getActionCode()!=='full') { | |
| 209 | + return null; | |
| 210 | + } | |
| 209 | 211 | |
| 210 | 212 | $changes = $strategy->getChangesModificationNeeded(); | 
| 211 | 213 | $messages = []; | 
| 212 | 214 |  		foreach ($changes as $change => $details) { | 
| 213 | - if ($change==='Code version') continue; | |
| 215 | +			if ($change==='Code version') { | |
| 216 | + continue; | |
| 217 | + } | |
| 214 | 218 | |
| 215 | 219 | $messages[] = [ | 
| 216 | 220 | 'Flag' => sprintf( | 
| @@ -82,6 +82,9 @@ | ||
| 82 | 82 | 'Deployer.Name' => 'Deployer' | 
| 83 | 83 | ); | 
| 84 | 84 | |
| 85 | + /** | |
| 86 | + * @param false|string $token | |
| 87 | + */ | |
| 85 | 88 |  	public function setResqueToken($token) { | 
| 86 | 89 | $this->ResqueToken = $token; | 
| 87 | 90 | } | 
| @@ -58,7 +58,9 @@ | ||
| 58 | 58 | |
| 59 | 59 |  	protected function addHandlers($machine) { | 
| 60 | 60 | $class = get_class($machine->getObject()); | 
| 61 | - if (empty($this->config()->handlers[$class])) return; | |
| 61 | +		if (empty($this->config()->handlers[$class])) { | |
| 62 | + return; | |
| 63 | + } | |
| 62 | 64 | |
| 63 | 65 | $transitions = $this->config()->handlers[$class]; | 
| 64 | 66 |  		foreach ($transitions as $transName => $handlers) { | 
| @@ -46,7 +46,7 @@ | ||
| 46 | 46 | * | 
| 47 | 47 | * @param \SS_HTTPRequest $request | 
| 48 | 48 | * | 
| 49 | - * @return \HTMLText|\SS_HTTPResponse | |
| 49 | + * @return SS_HTTPResponse|null | |
| 50 | 50 | */ | 
| 51 | 51 |  	public function index(\SS_HTTPRequest $request) { | 
| 52 | 52 | return $this->redirect(\Controller::join_links($this->Link(), 'history'), 302); | 
| @@ -47,7 +47,7 @@ discard block | ||
| 47 | 47 | * | 
| 48 | 48 | * @param \SS_HTTPRequest $request | 
| 49 | 49 | * | 
| 50 | - * @return \HTMLText|\SS_HTTPResponse | |
| 50 | + * @return SS_HTTPResponse|null | |
| 51 | 51 | */ | 
| 52 | 52 |  	public function index(\SS_HTTPRequest $request) { | 
| 53 | 53 | return $this->redirect(\Controller::join_links($this->Link(), 'show'), 302); | 
| @@ -72,7 +72,7 @@ discard block | ||
| 72 | 72 | /** | 
| 73 | 73 | * @param SS_HTTPRequest $request | 
| 74 | 74 | * | 
| 75 | - * @return string | |
| 75 | + * @return SS_HTTPResponse | |
| 76 | 76 | */ | 
| 77 | 77 |  	public function show(\SS_HTTPRequest $request) { | 
| 78 | 78 | |
| @@ -166,7 +166,7 @@ discard block | ||
| 166 | 166 | } | 
| 167 | 167 | |
| 168 | 168 | /** | 
| 169 | - * @param $project | |
| 169 | + * @param DNProject $project | |
| 170 | 170 | * | 
| 171 | 171 | * @return array | 
| 172 | 172 | */ | 
| @@ -182,7 +182,7 @@ discard block | ||
| 182 | 182 | } | 
| 183 | 183 | |
| 184 | 184 | /** | 
| 185 | - * @param $project | |
| 185 | + * @param DNProject $project | |
| 186 | 186 | * | 
| 187 | 187 | * @return array | 
| 188 | 188 | */ | 
| @@ -198,7 +198,7 @@ discard block | ||
| 198 | 198 | } | 
| 199 | 199 | |
| 200 | 200 | /** | 
| 201 | - * @param $project | |
| 201 | + * @param DNProject $project | |
| 202 | 202 | * | 
| 203 | 203 | * @return array | 
| 204 | 204 | */ | 
| @@ -14,7 +14,7 @@ | ||
| 14 | 14 | return array_combine($timezones, $timezones); | 
| 15 | 15 | } | 
| 16 | 16 | |
| 17 | -	public function updateCMSFields(FieldList $fields) {    | |
| 17 | +	public function updateCMSFields(FieldList $fields) { | |
| 18 | 18 |  		$fields->removeFieldFromTab('Root', 'Timezone'); | 
| 19 | 19 | $field = DropdownField::create( | 
| 20 | 20 | 'Timezone', | 
| @@ -9,7 +9,7 @@ | ||
| 9 | 9 | * Returns the date in the raw SQL-format specific to a given timezone passed from the Member class, e.g. “2006-01-18 16:32:04” | 
| 10 | 10 | */ | 
| 11 | 11 |  	public function Format($format) { | 
| 12 | -		if($this->value){ | |
| 12 | +		if($this->value) { | |
| 13 | 13 | $date = new DateTime($this->value); | 
| 14 | 14 | //if the current user has set a timezone that is not the default then use that | 
| 15 | 15 | $member = Member::currentUser(); |