Passed
Push — 1.7 ( 23cbb7...8df8a8 )
by Greg
08:15
created
app/Database.php 2 patches
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -85,8 +85,7 @@
 block discarded – undo
85 85
 		// Create the underlying PDO object
86 86
 		self::$pdo = new PDO(
87 87
 			(substr($DBHOST, 0, 1) === '/' ?
88
-				"mysql:unix_socket={$DBHOST};dbname={$DBNAME}" :
89
-				"mysql:host={$DBHOST};dbname={$DBNAME};port={$DBPORT}"
88
+				"mysql:unix_socket={$DBHOST};dbname={$DBNAME}" : "mysql:host={$DBHOST};dbname={$DBNAME};port={$DBPORT}"
90 89
 			),
91 90
 			$DBUSER, $DBPASS,
92 91
 			array(
Please login to merge, or discard this patch.
Braces   +34 added lines, -17 removed lines patch added patch discarded remove patch
@@ -22,7 +22,8 @@  discard block
 block discarded – undo
22 22
 /**
23 23
  * Extend PHP's native PDO class.
24 24
  */
25
-class Database {
25
+class Database
26
+{
26 27
 	/** @var Database Implement the singleton pattern */
27 28
 	private static $instance;
28 29
 
@@ -38,7 +39,8 @@  discard block
 block discarded – undo
38 39
 	/**
39 40
 	 * Prevent instantiation via new Database
40 41
 	 */
41
-	private function __construct() {
42
+	private function __construct()
43
+	{
42 44
 		self::$log = array();
43 45
 	}
44 46
 
@@ -47,7 +49,8 @@  discard block
 block discarded – undo
47 49
 	 *
48 50
 	 * @return bool
49 51
 	 */
50
-	public static function beginTransaction() {
52
+	public static function beginTransaction()
53
+	{
51 54
 		return self::$pdo->beginTransaction();
52 55
 	}
53 56
 
@@ -56,14 +59,16 @@  discard block
 block discarded – undo
56 59
 	 *
57 60
 	 * @return bool
58 61
 	 */
59
-	public static function commit() {
62
+	public static function commit()
63
+	{
60 64
 		return self::$pdo->commit();
61 65
 	}
62 66
 
63 67
 	/**
64 68
 	 * Disconnect from the server, so we can connect to another one
65 69
 	 */
66
-	public static function disconnect() {
70
+	public static function disconnect()
71
+	{
67 72
 		self::$pdo = null;
68 73
 	}
69 74
 
@@ -78,7 +83,8 @@  discard block
 block discarded – undo
78 83
 	 *
79 84
 	 * @throws \Exception
80 85
 	 */
81
-	public static function createInstance($DBHOST, $DBPORT, $DBNAME, $DBUSER, $DBPASS) {
86
+	public static function createInstance($DBHOST, $DBPORT, $DBNAME, $DBUSER, $DBPASS)
87
+	{
82 88
 		if (self::$pdo instanceof PDO) {
83 89
 			throw new \Exception('Database::createInstance() can only be called once.');
84 90
 		}
@@ -109,7 +115,8 @@  discard block
 block discarded – undo
109 115
 	 *
110 116
 	 * @return Database
111 117
 	 */
112
-	public static function getInstance() {
118
+	public static function getInstance()
119
+	{
113 120
 		if (self::$pdo instanceof PDO) {
114 121
 			return self::$instance;
115 122
 		} else {
@@ -122,7 +129,8 @@  discard block
 block discarded – undo
122 129
 	 *
123 130
 	 * @return bool
124 131
 	 */
125
-	public static function isConnected() {
132
+	public static function isConnected()
133
+	{
126 134
 		return self::$pdo instanceof PDO;
127 135
 	}
128 136
 
@@ -134,7 +142,8 @@  discard block
 block discarded – undo
134 142
 	 * @param float    $microtime
135 143
 	 * @param string[] $bind_variables
136 144
 	 */
137
-	public static function logQuery($query, $rows, $microtime, $bind_variables) {
145
+	public static function logQuery($query, $rows, $microtime, $bind_variables)
146
+	{
138 147
 		if (WT_DEBUG_SQL) {
139 148
 			// Full logging
140 149
 			// Trace
@@ -185,7 +194,8 @@  discard block
 block discarded – undo
185 194
 	 *
186 195
 	 * @return int
187 196
 	 */
188
-	public static function getQueryCount() {
197
+	public static function getQueryCount()
198
+	{
189 199
 		return count(self::$log);
190 200
 	}
191 201
 
@@ -194,7 +204,8 @@  discard block
 block discarded – undo
194 204
 	 *
195 205
 	 * @return string
196 206
 	 */
197
-	public static function getQueryLog() {
207
+	public static function getQueryLog()
208
+	{
198 209
 		$html      = '<table border="1" style="table-layout: fixed; width: 960px;word-wrap: break-word;"><col span="3"><col align="char"><thead><tr><th>#</th><th style="width: 800px;">Query</th><th>Rows</th><th>Time (ms)</th></tr></thead><tbody>' . implode('', self::$log) . '</tbody></table>';
199 210
 		self::$log = array();
200 211
 
@@ -206,7 +217,8 @@  discard block
 block discarded – undo
206 217
 	 *
207 218
 	 * @return string
208 219
 	 */
209
-	public static function lastInsertId() {
220
+	public static function lastInsertId()
221
+	{
210 222
 		return self::$pdo->lastInsertId();
211 223
 	}
212 224
 
@@ -221,7 +233,8 @@  discard block
 block discarded – undo
221 233
 	 *
222 234
 	 * @deprecated We should use bind-variables instead.
223 235
 	 */
224
-	public static function quote($string) {
236
+	public static function quote($string)
237
+	{
225 238
 		if (is_null($string)) {
226 239
 			return 'NULL';
227 240
 		} else {
@@ -236,7 +249,8 @@  discard block
 block discarded – undo
236 249
 	 *
237 250
 	 * @return int The number of rows affected by this SQL query
238 251
 	 */
239
-	public static function exec($sql) {
252
+	public static function exec($sql)
253
+	{
240 254
 		$sql   = str_replace('##', WT_TBLPREFIX, $sql);
241 255
 		$start = microtime(true);
242 256
 		$rows  = self::$pdo->exec($sql);
@@ -255,7 +269,8 @@  discard block
 block discarded – undo
255 269
 	 *
256 270
 	 * @return Statement
257 271
 	 */
258
-	public static function prepare($sql) {
272
+	public static function prepare($sql)
273
+	{
259 274
 		if (!self::$pdo instanceof PDO) {
260 275
 			throw new \Exception("No Connection Established");
261 276
 		}
@@ -274,7 +289,8 @@  discard block
 block discarded – undo
274 289
 	 *
275 290
 	 * @return bool
276 291
 	 */
277
-	public static function rollBack() {
292
+	public static function rollBack()
293
+	{
278 294
 		return self::$pdo->rollBack();
279 295
 	}
280 296
 
@@ -289,7 +305,8 @@  discard block
 block discarded – undo
289 305
 	 *
290 306
 	 * @return bool  Were any updates applied
291 307
 	 */
292
-	public static function updateSchema($namespace, $schema_name, $target_version) {
308
+	public static function updateSchema($namespace, $schema_name, $target_version)
309
+	{
293 310
 		try {
294 311
 			$current_version = (int) Site::getPreference($schema_name);
295 312
 		} catch (PDOException $e) {
Please login to merge, or discard this patch.
app/Report/ReportParserGenerate.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2743,7 +2743,7 @@
 block discarded – undo
2743 2743
 		$tags      = explode(':', $tag);
2744 2744
 		$origlevel = $level;
2745 2745
 		if ($level == 0) {
2746
-			$level = $gedrec{0} + 1;
2746
+			$level = $gedrec{0} +1;
2747 2747
 		}
2748 2748
 
2749 2749
 		$subrec = $gedrec;
Please login to merge, or discard this patch.
Braces   +124 added lines, -62 removed lines patch added patch discarded remove patch
@@ -34,7 +34,8 @@  discard block
 block discarded – undo
34 34
 /**
35 35
  * Class ReportParserGenerate - parse a report.xml file and generate the report.
36 36
  */
37
-class ReportParserGenerate extends ReportParserBase {
37
+class ReportParserGenerate extends ReportParserBase
38
+{
38 39
 	/** @var bool Are we collecting data from <Footnote> elements  */
39 40
 	private $process_footnote = true;
40 41
 
@@ -121,7 +122,8 @@  discard block
 block discarded – undo
121 122
 	 * @param ReportBase $report_root
122 123
 	 * @param string[][] $vars
123 124
 	 */
124
-	public function __construct($report, ReportBase $report_root = null, array $vars = array()) {
125
+	public function __construct($report, ReportBase $report_root = null, array $vars = array())
126
+	{
125 127
 		$this->report_root     = $report_root;
126 128
 		$this->wt_report       = $report_root;
127 129
 		$this->current_element = new ReportBaseElement;
@@ -139,7 +141,8 @@  discard block
 block discarded – undo
139 141
 	 * @param string   $name   the name of the XML element parsed
140 142
 	 * @param array    $attrs  an array of key value pairs for the attributes
141 143
 	 */
142
-	protected function startElement($parser, $name, $attrs) {
144
+	protected function startElement($parser, $name, $attrs)
145
+	{
143 146
 		$newattrs = array();
144 147
 
145 148
 		foreach ($attrs as $key => $value) {
@@ -171,7 +174,8 @@  discard block
 block discarded – undo
171 174
 	 * @param resource $parser the resource handler for the XML parser
172 175
 	 * @param string   $name   the name of the XML element parsed
173 176
 	 */
174
-	protected function endElement($parser, $name) {
177
+	protected function endElement($parser, $name)
178
+	{
175 179
 		if (($this->process_footnote || $name === "Footnote") && ($this->process_ifs === 0 || $name === "if") && ($this->process_gedcoms === 0 || $name === "Gedcom") && ($this->process_repeats === 0 || $name === "Facts" || $name === "RepeatTag" || $name === "List" || $name === "Relatives")) {
176 180
 			$start_method = $name . 'StartHandler';
177 181
 			$end_method   = $name . 'EndHandler';
@@ -189,7 +193,8 @@  discard block
 block discarded – undo
189 193
 	 * @param resource $parser the resource handler for the XML parser
190 194
 	 * @param string   $data   the name of the XML element parsed
191 195
 	 */
192
-	protected function characterData($parser, $data) {
196
+	protected function characterData($parser, $data)
197
+	{
193 198
 		if ($this->print_data && $this->process_gedcoms === 0 && $this->process_ifs === 0 && $this->process_repeats === 0) {
194 199
 			$this->current_element->addText($data);
195 200
 		}
@@ -200,7 +205,8 @@  discard block
 block discarded – undo
200 205
 	 *
201 206
 	 * @param array $attrs an array of key value pairs for the attributes
202 207
 	 */
203
-	private function styleStartHandler($attrs) {
208
+	private function styleStartHandler($attrs)
209
+	{
204 210
 		if (empty($attrs['name'])) {
205 211
 			throw new \DomainException('REPORT ERROR Style: The "name" of the style is missing or not set in the XML file.');
206 212
 		}
@@ -239,7 +245,8 @@  discard block
 block discarded – undo
239 245
 	 *
240 246
 	 * @param array $attrs an array of key value pairs for the attributes
241 247
 	 */
242
-	private function docStartHandler($attrs) {
248
+	private function docStartHandler($attrs)
249
+	{
243 250
 		$this->parser = $this->xml_parser;
244 251
 
245 252
 		// Custom page width
@@ -328,14 +335,16 @@  discard block
 block discarded – undo
328 335
 	/**
329 336
 	 * XML </Doc>
330 337
 	 */
331
-	private function docEndHandler() {
338
+	private function docEndHandler()
339
+	{
332 340
 		$this->wt_report->run();
333 341
 	}
334 342
 
335 343
 	/**
336 344
 	 * XML <Header>
337 345
 	 */
338
-	private function headerStartHandler() {
346
+	private function headerStartHandler()
347
+	{
339 348
 		// Clear the Header before any new elements are added
340 349
 		$this->wt_report->clearHeader();
341 350
 		$this->wt_report->setProcessing("H");
@@ -344,7 +353,8 @@  discard block
 block discarded – undo
344 353
 	/**
345 354
 	 * XML <PageHeader>
346 355
 	 */
347
-	private function pageHeaderStartHandler() {
356
+	private function pageHeaderStartHandler()
357
+	{
348 358
 		array_push($this->print_data_stack, $this->print_data);
349 359
 		$this->print_data = false;
350 360
 		array_push($this->wt_report_stack, $this->wt_report);
@@ -354,7 +364,8 @@  discard block
 block discarded – undo
354 364
 	/**
355 365
 	 * XML <pageHeaderEndHandler>
356 366
 	 */
357
-	private function pageHeaderEndHandler() {
367
+	private function pageHeaderEndHandler()
368
+	{
358 369
 		$this->print_data        = array_pop($this->print_data_stack);
359 370
 		$this->current_element   = $this->wt_report;
360 371
 		$this->wt_report         = array_pop($this->wt_report_stack);
@@ -364,14 +375,16 @@  discard block
 block discarded – undo
364 375
 	/**
365 376
 	 * XML <bodyStartHandler>
366 377
 	 */
367
-	private function bodyStartHandler() {
378
+	private function bodyStartHandler()
379
+	{
368 380
 		$this->wt_report->setProcessing("B");
369 381
 	}
370 382
 
371 383
 	/**
372 384
 	 * XML <footerStartHandler>
373 385
 	 */
374
-	private function footerStartHandler() {
386
+	private function footerStartHandler()
387
+	{
375 388
 		$this->wt_report->setProcessing("F");
376 389
 	}
377 390
 
@@ -380,7 +393,8 @@  discard block
 block discarded – undo
380 393
 	 *
381 394
 	 * @param array $attrs an array of key value pairs for the attributes
382 395
 	 */
383
-	private function cellStartHandler($attrs) {
396
+	private function cellStartHandler($attrs)
397
+	{
384 398
 		// string The text alignment of the text in this box.
385 399
 		$align = "";
386 400
 		if (!empty($attrs['align'])) {
@@ -534,7 +548,8 @@  discard block
 block discarded – undo
534 548
 	/**
535 549
 	 * XML </Cell>
536 550
 	 */
537
-	private function cellEndHandler() {
551
+	private function cellEndHandler()
552
+	{
538 553
 		$this->print_data = array_pop($this->print_data_stack);
539 554
 		$this->wt_report->addElement($this->current_element);
540 555
 	}
@@ -542,7 +557,8 @@  discard block
 block discarded – undo
542 557
 	/**
543 558
 	 * XML <Now /> element handler
544 559
 	 */
545
-	private function nowStartHandler() {
560
+	private function nowStartHandler()
561
+	{
546 562
 		$g = FunctionsDate::timestampToGedcomDate(WT_TIMESTAMP + WT_TIMESTAMP_OFFSET);
547 563
 		$this->current_element->addText($g->display());
548 564
 	}
@@ -550,14 +566,16 @@  discard block
 block discarded – undo
550 566
 	/**
551 567
 	 * XML <PageNum /> element handler
552 568
 	 */
553
-	private function pageNumStartHandler() {
569
+	private function pageNumStartHandler()
570
+	{
554 571
 		$this->current_element->addText("#PAGENUM#");
555 572
 	}
556 573
 
557 574
 	/**
558 575
 	 * XML <TotalPages /> element handler
559 576
 	 */
560
-	private function totalPagesStartHandler() {
577
+	private function totalPagesStartHandler()
578
+	{
561 579
 		$this->current_element->addText("{{:ptp:}}");
562 580
 	}
563 581
 
@@ -566,7 +584,8 @@  discard block
 block discarded – undo
566 584
 	 *
567 585
 	 * @param array $attrs an array of key value pairs for the attributes
568 586
 	 */
569
-	private function gedcomStartHandler($attrs) {
587
+	private function gedcomStartHandler($attrs)
588
+	{
570 589
 		global $WT_TREE;
571 590
 
572 591
 		if ($this->process_gedcoms > 0) {
@@ -629,7 +648,8 @@  discard block
 block discarded – undo
629 648
 	/**
630 649
 	 * Called at the end of an element.
631 650
 	 */
632
-	private function gedcomEndHandler() {
651
+	private function gedcomEndHandler()
652
+	{
633 653
 		if ($this->process_gedcoms > 0) {
634 654
 			$this->process_gedcoms--;
635 655
 		} else {
@@ -642,7 +662,8 @@  discard block
 block discarded – undo
642 662
 	 *
643 663
 	 * @param array $attrs an array of key value pairs for the attributes
644 664
 	 */
645
-	private function textBoxStartHandler($attrs) {
665
+	private function textBoxStartHandler($attrs)
666
+	{
646 667
 		// string Background color code
647 668
 		$bgcolor = "";
648 669
 		if (!empty($attrs['bgcolor'])) {
@@ -765,7 +786,8 @@  discard block
 block discarded – undo
765 786
 	/**
766 787
 	 * XML <textBoxEndHandler>
767 788
 	 */
768
-	private function textBoxEndHandler() {
789
+	private function textBoxEndHandler()
790
+	{
769 791
 		$this->print_data      = array_pop($this->print_data_stack);
770 792
 		$this->current_element = $this->wt_report;
771 793
 		$this->wt_report       = array_pop($this->wt_report_stack);
@@ -777,7 +799,8 @@  discard block
 block discarded – undo
777 799
 	 *
778 800
 	 * @param array $attrs an array of key value pairs for the attributes
779 801
 	 */
780
-	private function textStartHandler($attrs) {
802
+	private function textStartHandler($attrs)
803
+	{
781 804
 		array_push($this->print_data_stack, $this->print_data);
782 805
 		$this->print_data = true;
783 806
 
@@ -799,7 +822,8 @@  discard block
 block discarded – undo
799 822
 	/**
800 823
 	 * XML </Text>
801 824
 	 */
802
-	private function textEndHandler() {
825
+	private function textEndHandler()
826
+	{
803 827
 		$this->print_data = array_pop($this->print_data_stack);
804 828
 		$this->wt_report->addElement($this->current_element);
805 829
 	}
@@ -813,7 +837,8 @@  discard block
 block discarded – undo
813 837
 	 *
814 838
 	 * @param array $attrs an array of key value pairs for the attributes
815 839
 	 */
816
-	private function getPersonNameStartHandler($attrs) {
840
+	private function getPersonNameStartHandler($attrs)
841
+	{
817 842
 		global $WT_TREE;
818 843
 
819 844
 		$id    = "";
@@ -896,7 +921,8 @@  discard block
 block discarded – undo
896 921
 	 *
897 922
 	 * @param array $attrs an array of key value pairs for the attributes
898 923
 	 */
899
-	private function gedcomValueStartHandler($attrs) {
924
+	private function gedcomValueStartHandler($attrs)
925
+	{
900 926
 		global $WT_TREE;
901 927
 
902 928
 		$id    = "";
@@ -967,7 +993,8 @@  discard block
 block discarded – undo
967 993
 	 *
968 994
 	 * @param array $attrs an array of key value pairs for the attributes
969 995
 	 */
970
-	private function repeatTagStartHandler($attrs) {
996
+	private function repeatTagStartHandler($attrs)
997
+	{
971 998
 		global $WT_TREE;
972 999
 
973 1000
 		$this->process_repeats++;
@@ -1039,7 +1066,8 @@  discard block
 block discarded – undo
1039 1066
 	/**
1040 1067
 	 * XML </ RepeatTag>
1041 1068
 	 */
1042
-	private function repeatTagEndHandler() {
1069
+	private function repeatTagEndHandler()
1070
+	{
1043 1071
 		global $report;
1044 1072
 
1045 1073
 		$this->process_repeats--;
@@ -1118,7 +1146,8 @@  discard block
 block discarded – undo
1118 1146
 	 *
1119 1147
 	 * @param array $attrs an array of key value pairs for the attributes
1120 1148
 	 */
1121
-	private function varStartHandler($attrs) {
1149
+	private function varStartHandler($attrs)
1150
+	{
1122 1151
 		if (empty($attrs['var'])) {
1123 1152
 			throw new \DomainException('REPORT ERROR var: The attribute "var=" is missing or not set in the XML file on line: ' . xml_get_current_line_number($this->parser));
1124 1153
 		}
@@ -1159,7 +1188,8 @@  discard block
 block discarded – undo
1159 1188
 	 *
1160 1189
 	 * @param array $attrs an array of key value pairs for the attributes
1161 1190
 	 */
1162
-	private function factsStartHandler($attrs) {
1191
+	private function factsStartHandler($attrs)
1192
+	{
1163 1193
 		global $WT_TREE;
1164 1194
 
1165 1195
 		$this->process_repeats++;
@@ -1207,7 +1237,8 @@  discard block
 block discarded – undo
1207 1237
 	/**
1208 1238
 	 * XML </Facts>
1209 1239
 	 */
1210
-	private function factsEndHandler() {
1240
+	private function factsEndHandler()
1241
+	{
1211 1242
 		global $report;
1212 1243
 
1213 1244
 		$this->process_repeats--;
@@ -1290,7 +1321,8 @@  discard block
 block discarded – undo
1290 1321
 	 *
1291 1322
 	 * @param array $attrs an array of key value pairs for the attributes
1292 1323
 	 */
1293
-	private function setVarStartHandler($attrs) {
1324
+	private function setVarStartHandler($attrs)
1325
+	{
1294 1326
 		if (empty($attrs['name'])) {
1295 1327
 			throw new \DomainException('REPORT ERROR var: The attribute "name" is missing or not set in the XML file');
1296 1328
 		}
@@ -1364,7 +1396,8 @@  discard block
 block discarded – undo
1364 1396
 	 *
1365 1397
 	 * @param array $attrs an array of key value pairs for the attributes
1366 1398
 	 */
1367
-	private function ifStartHandler($attrs) {
1399
+	private function ifStartHandler($attrs)
1400
+	{
1368 1401
 		if ($this->process_ifs > 0) {
1369 1402
 			$this->process_ifs++;
1370 1403
 
@@ -1419,7 +1452,8 @@  discard block
 block discarded – undo
1419 1452
 	/**
1420 1453
 	 * XML <if /> end element
1421 1454
 	 */
1422
-	private function ifEndHandler() {
1455
+	private function ifEndHandler()
1456
+	{
1423 1457
 		if ($this->process_ifs > 0) {
1424 1458
 			$this->process_ifs--;
1425 1459
 		}
@@ -1432,7 +1466,8 @@  discard block
 block discarded – undo
1432 1466
 	 *
1433 1467
 	 * @param array $attrs an array of key value pairs for the attributes
1434 1468
 	 */
1435
-	private function footnoteStartHandler($attrs) {
1469
+	private function footnoteStartHandler($attrs)
1470
+	{
1436 1471
 		global $WT_TREE;
1437 1472
 
1438 1473
 		$id = "";
@@ -1459,7 +1494,8 @@  discard block
 block discarded – undo
1459 1494
 	 * XML <Footnote /> end element
1460 1495
 	 * Print the collected Footnote data
1461 1496
 	 */
1462
-	private function footnoteEndHandler() {
1497
+	private function footnoteEndHandler()
1498
+	{
1463 1499
 		if ($this->process_footnote) {
1464 1500
 			$this->print_data = array_pop($this->print_data_stack);
1465 1501
 			$temp             = trim($this->current_element->getValue());
@@ -1475,7 +1511,8 @@  discard block
 block discarded – undo
1475 1511
 	/**
1476 1512
 	 * XML <FootnoteTexts /> element
1477 1513
 	 */
1478
-	private function footnoteTextsStartHandler() {
1514
+	private function footnoteTextsStartHandler()
1515
+	{
1479 1516
 		$temp = "footnotetexts";
1480 1517
 		$this->wt_report->addElement($temp);
1481 1518
 	}
@@ -1483,7 +1520,8 @@  discard block
 block discarded – undo
1483 1520
 	/**
1484 1521
 	 * XML <AgeAtDeath /> element handler
1485 1522
 	 */
1486
-	private function ageAtDeathStartHandler() {
1523
+	private function ageAtDeathStartHandler()
1524
+	{
1487 1525
 		// This duplicates functionality in FunctionsPrint::format_fact_date()
1488 1526
 		global $factrec, $WT_TREE;
1489 1527
 
@@ -1540,7 +1578,8 @@  discard block
 block discarded – undo
1540 1578
 	/**
1541 1579
 	 * XML element Forced line break handler - HTML code
1542 1580
 	 */
1543
-	private function brStartHandler() {
1581
+	private function brStartHandler()
1582
+	{
1544 1583
 		if ($this->print_data && $this->process_gedcoms === 0) {
1545 1584
 			$this->current_element->addText('<br>');
1546 1585
 		}
@@ -1549,7 +1588,8 @@  discard block
 block discarded – undo
1549 1588
 	/**
1550 1589
 	 * XML <sp />element Forced space handler
1551 1590
 	 */
1552
-	private function spStartHandler() {
1591
+	private function spStartHandler()
1592
+	{
1553 1593
 		if ($this->print_data && $this->process_gedcoms === 0) {
1554 1594
 			$this->current_element->addText(' ');
1555 1595
 		}
@@ -1560,7 +1600,8 @@  discard block
 block discarded – undo
1560 1600
 	 *
1561 1601
 	 * @param array $attrs an array of key value pairs for the attributes
1562 1602
 	 */
1563
-	private function highlightedImageStartHandler($attrs) {
1603
+	private function highlightedImageStartHandler($attrs)
1604
+	{
1564 1605
 		global $WT_TREE;
1565 1606
 
1566 1607
 		$id    = '';
@@ -1661,7 +1702,8 @@  discard block
 block discarded – undo
1661 1702
 	 *
1662 1703
 	 * @param array $attrs an array of key value pairs for the attributes
1663 1704
 	 */
1664
-	private function imageStartHandler($attrs) {
1705
+	private function imageStartHandler($attrs)
1706
+	{
1665 1707
 		global $WT_TREE;
1666 1708
 
1667 1709
 		// mixed Position the top corner of this box on the page. the default is the current position
@@ -1778,7 +1820,8 @@  discard block
 block discarded – undo
1778 1820
 	 *
1779 1821
 	 * @param array $attrs an array of key value pairs for the attributes
1780 1822
 	 */
1781
-	private function lineStartHandler($attrs) {
1823
+	private function lineStartHandler($attrs)
1824
+	{
1782 1825
 		// Start horizontal position, current position (default)
1783 1826
 		$x1 = ".";
1784 1827
 		if (isset($attrs['x1'])) {
@@ -1833,7 +1876,8 @@  discard block
 block discarded – undo
1833 1876
 	 *
1834 1877
 	 * @param array $attrs an array of key value pairs for the attributes
1835 1878
 	 */
1836
-	private function listStartHandler($attrs) {
1879
+	private function listStartHandler($attrs)
1880
+	{
1837 1881
 		global $WT_TREE;
1838 1882
 
1839 1883
 		$this->process_repeats++;
@@ -2212,7 +2256,8 @@  discard block
 block discarded – undo
2212 2256
 	/**
2213 2257
 	 * XML <List>
2214 2258
 	 */
2215
-	private function listEndHandler() {
2259
+	private function listEndHandler()
2260
+	{
2216 2261
 		global $report;
2217 2262
 
2218 2263
 		$this->process_repeats--;
@@ -2291,7 +2336,8 @@  discard block
 block discarded – undo
2291 2336
 	 * The total number is collected from
2292 2337
 	 * List and Relatives
2293 2338
 	 */
2294
-	private function listTotalStartHandler() {
2339
+	private function listTotalStartHandler()
2340
+	{
2295 2341
 		if ($this->list_private == 0) {
2296 2342
 			$this->current_element->addText($this->list_total);
2297 2343
 		} else {
@@ -2304,7 +2350,8 @@  discard block
 block discarded – undo
2304 2350
 	 *
2305 2351
 	 * @param array $attrs an array of key value pairs for the attributes
2306 2352
 	 */
2307
-	private function relativesStartHandler($attrs) {
2353
+	private function relativesStartHandler($attrs)
2354
+	{
2308 2355
 		global $WT_TREE;
2309 2356
 
2310 2357
 		$this->process_repeats++;
@@ -2443,7 +2490,8 @@  discard block
 block discarded – undo
2443 2490
 	/**
2444 2491
 	 * XML </ Relatives>
2445 2492
 	 */
2446
-	private function relativesEndHandler() {
2493
+	private function relativesEndHandler()
2494
+	{
2447 2495
 		global $report, $WT_TREE;
2448 2496
 
2449 2497
 		$this->process_repeats--;
@@ -2518,7 +2566,8 @@  discard block
 block discarded – undo
2518 2566
 	 *
2519 2567
 	 * Prints the number of generations
2520 2568
 	 */
2521
-	private function generationStartHandler() {
2569
+	private function generationStartHandler()
2570
+	{
2522 2571
 		$this->current_element->addText($this->generation);
2523 2572
 	}
2524 2573
 
@@ -2527,7 +2576,8 @@  discard block
 block discarded – undo
2527 2576
 	 *
2528 2577
 	 * Has to be placed in an element (header, pageheader, body or footer)
2529 2578
 	 */
2530
-	private function newPageStartHandler() {
2579
+	private function newPageStartHandler()
2580
+	{
2531 2581
 		$temp = "addpage";
2532 2582
 		$this->wt_report->addElement($temp);
2533 2583
 	}
@@ -2538,7 +2588,8 @@  discard block
 block discarded – undo
2538 2588
 	 * @param string  $tag   HTML tag name
2539 2589
 	 * @param array[] $attrs an array of key value pairs for the attributes
2540 2590
 	 */
2541
-	private function htmlStartHandler($tag, $attrs) {
2591
+	private function htmlStartHandler($tag, $attrs)
2592
+	{
2542 2593
 		if ($tag === "tempdoc") {
2543 2594
 			return;
2544 2595
 		}
@@ -2555,7 +2606,8 @@  discard block
 block discarded – undo
2555 2606
 	 *
2556 2607
 	 * @param string $tag
2557 2608
 	 */
2558
-	private function htmlEndHandler($tag) {
2609
+	private function htmlEndHandler($tag)
2610
+	{
2559 2611
 		if ($tag === "tempdoc") {
2560 2612
 			return;
2561 2613
 		}
@@ -2573,42 +2625,48 @@  discard block
 block discarded – undo
2573 2625
 	/**
2574 2626
 	 * Handle <Input>
2575 2627
 	 */
2576
-	private function inputStartHandler() {
2628
+	private function inputStartHandler()
2629
+	{
2577 2630
 		// Dummy function, to prevent the default HtmlStartHandler() being called
2578 2631
 	}
2579 2632
 
2580 2633
 	/**
2581 2634
 	 * Handle </Input>
2582 2635
 	 */
2583
-	private function inputEndHandler() {
2636
+	private function inputEndHandler()
2637
+	{
2584 2638
 		// Dummy function, to prevent the default HtmlEndHandler() being called
2585 2639
 	}
2586 2640
 
2587 2641
 	/**
2588 2642
 	 * Handle <Report>
2589 2643
 	 */
2590
-	private function reportStartHandler() {
2644
+	private function reportStartHandler()
2645
+	{
2591 2646
 		// Dummy function, to prevent the default HtmlStartHandler() being called
2592 2647
 	}
2593 2648
 
2594 2649
 	/**
2595 2650
 	 * Handle </Report>
2596 2651
 	 */
2597
-	private function reportEndHandler() {
2652
+	private function reportEndHandler()
2653
+	{
2598 2654
 		// Dummy function, to prevent the default HtmlEndHandler() being called
2599 2655
 	}
2600 2656
 
2601 2657
 	/**
2602 2658
 	 * XML </titleEndHandler>
2603 2659
 	 */
2604
-	private function titleEndHandler() {
2660
+	private function titleEndHandler()
2661
+	{
2605 2662
 		$this->report_root->addTitle($this->text);
2606 2663
 	}
2607 2664
 
2608 2665
 	/**
2609 2666
 	 * XML </descriptionEndHandler>
2610 2667
 	 */
2611
-	private function descriptionEndHandler() {
2668
+	private function descriptionEndHandler()
2669
+	{
2612 2670
 		$this->report_root->addDescription($this->text);
2613 2671
 	}
2614 2672
 
@@ -2620,7 +2678,8 @@  discard block
 block discarded – undo
2620 2678
 	 * @param bool  $parents
2621 2679
 	 * @param int  $generations
2622 2680
 	 */
2623
-	private function addDescendancy(&$list, $pid, $parents = false, $generations = -1) {
2681
+	private function addDescendancy(&$list, $pid, $parents = false, $generations = -1)
2682
+	{
2624 2683
 		global $WT_TREE;
2625 2684
 
2626 2685
 		$person = Individual::getInstance($pid, $WT_TREE);
@@ -2681,7 +2740,8 @@  discard block
 block discarded – undo
2681 2740
 	 * @param bool  $children
2682 2741
 	 * @param int  $generations
2683 2742
 	 */
2684
-	private function addAncestors(&$list, $pid, $children = false, $generations = -1) {
2743
+	private function addAncestors(&$list, $pid, $children = false, $generations = -1)
2744
+	{
2685 2745
 		global $WT_TREE;
2686 2746
 
2687 2747
 		$genlist                = array($pid);
@@ -2734,7 +2794,8 @@  discard block
 block discarded – undo
2734 2794
 	 *
2735 2795
 	 * @return string the value of a gedcom tag from the given gedcom record
2736 2796
 	 */
2737
-	private function getGedcomValue($tag, $level, $gedrec) {
2797
+	private function getGedcomValue($tag, $level, $gedrec)
2798
+	{
2738 2799
 		global $WT_TREE;
2739 2800
 
2740 2801
 		if (empty($gedrec)) {
@@ -2810,7 +2871,8 @@  discard block
 block discarded – undo
2810 2871
 	 *
2811 2872
 	 * @return string
2812 2873
 	 */
2813
-	private function substituteVars($expression, $quote) {
2874
+	private function substituteVars($expression, $quote)
2875
+	{
2814 2876
 		$that = $this; // PHP5.3 cannot access $this inside a closure
2815 2877
 		return preg_replace_callback(
2816 2878
 			'/\$(\w+)/',
Please login to merge, or discard this patch.
app/GedcomCode/GedcomCodeTemp.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -57,14 +57,14 @@
 block discarded – undo
57 57
 			'MADRI', 'MANAU', 'MANHA', 'MANIL', 'MANTI', 'MEDFO', 'MELBO', 'MEMPH',
58 58
 			'MERID', 'MEXIC', 'MNTVD', 'MONTE', 'MONTI', 'MONTR', 'MTIMP', 'NASHV',
59 59
 			'NAUV2', 'NAUVO', 'NBEAC', 'NUKUA', 'NYORK', 'NZEAL', 'OAKLA', 'OAXAC',
60
-			'OGDEN', 'OKLAH',	'OQUIR', 'ORLAN', 'PALEG', 'PALMY', 'PANAM', 'PAPEE',
61
-			'PAYSO', 'PERTH',	'PHOEN', 'POFFI', 'PORTL', 'PREST', 'PROCC', 'PROVO',
60
+			'OGDEN', 'OKLAH', 'OQUIR', 'ORLAN', 'PALEG', 'PALMY', 'PANAM', 'PAPEE',
61
+			'PAYSO', 'PERTH', 'PHOEN', 'POFFI', 'PORTL', 'PREST', 'PROCC', 'PROVO',
62 62
 			'QUETZ', 'RALEI', 'RECIF', 'REDLA', 'REGIN', 'RENO', 'REXBU', 'SACRA',
63
-			'SAMOA', 'SANTI',	'SANSA', 'SANTO', 'SDIEG', 'SDOMI', 'SEATT', 'SEOUL',
64
-			'SGEOR', 'SJOSE',	'SLAKE', 'SLOUI', 'SNOWF','SPAUL', 'SPMIN', 'SPOKA',
63
+			'SAMOA', 'SANTI', 'SANSA', 'SANTO', 'SDIEG', 'SDOMI', 'SEATT', 'SEOUL',
64
+			'SGEOR', 'SJOSE', 'SLAKE', 'SLOUI', 'SNOWF', 'SPAUL', 'SPMIN', 'SPOKA',
65 65
 			'STOCK', 'SUVA', 'SWISS', 'SYDNE', 'TAIPE', 'TAMPI', 'TEGUC', 'TGUTI',
66
-			'TIHUA', 'TOKYO',	'TORNO', 'TRUJI', 'TWINF', 'VANCO', 'VERAC', 'VERNA',
67
-			'VILLA', 'WASHI',	'WINTE',
66
+			'TIHUA', 'TOKYO', 'TORNO', 'TRUJI', 'TWINF', 'VANCO', 'VERAC', 'VERNA',
67
+			'VILLA', 'WASHI', 'WINTE',
68 68
 		);
69 69
 	}
70 70
 
Please login to merge, or discard this patch.
Braces   +10 added lines, -5 removed lines patch added patch discarded remove patch
@@ -20,7 +20,8 @@  discard block
 block discarded – undo
20 20
 /**
21 21
  * Class GedcomCodeTemp - Functions and logic for GEDCOM "TEMP" codes
22 22
  */
23
-class GedcomCodeTemp {
23
+class GedcomCodeTemp
24
+{
24 25
 	/**
25 26
 	 * A list of GEDCOM tags that require a TEMP subtag
26 27
 	 *
@@ -28,7 +29,8 @@  discard block
 block discarded – undo
28 29
 	 *
29 30
 	 * @return bool
30 31
 	 */
31
-	public static function isTagLDS($tag) {
32
+	public static function isTagLDS($tag)
33
+	{
32 34
 		return $tag === 'BAPL' || $tag === 'CONL' || $tag === 'ENDL' || $tag === 'SLGC' || $tag === 'SLGS';
33 35
 	}
34 36
 
@@ -43,7 +45,8 @@  discard block
 block discarded – undo
43 45
 	 *
44 46
 	 * @return string[]
45 47
 	 */
46
-	public static function templeCodes() {
48
+	public static function templeCodes()
49
+	{
47 50
 		return array(
48 51
 			'ABA', 'ACCRA', 'ADELA', 'ALBER', 'ALBUQ', 'ANCHO', 'ARIZO', 'ASUNC',
49 52
 			'ATLAN', 'BAIRE', 'BILLI', 'BIRMI', 'BISMA', 'BOGOT', 'BOISE', 'BOSTO',
@@ -75,7 +78,8 @@  discard block
 block discarded – undo
75 78
 	 *
76 79
 	 * @return string
77 80
 	 */
78
-	public static function templeName($temple_code) {
81
+	public static function templeName($temple_code)
82
+	{
79 83
 		switch ($temple_code) {
80 84
 		case 'ABA':
81 85
 			return /* I18N: Location of an LDS church temple */ I18N::translate('Aba, Nigeria');
@@ -397,7 +401,8 @@  discard block
 block discarded – undo
397 401
 	 *
398 402
 	 * @return string[]
399 403
 	 */
400
-	public static function templeNames() {
404
+	public static function templeNames()
405
+	{
401 406
 		$temple_names = array();
402 407
 		foreach (self::templeCodes() as $temple_code) {
403 408
 			$temple_names[$temple_code] = self::templeName($temple_code);
Please login to merge, or discard this patch.
edituser.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@
 block discarded – undo
44 44
 $form_pass2          = Filter::post('form_pass2', WT_REGEX_PASSWORD);
45 45
 $form_email          = Filter::postEmail('form_email');
46 46
 $form_rootid         = Filter::post('form_rootid', WT_REGEX_XREF);
47
-$form_theme          = Filter::post('form_theme', implode('|', array_keys(Theme::themeNames())), '');;
47
+$form_theme          = Filter::post('form_theme', implode('|', array_keys(Theme::themeNames())), ''); ;
48 48
 $form_language       = Filter::post('form_language');
49 49
 $form_timezone       = Filter::post('form_timezone');
50 50
 $form_contact_method = Filter::post('form_contact_method');
Please login to merge, or discard this 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/Functions/FunctionsPrintLists.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1820,24 +1820,24 @@
 block discarded – undo
1820 1820
 			if ($endjd === WT_CLIENT_JD) {
1821 1821
 				// We're dealing with the Today’s Events block
1822 1822
 				if ($filter === 0) {
1823
-					$html .=  I18N::translate('No events exist for today.');
1823
+					$html .= I18N::translate('No events exist for today.');
1824 1824
 				} else {
1825
-					$html .=  I18N::translate('No events for living individuals exist for today.');
1825
+					$html .= I18N::translate('No events for living individuals exist for today.');
1826 1826
 				}
1827 1827
 			} else {
1828 1828
 				// We're dealing with the Upcoming Events block
1829 1829
 				if ($filter === 0) {
1830 1830
 					if ($endjd === $startjd) {
1831
-						$html .=  I18N::translate('No events exist for tomorrow.');
1831
+						$html .= I18N::translate('No events exist for tomorrow.');
1832 1832
 					} else {
1833
-						$html .=  /* I18N: translation for %s==1 is unused; it is translated separately as ā€œtomorrowā€ */ I18N::plural('No events exist for the next %s day.', 'No events exist for the next %s days.', $endjd - $startjd + 1, I18N::number($endjd - $startjd + 1));
1833
+						$html .= /* I18N: translation for %s==1 is unused; it is translated separately as ā€œtomorrowā€ */ I18N::plural('No events exist for the next %s day.', 'No events exist for the next %s days.', $endjd - $startjd + 1, I18N::number($endjd - $startjd + 1));
1834 1834
 					}
1835 1835
 				} else {
1836 1836
 					if ($endjd === $startjd) {
1837
-						$html .=  I18N::translate('No events for living individuals exist for tomorrow.');
1837
+						$html .= I18N::translate('No events for living individuals exist for tomorrow.');
1838 1838
 					} else {
1839 1839
 						// I18N: translation for %s==1 is unused; it is translated separately as ā€œtomorrowā€
1840
-						$html .=  I18N::plural('No events for living people exist for the next %s day.', 'No events for living people exist for the next %s days.', $endjd - $startjd + 1, I18N::number($endjd - $startjd + 1));
1840
+						$html .= I18N::plural('No events for living people exist for the next %s day.', 'No events for living people exist for the next %s days.', $endjd - $startjd + 1, I18N::number($endjd - $startjd + 1));
1841 1841
 					}
1842 1842
 				}
1843 1843
 			}
Please login to merge, or discard this patch.
Braces   +30 added lines, -15 removed lines patch added patch discarded remove patch
@@ -37,7 +37,8 @@  discard block
 block discarded – undo
37 37
 /**
38 38
  * Class FunctionsPrintLists - create sortable lists using datatables.net
39 39
  */
40
-class FunctionsPrintLists {
40
+class FunctionsPrintLists
41
+{
41 42
 	/**
42 43
 	 * Generate a SURN,GIVN and GIVN,SURN sortable name for an individual.
43 44
 	 * This allows table data to sort by surname or given names.
@@ -50,7 +51,8 @@  discard block
 block discarded – undo
50 51
 	 *
51 52
 	 * @return string[]
52 53
 	 */
53
-	private static function sortableNames(Individual $individual) {
54
+	private static function sortableNames(Individual $individual)
55
+	{
54 56
 		$names   = $individual->getAllNames();
55 57
 		$primary = $individual->getPrimaryName();
56 58
 
@@ -73,7 +75,8 @@  discard block
 block discarded – undo
73 75
 	 *
74 76
 	 * @return string
75 77
 	 */
76
-	public static function individualTable($indiviudals, $option = '') {
78
+	public static function individualTable($indiviudals, $option = '')
79
+	{
77 80
 		global $controller, $WT_TREE;
78 81
 
79 82
 		$table_id = 'table-indi-' . Uuid::uuid4(); // lists requires a unique ID in case there are multiple lists per page
@@ -516,7 +519,8 @@  discard block
 block discarded – undo
516 519
 	 *
517 520
 	 * @return string
518 521
 	 */
519
-	public static function familyTable($families) {
522
+	public static function familyTable($families)
523
+	{
520 524
 		global $WT_TREE, $controller;
521 525
 
522 526
 		$table_id = 'table-fam-' . Uuid::uuid4(); // lists requires a unique ID in case there are multiple lists per page
@@ -985,7 +989,8 @@  discard block
 block discarded – undo
985 989
 	 *
986 990
 	 * @return string
987 991
 	 */
988
-	public static function sourceTable($sources) {
992
+	public static function sourceTable($sources)
993
+	{
989 994
 		global $WT_TREE, $controller;
990 995
 
991 996
 		// Count the number of linked records. These numbers include private records.
@@ -1112,7 +1117,8 @@  discard block
 block discarded – undo
1112 1117
 	 *
1113 1118
 	 * @return string
1114 1119
 	 */
1115
-	public static function noteTable($notes) {
1120
+	public static function noteTable($notes)
1121
+	{
1116 1122
 		global $WT_TREE, $controller;
1117 1123
 
1118 1124
 		// Count the number of linked records. These numbers include private records.
@@ -1218,7 +1224,8 @@  discard block
 block discarded – undo
1218 1224
 	 *
1219 1225
 	 * @return string
1220 1226
 	 */
1221
-	public static function repositoryTable($repositories) {
1227
+	public static function repositoryTable($repositories)
1228
+	{
1222 1229
 		global $WT_TREE, $controller;
1223 1230
 
1224 1231
 		// Count the number of linked records. These numbers include private records.
@@ -1311,7 +1318,8 @@  discard block
 block discarded – undo
1311 1318
 	 *
1312 1319
 	 * @return string
1313 1320
 	 */
1314
-	public static function mediaTable($media_objects) {
1321
+	public static function mediaTable($media_objects)
1322
+	{
1315 1323
 		global $WT_TREE, $controller;
1316 1324
 
1317 1325
 		$html     = '';
@@ -1404,7 +1412,8 @@  discard block
 block discarded – undo
1404 1412
 	 *
1405 1413
 	 * @return string
1406 1414
 	 */
1407
-	public static function surnameTable($surnames, $script, Tree $tree) {
1415
+	public static function surnameTable($surnames, $script, Tree $tree)
1416
+	{
1408 1417
 		global $controller;
1409 1418
 
1410 1419
 		$html = '';
@@ -1494,7 +1503,8 @@  discard block
 block discarded – undo
1494 1503
 	 *
1495 1504
 	 * @return string
1496 1505
 	 */
1497
-	public static function surnameTagCloud($surnames, $script, $totals, Tree $tree) {
1506
+	public static function surnameTagCloud($surnames, $script, $totals, Tree $tree)
1507
+	{
1498 1508
 		$minimum = PHP_INT_MAX;
1499 1509
 		$maximum = 1;
1500 1510
 		foreach ($surnames as $surn => $surns) {
@@ -1537,7 +1547,8 @@  discard block
 block discarded – undo
1537 1547
 	 *
1538 1548
 	 * @return string
1539 1549
 	 */
1540
-	public static function surnameList($surnames, $style, $totals, $script, Tree $tree) {
1550
+	public static function surnameList($surnames, $style, $totals, $script, Tree $tree)
1551
+	{
1541 1552
 		$html = array();
1542 1553
 		foreach ($surnames as $surn => $surns) {
1543 1554
 			// Each surname links back to the indilist
@@ -1616,7 +1627,8 @@  discard block
 block discarded – undo
1616 1627
 	 *
1617 1628
 	 * @return string
1618 1629
 	 */
1619
-	public static function eventsTable($startjd, $endjd, $events = 'BIRT MARR DEAT', $only_living = false, $sort_by = 'anniv') {
1630
+	public static function eventsTable($startjd, $endjd, $events = 'BIRT MARR DEAT', $only_living = false, $sort_by = 'anniv')
1631
+	{
1620 1632
 		global $controller, $WT_TREE;
1621 1633
 
1622 1634
 		$html     = '';
@@ -1746,7 +1758,8 @@  discard block
 block discarded – undo
1746 1758
 	 *
1747 1759
 	 * @return string
1748 1760
 	 */
1749
-	public static function eventsList($startjd, $endjd, $events = 'BIRT MARR DEAT', $only_living = false, $sort_by = 'anniv') {
1761
+	public static function eventsList($startjd, $endjd, $events = 'BIRT MARR DEAT', $only_living = false, $sort_by = 'anniv')
1762
+	{
1750 1763
 		global $WT_TREE;
1751 1764
 
1752 1765
 		// Did we have any output? Did we skip anything?
@@ -1856,7 +1869,8 @@  discard block
 block discarded – undo
1856 1869
 	 *
1857 1870
 	 * @return string
1858 1871
 	 */
1859
-	public static function chartByAge($data, $title) {
1872
+	public static function chartByAge($data, $title)
1873
+	{
1860 1874
 		$count  = 0;
1861 1875
 		$agemax = 0;
1862 1876
 		$vmax   = 0;
@@ -1927,7 +1941,8 @@  discard block
 block discarded – undo
1927 1941
 	 *
1928 1942
 	 * @return string
1929 1943
 	 */
1930
-	public static function chartByDecade($data, $title) {
1944
+	public static function chartByDecade($data, $title)
1945
+	{
1931 1946
 		$count = 0;
1932 1947
 		$vmax  = 0;
1933 1948
 		foreach ($data as $v) {
Please login to merge, or discard this patch.
app/Family.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -343,7 +343,7 @@  discard block
 block discarded – undo
343 343
 			// Check the script used by each name, so we can match cyrillic with cyrillic, greek with greek, etc.
344 344
 			$husb_names = array();
345 345
 			if ($this->husb) {
346
-				$husb_names = array_filter($this->husb->getAllNames(), function(array $x) { return $x['type'] !== '_MARNM'; } );
346
+				$husb_names = array_filter($this->husb->getAllNames(), function (array $x) { return $x['type'] !== '_MARNM'; } );
347 347
 			}
348 348
 			// If the individual only has married names, create a dummy birth name.
349 349
 			if (empty($husb_names)) {
@@ -359,7 +359,7 @@  discard block
 block discarded – undo
359 359
 
360 360
 			$wife_names = array();
361 361
 			if ($this->wife) {
362
-				$wife_names = array_filter($this->wife->getAllNames(), function(array $x) { return $x['type'] !== '_MARNM'; } );
362
+				$wife_names = array_filter($this->wife->getAllNames(), function (array $x) { return $x['type'] !== '_MARNM'; } );
363 363
 			}
364 364
 			// If the individual only has married names, create a dummy birth name.
365 365
 			if (empty($wife_names)) {
Please login to merge, or discard this 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.
admin_module_reports.php 1 patch
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -74,8 +74,11 @@
 block discarded – undo
74 74
 				<td class="col-xs-2">
75 75
 					<?php if ($module instanceof ModuleConfigInterface): ?>
76 76
 						<a href="<?php echo $module->getConfigLink(); ?>"><?php echo $module->getTitle(); ?> <i class="fa fa-cogs"></i></a>
77
-					<?php else: ?>
78
-						<?php echo $module->getTitle(); ?>
77
+					<?php else {
78
+    : ?>
79
+						<?php echo $module->getTitle();
80
+}
81
+?>
79 82
 					<?php endif; ?>
80 83
 				</td>
81 84
 				<td class="col-xs-5"><?php echo $module->getDescription(); ?></td>
Please login to merge, or discard this patch.
themes/_custom/theme.php 1 patch
Braces   +10 added lines, -5 removed lines patch added patch discarded remove patch
@@ -31,14 +31,16 @@  discard block
 block discarded – undo
31 31
  * Only the first two functions are required: themeId() and themeName().
32 32
  * The rest are just examples, and should be removed in actual themes.
33 33
  */
34
-class MyTheme extends WebtreesTheme {
34
+class MyTheme extends WebtreesTheme
35
+{
35 36
 	/**
36 37
 	 * Give your theme a unique identifier. Themes beginning with an underscore
37 38
 	 * are reserved for internal use.
38 39
 	 *
39 40
 	 * {@inheritdoc}
40 41
 	 */
41
-	public function themeId() {
42
+	public function themeId()
43
+	{
42 44
 		return '_custom';
43 45
 	}
44 46
 
@@ -51,7 +53,8 @@  discard block
 block discarded – undo
51 53
 	 *
52 54
 	 * {@inheritdoc}
53 55
 	 */
54
-	public function themeName() {
56
+	public function themeName()
57
+	{
55 58
 		return 'Custom theme';
56 59
 	}
57 60
 
@@ -60,7 +63,8 @@  discard block
 block discarded – undo
60 63
 	 *
61 64
 	 * {@inheritdoc}
62 65
 	 */
63
-	public function stylesheets() {
66
+	public function stylesheets()
67
+	{
64 68
 		$css_files   = parent::stylesheets();
65 69
 		// Put a version number in the URL, to prevent browsers from caching old versions.
66 70
 		$css_files[] = WT_BASE_URL . 'themes/_custom/custom-v1.0.css';
@@ -75,7 +79,8 @@  discard block
 block discarded – undo
75 79
 	 *
76 80
 	 * {@inheritdoc}
77 81
 	 */
78
-	public function menuLists($surname) {
82
+	public function menuLists($surname)
83
+	{
79 84
 		// Start with the default "Lists" menu.
80 85
 		$menu = parent::menuLists($surname);
81 86
 		// Remove the "notes" sub-menu.
Please login to merge, or discard this patch.
statisticsplot.php 1 patch
Braces   +30 added lines, -15 removed lines patch added patch discarded remove patch
@@ -36,7 +36,8 @@  discard block
 block discarded – undo
36 36
  *
37 37
  * @return int
38 38
  */
39
-function month_of_birth($z_axis, array $z_boundaries, Stats $stats) {
39
+function month_of_birth($z_axis, array $z_boundaries, Stats $stats)
40
+{
40 41
 	$total = 0;
41 42
 
42 43
 	if ($z_axis === 300) {
@@ -92,7 +93,8 @@  discard block
 block discarded – undo
92 93
  *
93 94
  * @return int
94 95
  */
95
-function month_of_birth_of_first_child($z_axis, array $z_boundaries, Stats $stats) {
96
+function month_of_birth_of_first_child($z_axis, array $z_boundaries, Stats $stats)
97
+{
96 98
 	$total = 0;
97 99
 
98 100
 	if ($z_axis === 300) {
@@ -148,7 +150,8 @@  discard block
 block discarded – undo
148 150
  *
149 151
  * @return int
150 152
  */
151
-function month_of_death($z_axis, array $z_boundaries, Stats $stats) {
153
+function month_of_death($z_axis, array $z_boundaries, Stats $stats)
154
+{
152 155
 	$total = 0;
153 156
 
154 157
 	if ($z_axis === 300) {
@@ -204,7 +207,8 @@  discard block
 block discarded – undo
204 207
  *
205 208
  * @return int
206 209
  */
207
-function month_of_marriage($z_axis, array $z_boundaries, Stats $stats) {
210
+function month_of_marriage($z_axis, array $z_boundaries, Stats $stats)
211
+{
208 212
 	$total = 0;
209 213
 
210 214
 	if ($z_axis === 300) {
@@ -245,7 +249,8 @@  discard block
 block discarded – undo
245 249
  *
246 250
  * @return int
247 251
  */
248
-function month_of_first_marriage($z_axis, array $z_boundaries, Stats $stats) {
252
+function month_of_first_marriage($z_axis, array $z_boundaries, Stats $stats)
253
+{
249 254
 	$total = 0;
250 255
 
251 256
 	if ($z_axis === 300) {
@@ -298,7 +303,8 @@  discard block
 block discarded – undo
298 303
  *
299 304
  * @return int
300 305
  */
301
-function lifespan_by_birth_year($z_axis, array $z_boundaries, Stats $stats) {
306
+function lifespan_by_birth_year($z_axis, array $z_boundaries, Stats $stats)
307
+{
302 308
 	$total = 0;
303 309
 
304 310
 	if ($z_axis === 300) {
@@ -350,7 +356,8 @@  discard block
 block discarded – undo
350 356
  *
351 357
  * @return int
352 358
  */
353
-function lifespan_by_death_year($z_axis, array $z_boundaries, Stats $stats) {
359
+function lifespan_by_death_year($z_axis, array $z_boundaries, Stats $stats)
360
+{
354 361
 	$total = 0;
355 362
 
356 363
 	if ($z_axis === 300) {
@@ -402,7 +409,8 @@  discard block
 block discarded – undo
402 409
  *
403 410
  * @return int
404 411
  */
405
-function age_at_marriage($z_axis, array $z_boundaries, Stats $stats) {
412
+function age_at_marriage($z_axis, array $z_boundaries, Stats $stats)
413
+{
406 414
 	$total = 0;
407 415
 
408 416
 	if ($z_axis === 300) {
@@ -456,7 +464,8 @@  discard block
 block discarded – undo
456 464
  *
457 465
  * @return int
458 466
  */
459
-function age_at_first_marriage($z_axis, array $z_boundaries, Stats $stats) {
467
+function age_at_first_marriage($z_axis, array $z_boundaries, Stats $stats)
468
+{
460 469
 	$total = 0;
461 470
 
462 471
 	if ($z_axis === 300) {
@@ -533,7 +542,8 @@  discard block
 block discarded – undo
533 542
  *
534 543
  * @return int
535 544
  */
536
-function number_of_children($z_axis, array $z_boundaries, Stats $stats) {
545
+function number_of_children($z_axis, array $z_boundaries, Stats $stats)
546
+{
537 547
 	$total = 0;
538 548
 
539 549
 	if ($z_axis === 300) {
@@ -575,7 +585,8 @@  discard block
 block discarded – undo
575 585
  * @param int $x
576 586
  * @param int $val
577 587
  */
578
-function fill_y_data($z, $x, $val) {
588
+function fill_y_data($z, $x, $val)
589
+{
579 590
 	global $ydata, $xmax, $x_boundaries, $zmax, $z_boundaries, $xgiven, $zgiven;
580 591
 	//-- calculate index $i out of given z value
581 592
 	//-- calculate index $j out of given x value
@@ -612,7 +623,8 @@  discard block
 block discarded – undo
612 623
  * @param string      $ytitle
613 624
  * @param string[]    $legend
614 625
  */
615
-function my_plot($mytitle, $xdata, $xtitle, $ydata, $ytitle, $legend) {
626
+function my_plot($mytitle, $xdata, $xtitle, $ydata, $ytitle, $legend)
627
+{
616 628
 	global $percentage, $male_female, $ymax, $scalefactor, $datastring, $imgurl;
617 629
 
618 630
 	// Google Chart API only allows text encoding for numbers less than 100
@@ -752,7 +764,8 @@  discard block
 block discarded – undo
752 764
  *
753 765
  * @param string $x_axis_boundaries
754 766
  */
755
-function calculate_axis($x_axis_boundaries) {
767
+function calculate_axis($x_axis_boundaries)
768
+{
756 769
 	global $x_axis, $xdata, $xmax, $x_boundaries;
757 770
 
758 771
 	// Calculate xdata and zdata elements out of chart values
@@ -801,7 +814,8 @@  discard block
 block discarded – undo
801 814
  *
802 815
  * @return string
803 816
  */
804
-function format_range_of_numbers($x, $y) {
817
+function format_range_of_numbers($x, $y)
818
+{
805 819
 	return /* I18N: A range of numbers */ I18N::translate(
806 820
 		'%1$s–%2$s',
807 821
 		I18N::number($x),
@@ -814,7 +828,8 @@  discard block
 block discarded – undo
814 828
  *
815 829
  * @param string $boundaries_z_axis
816 830
  */
817
-function calculate_legend($boundaries_z_axis) {
831
+function calculate_legend($boundaries_z_axis)
832
+{
818 833
 	global $legend, $zmax, $z_boundaries;
819 834
 
820 835
 	// calculate the legend values
Please login to merge, or discard this patch.