Passed
Push — 1.7 ( 23cbb7...8df8a8 )
by Greg
08:15
created
admin_users.php 1 patch
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -770,8 +770,11 @@
 block discarded – undo
770 770
 		<p>
771 771
 		<?php if ($ucnt): ?>
772 772
 			<input type="submit" value="<?php echo I18N::translate('delete'); ?>">
773
-			<?php else: ?>
774
-			<?php echo I18N::translate('Nothing found to cleanup'); ?>
773
+			<?php else {
774
+    : ?>
775
+			<?php echo I18N::translate('Nothing found to cleanup');
776
+}
777
+?>
775 778
 			<?php endif; ?>
776 779
 		</p>
777 780
 	</form>
Please login to merge, or discard this patch.
mediafirewall.php 1 patch
Braces   +12 added lines, -6 removed lines patch added patch discarded remove patch
@@ -34,7 +34,8 @@  discard block
 block discarded – undo
34 34
 /**
35 35
  * Send a “Not found” error as an image
36 36
  */
37
-function send404AsImage() {
37
+function send404AsImage()
38
+{
38 39
 	$error = I18N::translate('The media file was not found in this family tree.');
39 40
 
40 41
 	$width  = mb_strlen($error) * 6.5 + 50;
@@ -61,7 +62,8 @@  discard block
 block discarded – undo
61 62
  *
62 63
  * @return resource
63 64
  */
64
-function applyWatermark($im, Tree $tree) {
65
+function applyWatermark($im, Tree $tree)
66
+{
65 67
 	// text to watermark with
66 68
 	$word1_text = $tree->getTitle();
67 69
 	// maximum font size for “word1” ; will be automaticaly reduced to fit in the image
@@ -100,7 +102,8 @@  discard block
 block discarded – undo
100 102
  * @param string   $vpos
101 103
  * @param string   $hpos
102 104
  */
103
-function embedText($im, $text, $maxsize, $color, $font, $vpos, $hpos) {
105
+function embedText($im, $text, $maxsize, $color, $font, $vpos, $hpos)
106
+{
104 107
 	global $useTTF;
105 108
 
106 109
 	// there are two ways to embed text with PHP
@@ -203,7 +206,8 @@  discard block
 block discarded – undo
203 206
  *
204 207
  * @return int
205 208
  */
206
-function textlength($t, $mxl, $text) {
209
+function textlength($t, $mxl, $text)
210
+{
207 211
 	$taille_c = $t;
208 212
 	$len      = mb_strlen($text);
209 213
 	while (($taille_c - 2) * $len > $mxl) {
@@ -225,7 +229,8 @@  discard block
 block discarded – undo
225 229
  *
226 230
  * @return bool
227 231
  */
228
-function imagettftextErrorHandler($errno, $errstr) {
232
+function imagettftextErrorHandler($errno, $errstr)
233
+{
229 234
 	global $useTTF, $serverFilename;
230 235
 	// log the error
231 236
 	Log::addErrorLog('Media Firewall error: >' . $errno . '/' . $errstr . '< while processing file >' . $serverFilename . '<');
@@ -243,7 +248,8 @@  discard block
 block discarded – undo
243 248
  *
244 249
  * @return string|false
245 250
  */
246
-function isImageTypeSupported($reqtype) {
251
+function isImageTypeSupported($reqtype)
252
+{
247 253
 	$supportByGD = array('jpg' => 'jpeg', 'jpeg' => 'jpeg', 'gif' => 'gif', 'png' => 'png');
248 254
 	$reqtype     = strtolower($reqtype);
249 255
 
Please login to merge, or discard this patch.
edit_interface.php 1 patch
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -2236,7 +2236,8 @@  discard block
 block discarded – undo
2236 2236
  *
2237 2237
  * @return string
2238 2238
  */
2239
-function keep_chan(GedcomRecord $record = null) {
2239
+function keep_chan(GedcomRecord $record = null)
2240
+{
2240 2241
 	global $WT_TREE;
2241 2242
 
2242 2243
 	if (Auth::isAdmin()) {
@@ -2271,7 +2272,8 @@  discard block
 block discarded – undo
2271 2272
  * @param string     $famtag
2272 2273
  * @param string     $gender
2273 2274
  */
2274
-function print_indi_form($nextaction, Individual $person = null, Family $family = null, Fact $name_fact = null, $famtag = 'CHIL', $gender = 'U') {
2275
+function print_indi_form($nextaction, Individual $person = null, Family $family = null, Fact $name_fact = null, $famtag = 'CHIL', $gender = 'U')
2276
+{
2275 2277
 	global $WT_TREE, $bdm, $controller;
2276 2278
 
2277 2279
 	if ($person) {
@@ -2737,7 +2739,8 @@  discard block
 block discarded – undo
2737 2739
  *
2738 2740
  * @param GedcomRecord $object
2739 2741
  */
2740
-function check_record_access(GedcomRecord $object = null) {
2742
+function check_record_access(GedcomRecord $object = null)
2743
+{
2741 2744
 	global $controller;
2742 2745
 
2743 2746
 	if (!$object || !$object->canShow() || !$object->canEdit()) {
Please login to merge, or discard this patch.
relationship.php 1 patch
Braces   +10 added lines, -4 removed lines patch added patch discarded remove patch
@@ -103,7 +103,8 @@  discard block
 block discarded – undo
103 103
 					<?php if ($ancestors_only === '1'): ?>
104 104
 						<input type="hidden" name="ancestors" value="1">
105 105
 						<?php echo I18N::translate('Find relationships via ancestors') ?>
106
-					<?php else: ?>
106
+					<?php else {
107
+    : ?>
107 108
 						<label>
108 109
 							<input type="radio" name="ancestors" value="0" <?php echo $ancestors == 0 ? 'checked' : '' ?>>
109 110
 							<?php echo I18N::translate('Find any relationship') ?>
@@ -113,14 +114,17 @@  discard block
 block discarded – undo
113 114
 							<input type="radio" name="ancestors" value="1" <?php echo $ancestors == 1 ? 'checked' : '' ?>>
114 115
 							<?php echo I18N::translate('Find relationships via ancestors') ?>
115 116
 						</label>
116
-					<?php endif; ?>
117
+					<?php endif;
118
+}
119
+?>
117 120
 
118 121
 					<hr>
119 122
 
120 123
 					<?php if ($max_recursion == 0): ?>
121 124
 						<?php echo I18N::translate('Find the closest relationships') ?>
122 125
 						<input type="hidden" name="recursion" value="0">
123
-					<?php else: ?>
126
+					<?php else {
127
+    : ?>
124 128
 						<label>
125 129
 							<input type="radio" name="recursion" value="0" <?php echo $recursion == 0 ? 'checked' : '' ?>>
126 130
 							<?php echo I18N::translate('Find the closest relationships') ?>
@@ -132,7 +136,9 @@  discard block
 block discarded – undo
132 136
 								<?php echo I18N::translate('Find all possible relationships') ?>
133 137
 							<?php else: ?>
134 138
 								<?php echo I18N::translate('Find other relationships') ?>
135
-							<?php endif; ?>
139
+							<?php endif;
140
+}
141
+?>
136 142
 						</label>
137 143
 					<?php endif; ?>
138 144
 				</td>
Please login to merge, or discard this patch.
autocomplete.php 1 patch
Braces   +12 added lines, -6 removed lines patch added patch discarded remove patch
@@ -506,7 +506,8 @@  discard block
 block discarded – undo
506 506
  *
507 507
  * @return \stdClass[]
508 508
  */
509
-function get_FAM_rows(Tree $tree, $term) {
509
+function get_FAM_rows(Tree $tree, $term)
510
+{
510 511
 	return Database::prepare(
511 512
 		"SELECT DISTINCT 'FAM' AS type, f_id AS xref, f_gedcom AS gedcom, husb_name.n_sort, wife_name.n_sort" .
512 513
 		" FROM `##families`" .
@@ -530,7 +531,8 @@  discard block
 block discarded – undo
530 531
  *
531 532
  * @return \stdClass[]
532 533
  */
533
-function get_INDI_rows(Tree $tree, $term) {
534
+function get_INDI_rows(Tree $tree, $term)
535
+{
534 536
 	return Database::prepare(
535 537
 		"SELECT 'INDI' AS type, i_id AS xref, i_gedcom AS gedcom, n_full" .
536 538
 		" FROM `##individuals`" .
@@ -551,7 +553,8 @@  discard block
 block discarded – undo
551 553
  *
552 554
  * @return \stdClass[]
553 555
  */
554
-function get_NOTE_rows(Tree $tree, $term) {
556
+function get_NOTE_rows(Tree $tree, $term)
557
+{
555 558
 	return Database::prepare(
556 559
 		"SELECT o_id AS xref, o_gedcom AS gedcom" .
557 560
 		" FROM `##other`" .
@@ -573,7 +576,8 @@  discard block
 block discarded – undo
573 576
  *
574 577
  * @return \stdClass[]
575 578
  */
576
-function get_OBJE_rows(Tree $tree, $term) {
579
+function get_OBJE_rows(Tree $tree, $term)
580
+{
577 581
 	return Database::prepare(
578 582
 		"SELECT 'OBJE' AS type, m_id AS xref, m_gedcom AS gedcom" .
579 583
 		" FROM `##media`" .
@@ -595,7 +599,8 @@  discard block
 block discarded – undo
595 599
  *
596 600
  * @return \stdClass[]
597 601
  */
598
-function get_REPO_rows(Tree $tree, $term) {
602
+function get_REPO_rows(Tree $tree, $term)
603
+{
599 604
 	return Database::prepare(
600 605
 		"SELECT o_id AS xref, o_gedcom AS gedcom" .
601 606
 		" FROM `##other`" .
@@ -617,7 +622,8 @@  discard block
 block discarded – undo
617 622
  *
618 623
  * @return \stdClass[]
619 624
  */
620
-function get_SOUR_rows(Tree $tree, $term) {
625
+function get_SOUR_rows(Tree $tree, $term)
626
+{
621 627
 	return Database::prepare(
622 628
 		"SELECT s_id AS xref, s_gedcom AS gedcom" .
623 629
 		" FROM `##sources`" .
Please login to merge, or discard this patch.
admin_trees_duplicates.php 1 patch
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -177,8 +177,11 @@
 block discarded – undo
177 177
 	</li>
178 178
 <?php endforeach; ?>
179 179
 </ul>
180
-<?php else: ?>
181
-<p><?php echo I18N::translate('No duplicates have been found.'); ?></p>
180
+<?php else {
181
+    : ?>
182
+<p><?php echo I18N::translate('No duplicates have been found.');
183
+}
184
+?></p>
182 185
 <?php endif; ?>
183 186
 
184 187
 <?php endforeach; ?>
Please login to merge, or discard this patch.
edituser.php 1 patch
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -183,8 +183,11 @@
 block discarded – undo
183 183
 			<div class="value">
184 184
 				<?php if ($my_individual_record): ?>
185 185
 				<?php echo $my_individual_record->formatList('span'); ?>
186
-				<?php else: ?>
187
-					<?php echo I18N::translateContext('unknown people', 'Unknown'); ?>
186
+				<?php else {
187
+    : ?>
188
+					<?php echo I18N::translateContext('unknown people', 'Unknown');
189
+}
190
+?>
188 191
 				<?php endif; ?>
189 192
 				<p class="small text-muted">
190 193
 					<?php echo I18N::translate('This is a link to your own record in the family tree. If this is the wrong individual, contact an administrator.'); ?>
Please login to merge, or discard this patch.
app/Family.php 1 patch
Braces   +44 added lines, -22 removed lines patch added patch discarded remove patch
@@ -18,7 +18,8 @@  discard block
 block discarded – undo
18 18
 /**
19 19
  * A GEDCOM family (FAM) object.
20 20
  */
21
-class Family extends GedcomRecord {
21
+class Family extends GedcomRecord
22
+{
22 23
 	const RECORD_TYPE = 'FAM';
23 24
 	const URL_PREFIX  = 'family.php?famid=';
24 25
 
@@ -37,7 +38,8 @@  discard block
 block discarded – undo
37 38
 	 *                             empty string for records with pending deletions
38 39
 	 * @param Tree        $tree
39 40
 	 */
40
-	public function __construct($xref, $gedcom, $pending, $tree) {
41
+	public function __construct($xref, $gedcom, $pending, $tree)
42
+	{
41 43
 		parent::__construct($xref, $gedcom, $pending, $tree);
42 44
 
43 45
 		// Fetch family members
@@ -65,7 +67,8 @@  discard block
 block discarded – undo
65 67
 	 *
66 68
 	 * @return string
67 69
 	 */
68
-	protected function createPrivateGedcomRecord($access_level) {
70
+	protected function createPrivateGedcomRecord($access_level)
71
+	{
69 72
 		$SHOW_PRIVATE_RELATIONSHIPS = $this->tree->getPreference('SHOW_PRIVATE_RELATIONSHIPS');
70 73
 
71 74
 		$rec = '0 @' . $this->xref . '@ FAM';
@@ -89,7 +92,8 @@  discard block
 block discarded – undo
89 92
 	 *
90 93
 	 * @return null|string
91 94
 	 */
92
-	protected static function fetchGedcomRecord($xref, $tree_id) {
95
+	protected static function fetchGedcomRecord($xref, $tree_id)
96
+	{
93 97
 		return Database::prepare(
94 98
 			"SELECT f_gedcom FROM `##families` WHERE f_id = :xref AND f_file = :tree_id"
95 99
 		)->execute(array(
@@ -105,7 +109,8 @@  discard block
 block discarded – undo
105 109
 	 *
106 110
 	 * @return Individual|null
107 111
 	 */
108
-	public function getHusband($access_level = null) {
112
+	public function getHusband($access_level = null)
113
+	{
109 114
 		$SHOW_PRIVATE_RELATIONSHIPS = $this->tree->getPreference('SHOW_PRIVATE_RELATIONSHIPS');
110 115
 
111 116
 		if ($this->husb && ($SHOW_PRIVATE_RELATIONSHIPS || $this->husb->canShowName($access_level))) {
@@ -122,7 +127,8 @@  discard block
 block discarded – undo
122 127
 	 *
123 128
 	 * @return Individual|null
124 129
 	 */
125
-	public function getWife($access_level = null) {
130
+	public function getWife($access_level = null)
131
+	{
126 132
 		$SHOW_PRIVATE_RELATIONSHIPS = $this->tree->getPreference('SHOW_PRIVATE_RELATIONSHIPS');
127 133
 
128 134
 		if ($this->wife && ($SHOW_PRIVATE_RELATIONSHIPS || $this->wife->canShowName($access_level))) {
@@ -139,7 +145,8 @@  discard block
 block discarded – undo
139 145
 	 *
140 146
 	 * @return bool
141 147
 	 */
142
-	protected function canShowByType($access_level) {
148
+	protected function canShowByType($access_level)
149
+	{
143 150
 		// Hide a family if any member is private
144 151
 		preg_match_all('/\n1 (?:CHIL|HUSB|WIFE) @(' . WT_REGEX_XREF . ')@/', $this->gedcom, $matches);
145 152
 		foreach ($matches[1] as $match) {
@@ -159,7 +166,8 @@  discard block
 block discarded – undo
159 166
 	 *
160 167
 	 * @return bool
161 168
 	 */
162
-	public function canShowName($access_level = null) {
169
+	public function canShowName($access_level = null)
170
+	{
163 171
 		// We can always see the name (Husband-name + Wife-name), however,
164 172
 		// the name will often be "private + private"
165 173
 		return true;
@@ -173,7 +181,8 @@  discard block
 block discarded – undo
173 181
 	 *
174 182
 	 * @return Individual|null
175 183
 	 */
176
-	public function getSpouse(Individual $person, $access_level = null) {
184
+	public function getSpouse(Individual $person, $access_level = null)
185
+	{
177 186
 		if ($person === $this->wife) {
178 187
 			return $this->getHusband($access_level);
179 188
 		} else {
@@ -188,7 +197,8 @@  discard block
 block discarded – undo
188 197
 	 *
189 198
 	 * @return Individual[]
190 199
 	 */
191
-	public function getSpouses($access_level = null) {
200
+	public function getSpouses($access_level = null)
201
+	{
192 202
 		return array_filter(array(
193 203
 			$this->getHusband($access_level),
194 204
 			$this->getWife($access_level),
@@ -202,7 +212,8 @@  discard block
 block discarded – undo
202 212
 	 *
203 213
 	 * @return Individual[]
204 214
 	 */
205
-	public function getChildren($access_level = null) {
215
+	public function getChildren($access_level = null)
216
+	{
206 217
 		if ($access_level === null) {
207 218
 			$access_level = Auth::accessLevel($this->tree);
208 219
 		}
@@ -228,7 +239,8 @@  discard block
 block discarded – undo
228 239
 	 *
229 240
 	 * @return int
230 241
 	 */
231
-	public static function compareMarrDate(Family $x, Family $y) {
242
+	public static function compareMarrDate(Family $x, Family $y)
243
+	{
232 244
 		return Date::compare($x->getMarriageDate(), $y->getMarriageDate());
233 245
 	}
234 246
 
@@ -237,7 +249,8 @@  discard block
 block discarded – undo
237 249
 	 *
238 250
 	 * @return int
239 251
 	 */
240
-	public function getNumberOfChildren() {
252
+	public function getNumberOfChildren()
253
+	{
241 254
 		$nchi = count($this->getChildren());
242 255
 		foreach ($this->getFacts('NCHI') as $fact) {
243 256
 			$nchi = max($nchi, (int) $fact->getValue());
@@ -251,7 +264,8 @@  discard block
 block discarded – undo
251 264
 	 *
252 265
 	 * @return Fact
253 266
 	 */
254
-	public function getMarriage() {
267
+	public function getMarriage()
268
+	{
255 269
 		return $this->getFirstFact('MARR');
256 270
 	}
257 271
 
@@ -260,7 +274,8 @@  discard block
 block discarded – undo
260 274
 	 *
261 275
 	 * @return Date
262 276
 	 */
263
-	public function getMarriageDate() {
277
+	public function getMarriageDate()
278
+	{
264 279
 		$marriage = $this->getMarriage();
265 280
 		if ($marriage) {
266 281
 			return $marriage->getDate();
@@ -274,7 +289,8 @@  discard block
 block discarded – undo
274 289
 	 *
275 290
 	 * @return int
276 291
 	 */
277
-	public function getMarriageYear() {
292
+	public function getMarriageYear()
293
+	{
278 294
 		return $this->getMarriageDate()->minimumDate()->y;
279 295
 	}
280 296
 
@@ -283,7 +299,8 @@  discard block
 block discarded – undo
283 299
 	 *
284 300
 	 * @return string|null
285 301
 	 */
286
-	public function getMarriageType() {
302
+	public function getMarriageType()
303
+	{
287 304
 		$marriage = $this->getMarriage();
288 305
 		if ($marriage) {
289 306
 			return $marriage->getAttribute('TYPE');
@@ -297,7 +314,8 @@  discard block
 block discarded – undo
297 314
 	 *
298 315
 	 * @return Place
299 316
 	 */
300
-	public function getMarriagePlace() {
317
+	public function getMarriagePlace()
318
+	{
301 319
 		$marriage = $this->getMarriage();
302 320
 
303 321
 		return $marriage->getPlace();
@@ -308,7 +326,8 @@  discard block
 block discarded – undo
308 326
 	 *
309 327
 	 * @return Date[]
310 328
 	 */
311
-	public function getAllMarriageDates() {
329
+	public function getAllMarriageDates()
330
+	{
312 331
 		foreach (explode('|', WT_EVENTS_MARR) as $event) {
313 332
 			if ($array = $this->getAllEventDates($event)) {
314 333
 				return $array;
@@ -323,7 +342,8 @@  discard block
 block discarded – undo
323 342
 	 *
324 343
 	 * @return string[]
325 344
 	 */
326
-	public function getAllMarriagePlaces() {
345
+	public function getAllMarriagePlaces()
346
+	{
327 347
 		foreach (explode('|', WT_EVENTS_MARR) as $event) {
328 348
 			if ($array = $this->getAllEventPlaces($event)) {
329 349
 				return $array;
@@ -338,7 +358,8 @@  discard block
 block discarded – undo
338 358
 	 *
339 359
 	 * @return string[][]
340 360
 	 */
341
-	public function getAllNames() {
361
+	public function getAllNames()
362
+	{
342 363
 		if (is_null($this->_getAllNames)) {
343 364
 			// Check the script used by each name, so we can match cyrillic with cyrillic, greek with greek, etc.
344 365
 			$husb_names = array();
@@ -411,7 +432,8 @@  discard block
 block discarded – undo
411 432
 	 *
412 433
 	 * @return string
413 434
 	 */
414
-	public function formatListDetails() {
435
+	public function formatListDetails()
436
+	{
415 437
 		return
416 438
 			$this->formatFirstMajorFact(WT_EVENTS_MARR, 1) .
417 439
 			$this->formatFirstMajorFact(WT_EVENTS_DIV, 1);
Please login to merge, or discard this patch.
app/Census/CensusColumnBornForeignParts.php 1 patch
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,7 +20,8 @@  discard block
 block discarded – undo
20 20
 /**
21 21
  * Was the individual born in "foreign parts".
22 22
  */
23
-class CensusColumnBornForeignParts extends AbstractCensusColumn implements CensusColumnInterface {
23
+class CensusColumnBornForeignParts extends AbstractCensusColumn implements CensusColumnInterface
24
+{
24 25
 	/**
25 26
 	 * Generate the likely value of this census column, based on available information.
26 27
 	 *
@@ -29,7 +30,8 @@  discard block
 block discarded – undo
29 30
 	 *
30 31
 	 * @return string
31 32
 	 */
32
-	public function generate(Individual $individual, Individual $head = null) {
33
+	public function generate(Individual $individual, Individual $head = null)
34
+	{
33 35
 		$birth_place  = explode(', ', $individual->getBirthPlace());
34 36
 		$birth_place  = end($birth_place);
35 37
 		$census_place = $this->place();
Please login to merge, or discard this patch.