Passed
Push — 1.4 ( af8914...532078 )
by
unknown
19:49 queued 12:29
created
code/search/CwpSearchPage.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 	private static $hide_ancestor = 'CwpSearchPage';
9 9
 	
10 10
 	public function canViewStage($stage = 'Live', $member = null) {
11
-		if(Permission::checkMember($member, 'VIEW_DRAFT_CONTENT')) {
11
+		if (Permission::checkMember($member, 'VIEW_DRAFT_CONTENT')) {
12 12
 			return true;
13 13
 		}
14 14
 		
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 	}
38 38
 	
39 39
 	public function __construct($dataRecord = null) {
40
-		if(!$dataRecord) {
40
+		if (!$dataRecord) {
41 41
 			$dataRecord = $this->generateSearchRecord();
42 42
 		}
43 43
 		parent::__construct($dataRecord);
Please login to merge, or discard this patch.
code/search/CwpSearchEngine.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 	 */
59 59
 	protected function getSearchOptions($spellcheck) {
60 60
 		$options = $this->config()->search_options;
61
-		if($spellcheck) {
61
+		if ($spellcheck) {
62 62
 			$options = array_merge($options, $this->config()->spellcheck_options);
63 63
 		}
64 64
 		return $options;
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
 	 * @return CwpSearchResult|null
104 104
 	 */
105 105
 	public function search($keywords, $classes, $searchIndex, $limit = -1, $start = 0, $followSuggestions = false) {
106
-		if(empty($keywords)) {
106
+		if (empty($keywords)) {
107 107
 			return null;
108 108
 		}
109 109
 
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
 			$result = $this->getResult($keywords, $classes, $searchIndex, $limit, $start, true);
113 113
 			
114 114
 			// Return results if we don't need to refine this any further
115
-			if(!$followSuggestions || $result->hasResults() || !$result->getSuggestion()) {
115
+			if (!$followSuggestions || $result->hasResults() || !$result->getSuggestion()) {
116 116
 				return $result;
117 117
 			}
118 118
 			
@@ -122,13 +122,13 @@  discard block
 block discarded – undo
122 122
 			$newResult->setOriginal($keywords);
123 123
 
124 124
 			// Compare new results to the original query
125
-			if($newResult->hasResults()) {
125
+			if ($newResult->hasResults()) {
126 126
 				return $newResult;
127 127
 			} else {
128 128
 				return $result;
129 129
 			}
130 130
 
131
-		} catch(Exception $e) {
131
+		} catch (Exception $e) {
132 132
 			SS_Log::log($e, SS_Log::WARN);
133 133
 		}
134 134
 		
Please login to merge, or discard this patch.
code/pagetypes/DatedUpdateHolder.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -86,8 +86,8 @@  discard block
 block discarded – undo
86 86
 
87 87
 		// Filter down to single month.
88 88
 		if (isset($year) && isset($monthNumber)) {
89
-			$year = (int)$year;
90
-			$monthNumber = (int)$monthNumber;
89
+			$year = (int) $year;
90
+			$monthNumber = (int) $monthNumber;
91 91
 
92 92
 			$beginDate = sprintf("%d-%d-01 00:00:00", $year, $monthNumber);
93 93
 			$endDate = date('Y-m-d H:i:s', strtotime("{$beginDate} +1 month"));
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
 			// Check if the currently processed month is the one that is selected via GET params.
160 160
 			$active = false;
161 161
 			if (isset($year) && isset($monthNumber)) {
162
-				$active = (((int)$currentYear)==$year && ((int)$currentMonthNumber)==$monthNumber);
162
+				$active = (((int) $currentYear) == $year && ((int) $currentMonthNumber) == $monthNumber);
163 163
 			}
164 164
 
165 165
 			// Build the link - keep the tag and date filter, but reset the pagination.
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
 	public function getMetaTitle() {
239 239
 		$title = $this->data()->getTitle();
240 240
 		$filter = $this->FilterDescription();
241
-		if($filter) {
241
+		if ($filter) {
242 242
 			$title = "{$title} - {$filter}";
243 243
 		}
244 244
 
@@ -309,13 +309,13 @@  discard block
 block discarded – undo
309 309
 		$year = $this->request->getVar('year');
310 310
 		$month = $this->request->getVar('month');
311 311
 
312
-		if ($tag=='') $tag = null;
313
-		if ($from=='') $from = null;
314
-		if ($to=='') $to = null;
315
-		if ($year=='') $year = null;
316
-		if ($month=='') $month = null;
312
+		if ($tag == '') $tag = null;
313
+		if ($from == '') $from = null;
314
+		if ($to == '') $to = null;
315
+		if ($year == '') $year = null;
316
+		if ($month == '') $month = null;
317 317
 
318
-		if (isset($tag)) $tag = (int)$tag;
318
+		if (isset($tag)) $tag = (int) $tag;
319 319
 		if (isset($from)) {
320 320
 			$from = urldecode($from);
321 321
 			$parser = new SS_Datetime;
@@ -328,8 +328,8 @@  discard block
 block discarded – undo
328 328
 			$parser->setValue($to);
329 329
 			$to = $parser->Format('Y-m-d');
330 330
 		}
331
-		if (isset($year)) $year = (int)$year;
332
-		if (isset($month)) $month = (int)$month;
331
+		if (isset($year)) $year = (int) $year;
332
+		if (isset($month)) $month = (int) $month;
333 333
 
334 334
 		// If only "To" has been provided filter by single date. Normalise by swapping with "From".
335 335
 		if (isset($to) && !isset($from)) {
@@ -337,13 +337,13 @@  discard block
 block discarded – undo
337 337
 		}
338 338
 
339 339
 		// Flip the dates if the order is wrong.
340
-		if (isset($to) && isset($from) && strtotime($from)>strtotime($to)) {
340
+		if (isset($to) && isset($from) && strtotime($from) > strtotime($to)) {
341 341
 			list($to, $from) = array($from, $to);
342 342
 
343 343
 			if ($produceErrorMessages) {
344 344
 				Session::setFormMessage(
345 345
 					'Form_DateRangeForm',
346
-					_t('DateUpdateHolder.FilterAppliedMessage','Filter has been applied with the dates reversed.'),
346
+					_t('DateUpdateHolder.FilterAppliedMessage', 'Filter has been applied with the dates reversed.'),
347 347
 					'warning'
348 348
 				);
349 349
 			}
@@ -354,7 +354,7 @@  discard block
 block discarded – undo
354 354
 			if ($produceErrorMessages) {
355 355
 				Session::setFormMessage(
356 356
 					'Form_DateRangeForm',
357
-					_t('DateUpdateHolder.DateRangeFilterMessage','Filtered by a single date.'),
357
+					_t('DateUpdateHolder.DateRangeFilterMessage', 'Filtered by a single date.'),
358 358
 					'warning'
359 359
 				);
360 360
 			}
@@ -410,7 +410,7 @@  discard block
 block discarded – undo
410 410
 		$tagID = $this->request->getVar('tag');
411 411
 
412 412
 		if (isset($tagID)) {
413
-			return TaxonomyTerm::get_by_id('TaxonomyTerm', (int)$tagID);
413
+			return TaxonomyTerm::get_by_id('TaxonomyTerm', (int) $tagID);
414 414
 		}
415 415
 	}
416 416
 
Please login to merge, or discard this patch.
code/extensions/CustomSiteConfig.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -32,11 +32,11 @@  discard block
 block discarded – undo
32 32
 			'Root.Main', 
33 33
 			$gaCode = TextField::create(
34 34
 				'GACode', 
35
-				_t('CwpConfig.GaField','Google Analytics account')
35
+				_t('CwpConfig.GaField', 'Google Analytics account')
36 36
 			)
37 37
 		);
38 38
 		$gaCode->setRightTitle(
39
-			_t('CwpConfig.GaFieldDesc','Account number to be used all across the site (in the format <strong>UA-XXXXX-X</strong>)')
39
+			_t('CwpConfig.GaFieldDesc', 'Account number to be used all across the site (in the format <strong>UA-XXXXX-X</strong>)')
40 40
 		);
41 41
 
42 42
 		$fields->findOrMakeTab(
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 			'Root.SocialMedia', 
49 49
 			$facebookURL = TextField::create(
50 50
 				'FacebookURL', 
51
-				_t('CwpConfig.FbField','Facebook UID or username')
51
+				_t('CwpConfig.FbField', 'Facebook UID or username')
52 52
 			)
53 53
 		);
54 54
 		$facebookURL->setRightTitle(
@@ -62,22 +62,22 @@  discard block
 block discarded – undo
62 62
 			'Root.SocialMedia', 
63 63
 			$twitterUsername = TextField::create(
64 64
 				'TwitterUsername', 
65
-				_t('CwpConfig.TwitterField','Twitter username')
65
+				_t('CwpConfig.TwitterField', 'Twitter username')
66 66
 			)
67 67
 		);
68 68
 		$twitterUsername->setRightTitle(
69
-			_t('CwpConfig.TwitterFieldDesc','Twitter username (eg, http://twitter.com/<strong>username</strong>)')
69
+			_t('CwpConfig.TwitterFieldDesc', 'Twitter username (eg, http://twitter.com/<strong>username</strong>)')
70 70
 		);
71 71
 
72 72
 		$fields->addFieldToTab(
73 73
 			'Root.SocialMedia', 
74 74
 			$addThisID = TextField::create(
75 75
 				'AddThisProfileID', 
76
-				_t('CwpConfig.AddThisField','AddThis Profile ID')
76
+				_t('CwpConfig.AddThisField', 'AddThis Profile ID')
77 77
 			)
78 78
 		);
79 79
 		$addThisID->setRightTitle(
80
-			_t('CwpConfig.AddThisFieldDesc','Profile ID to be used all across the site (in the format <strong>ra-XXXXXXXXXXXXXXXX</strong>)')
80
+			_t('CwpConfig.AddThisFieldDesc', 'Profile ID to be used all across the site (in the format <strong>ra-XXXXXXXXXXXXXXXX</strong>)')
81 81
 		);
82 82
 
83 83
 		$fields->findOrMakeTab(
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
 			'Root.LogosIcons',
90 90
 			 $logoField = UploadField::create(
91 91
 			 	'Logo', 
92
-			 	_t('CwpConfig.LogoUploadField','Logo, to appear in the top left')
92
+			 	_t('CwpConfig.LogoUploadField', 'Logo, to appear in the top left')
93 93
 			 )
94 94
 		);
95 95
 		$logoField->getValidator()->setAllowedExtensions(array('jpg', 'jpeg', 'png', 'gif'));
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
 			'Root.LogosIcons',
113 113
 			 $footerLogoField = UploadField::create(
114 114
 			 	'FooterLogo', 
115
-			 	_t('CwpConfig.FooterLogoField','Footer logo, to appear in the footer')
115
+			 	_t('CwpConfig.FooterLogoField', 'Footer logo, to appear in the footer')
116 116
 			 )
117 117
 		);
118 118
 		$footerLogoField->getValidator()->setAllowedExtensions(array('jpg', 'jpeg', 'png', 'gif'));
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
 			'Root.LogosIcons',
123 123
 			 $footerLogoRetinaField = UploadField::create(
124 124
 			 	'FooterLogoRetina', 
125
-			 	_t('CwpConfig.FooterLogoRetinaField','High resolution footer logo (recommended twice the height and width of the standard footer logo)')
125
+			 	_t('CwpConfig.FooterLogoRetinaField', 'High resolution footer logo (recommended twice the height and width of the standard footer logo)')
126 126
 			 )
127 127
 		);
128 128
 		$footerLogoRetinaField->getValidator()->setAllowedExtensions(array('jpg', 'jpeg', 'png', 'gif'));
@@ -132,18 +132,18 @@  discard block
 block discarded – undo
132 132
 			'Root.LogosIcons',
133 133
 			 $footerLink = TextField::create(
134 134
 			 	'FooterLogoLink', 
135
-			 	_t('CwpConfig.FooterLogoLinkField','Footer Logo link')
135
+			 	_t('CwpConfig.FooterLogoLinkField', 'Footer Logo link')
136 136
 			 )
137 137
 		);
138 138
 		$footerLink->setRightTitle(
139
-			_t('CwpConfig.FooterLogoLinkDesc','Please include the protocol (ie, http:// or https://) unless it is an internal link.')
139
+			_t('CwpConfig.FooterLogoLinkDesc', 'Please include the protocol (ie, http:// or https://) unless it is an internal link.')
140 140
 		);
141 141
 
142 142
 		$fields->addFieldToTab(
143 143
 			'Root.LogosIcons',
144 144
 			 TextField::create(
145 145
 			 	'FooterLogoDescription', 
146
-			 	_t('CwpConfig.FooterLogoDescField','Footer Logo description')
146
+			 	_t('CwpConfig.FooterLogoDescField', 'Footer Logo description')
147 147
 			 )
148 148
 		);
149 149
 
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
 			'Root.LogosIcons',
152 152
 			 $favIconField = UploadField::create(
153 153
 			 	'FavIcon', 
154
-			 	_t('CwpConfig.FavIconField','Favicon, in .ico format, dimensions of 16x16, 32x32, or 48x48')
154
+			 	_t('CwpConfig.FavIconField', 'Favicon, in .ico format, dimensions of 16x16, 32x32, or 48x48')
155 155
 			 )
156 156
 		);
157 157
 		$favIconField->getValidator()->setAllowedExtensions(array('ico'));
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
 			'Root.LogosIcons',
162 162
 			 $atIcon144 = UploadField::create(
163 163
 			 	'AppleTouchIcon144', 
164
-			 	_t('CwpConfig.AppleIconField144','Apple Touch Web Clip and Windows 8 Tile Icon (dimensions of 144x144, PNG format)')
164
+			 	_t('CwpConfig.AppleIconField144', 'Apple Touch Web Clip and Windows 8 Tile Icon (dimensions of 144x144, PNG format)')
165 165
 			 )
166 166
 		);
167 167
 		$atIcon144->getValidator()->setAllowedExtensions(array('png'));
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
 			'Root.LogosIcons',
172 172
 			 $atIcon114 = UploadField::create(
173 173
 			 	'AppleTouchIcon114', 
174
-			 	_t('CwpConfig.AppleIconField114','Apple Touch Web Clip Icon (dimensions of 114x114, PNG format)')
174
+			 	_t('CwpConfig.AppleIconField114', 'Apple Touch Web Clip Icon (dimensions of 114x114, PNG format)')
175 175
 			 )
176 176
 		);
177 177
 		$atIcon114->getValidator()->setAllowedExtensions(array('png'));
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
 			'Root.LogosIcons',
182 182
 			 $atIcon72 = UploadField::create(
183 183
 			 	'AppleTouchIcon72', 
184
-			 	_t('CwpConfig.AppleIconField72','Apple Touch Web Clip Icon (dimensions of 72x72, PNG format)')
184
+			 	_t('CwpConfig.AppleIconField72', 'Apple Touch Web Clip Icon (dimensions of 72x72, PNG format)')
185 185
 			 )
186 186
 		);
187 187
 		$atIcon72->getValidator()->setAllowedExtensions(array('png'));
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
 			'Root.LogosIcons',
192 192
 			 $atIcon57 = UploadField::create(
193 193
 			 	'AppleTouchIcon57', 
194
-			 	_t('CwpConfig.AppleIconField57','Apple Touch Web Clip Icon (dimensions of 57x57, PNG format)')
194
+			 	_t('CwpConfig.AppleIconField57', 'Apple Touch Web Clip Icon (dimensions of 57x57, PNG format)')
195 195
 			 )
196 196
 		);
197 197
 		$atIcon57->getValidator()->setAllowedExtensions(array('png'));
Please login to merge, or discard this patch.
code/extensions/CwpCommentingExtension.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -10,22 +10,22 @@
 block discarded – undo
10 10
 		$fields = $form->Fields();
11 11
 
12 12
 		// Set field names and descriptions
13
-		if($nameField = $fields->dataFieldByName('Name')) {
13
+		if ($nameField = $fields->dataFieldByName('Name')) {
14 14
 			$nameField
15 15
 				->setTitle('Name')
16 16
 				->setDescription('(required)');
17 17
 		}
18 18
 
19
-		if($emailField = $fields->dataFieldByName('Email')) {
19
+		if ($emailField = $fields->dataFieldByName('Email')) {
20 20
 			$emailField
21 21
 				->setTitle('Email')
22 22
 				->setDescription('will not be published (required)');
23 23
 		}
24 24
 
25
-		if($urlField = $fields->dataFieldByName('URL')) {
25
+		if ($urlField = $fields->dataFieldByName('URL')) {
26 26
 			$urlField
27 27
 				->setTitle('Your website (optional)')
28
-				->setAttribute('placeholder','http://');
28
+				->setAttribute('placeholder', 'http://');
29 29
 		}
30 30
 	}
31 31
 }
Please login to merge, or discard this patch.
code/model/CarouselItem.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
 			CompositeField::create(
47 47
 				LabelField::create(
48 48
 					"LabelArchive",
49
-					_t('CwpCarousel.ArchivedField',"Archive this carousel item?")
49
+					_t('CwpCarousel.ArchivedField', "Archive this carousel item?")
50 50
 				)->addExtraClass("left"),
51 51
 				CheckboxField::create('Archived', '')
52 52
 			)->addExtraClass("field special")
@@ -72,12 +72,12 @@  discard block
 block discarded – undo
72 72
 		return $this->Parent()->canView($member);
73 73
 	}
74 74
 
75
-	public function ImageThumb(){
75
+	public function ImageThumb() {
76 76
 	   return $this->Image()->SetWidth(50);
77 77
 	}
78 78
 
79
-	public function ArchivedReadable(){
80
-		if($this->Archived == 1) return _t('GridField.Archived', 'Archived');
79
+	public function ArchivedReadable() {
80
+		if ($this->Archived == 1) return _t('GridField.Archived', 'Archived');
81 81
 		return _t('GridField.Live', 'Live');
82 82
 	}
83 83
 }
Please login to merge, or discard this patch.
code/pagetypes/EventPage.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 
11 11
 	static $icon = 'cwp/images/icons/sitetree_images/event_page.png';
12 12
 
13
-	public $pageIcon =  'images/icons/sitetree_images/event_page.png';
13
+	public $pageIcon = 'images/icons/sitetree_images/event_page.png';
14 14
 
15 15
 	private static $singular_name = 'Event Page';
16 16
 
@@ -35,15 +35,15 @@  discard block
 block discarded – undo
35 35
 	 * Add the default for the Date being the current day.
36 36
 	 */
37 37
 	public function populateDefaults() {
38
-		if(!isset($this->Date) || $this->Date === null) {
38
+		if (!isset($this->Date) || $this->Date === null) {
39 39
 			$this->Date = SS_Datetime::now()->Format('Y-m-d');
40 40
 		}
41 41
 
42
-		if(!isset($this->StartTime) || $this->StartTime === null) {
42
+		if (!isset($this->StartTime) || $this->StartTime === null) {
43 43
 			$this->StartTime = '09:00:00';
44 44
 		}
45 45
 
46
-		if(!isset($this->EndTime) || $this->EndTime === null) {
46
+		if (!isset($this->EndTime) || $this->EndTime === null) {
47 47
 			$this->EndTime = '17:00:00';
48 48
 		}
49 49
 
Please login to merge, or discard this patch.
code/pagetypes/DatedUpdatePage.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 	public function populateDefaults() {
24 24
 		parent::populateDefaults();
25 25
 
26
-		if(!isset($this->Date) || $this->Date === null) {
26
+		if (!isset($this->Date) || $this->Date === null) {
27 27
 			$this->Date = SS_Datetime::now()->Format('Y-m-d 09:00:00');
28 28
 		}
29 29
 	}
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 		);
54 54
 		$abstractField->setAttribute('maxlength', '160');
55 55
 		$abstractField->setRightTitle(
56
-			_t('DateUpdatePage.AbstractDesc','The abstract is used as a summary on the listing pages. It is limited to 160 characters.')
56
+			_t('DateUpdatePage.AbstractDesc', 'The abstract is used as a summary on the listing pages. It is limited to 160 characters.')
57 57
 		);
58 58
 		$abstractField->setRows(6);
59 59
 
Please login to merge, or discard this patch.
code/pagetypes/NewsPage.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@
 block discarded – undo
22 22
 		'FeaturedImage' => 'Image'
23 23
 	);
24 24
 
25
-	public $pageIcon =  'images/icons/sitetree_images/news.png';
25
+	public $pageIcon = 'images/icons/sitetree_images/news.png';
26 26
 
27 27
 	public function fieldLabels($includerelations = true) {
28 28
 		$labels = parent::fieldLabels($includerelations);
Please login to merge, or discard this patch.