Completed
Push — 1.7 ( ce7091...0d97cf )
by Greg
14:14 queued 07:41
created
app/Controller/CompactController.php 1 patch
Braces   +8 added lines, -4 removed lines patch added patch discarded remove patch
@@ -21,7 +21,8 @@  discard block
 block discarded – undo
21 21
 /**
22 22
  * Controller for the compact chart
23 23
  */
24
-class CompactController extends ChartController {
24
+class CompactController extends ChartController
25
+{
25 26
 	/** @var bool Data for the view .*/
26 27
 	public $show_thumbs = false;
27 28
 
@@ -31,7 +32,8 @@  discard block
 block discarded – undo
31 32
 	/**
32 33
 	 * Startup activity
33 34
 	 */
34
-	public function __construct() {
35
+	public function __construct()
36
+	{
35 37
 		parent::__construct();
36 38
 
37 39
 		// Extract the request parameters
@@ -55,7 +57,8 @@  discard block
 block discarded – undo
55 57
 	 *
56 58
 	 * @return string
57 59
 	 */
58
-	public function sosaIndividual($n) {
60
+	public function sosaIndividual($n)
61
+	{
59 62
 		$indi = $this->treeid[$n];
60 63
 
61 64
 		if ($indi && $indi->canShowName()) {
@@ -109,7 +112,8 @@  discard block
 block discarded – undo
109 112
 	 *
110 113
 	 * @return string
111 114
 	 */
112
-	public function sosaArrow($n, $arrow_dir) {
115
+	public function sosaArrow($n, $arrow_dir)
116
+	{
113 117
 		$indi = $this->treeid[$n];
114 118
 
115 119
 		$arrow_dir = substr($arrow_dir, 0, 1);
Please login to merge, or discard this patch.
app/Controller/DescendancyController.php 1 patch
Braces   +14 added lines, -7 removed lines patch added patch discarded remove patch
@@ -28,7 +28,8 @@  discard block
 block discarded – undo
28 28
 /**
29 29
  * Controller for the descendancy chart
30 30
  */
31
-class DescendancyController extends ChartController {
31
+class DescendancyController extends ChartController
32
+{
32 33
 	/** @var int Show boxes for cousins */
33 34
 	public $show_cousins;
34 35
 
@@ -47,7 +48,8 @@  discard block
 block discarded – undo
47 48
 	/**
48 49
 	 * Create the descendancy controller
49 50
 	 */
50
-	public function __construct() {
51
+	public function __construct()
52
+	{
51 53
 		global $WT_TREE;
52 54
 
53 55
 		parent::__construct();
@@ -74,7 +76,8 @@  discard block
 block discarded – undo
74 76
 	 * @param string     $label
75 77
 	 * @param string     $gpid
76 78
 	 */
77
-	public function printChildFamily(Individual $person, $depth, $label = '1.', $gpid = '') {
79
+	public function printChildFamily(Individual $person, $depth, $label = '1.', $gpid = '')
80
+	{
78 81
 
79 82
 		if ($depth < 2) {
80 83
 			return;
@@ -94,7 +97,8 @@  discard block
 block discarded – undo
94 97
 	 * @param Individual $person
95 98
 	 * @param int        $depth the descendancy depth to show
96 99
 	 */
97
-	public function printChildDescendancy(Individual $person, $depth) {
100
+	public function printChildDescendancy(Individual $person, $depth)
101
+	{
98 102
 		echo "<li>";
99 103
 		echo "<table><tr><td>";
100 104
 		if ($depth == $this->generations) {
@@ -160,7 +164,8 @@  discard block
 block discarded – undo
160 164
 	 * @param Family     $family
161 165
 	 * @param int        $depth the descendancy depth to show
162 166
 	 */
163
-	private function printFamilyDescendancy(Individual $person, Family $family, $depth) {
167
+	private function printFamilyDescendancy(Individual $person, Family $family, $depth)
168
+	{
164 169
 		$uid = Uuid::uuid4(); // create a unique ID
165 170
 		// print marriage info
166 171
 		echo '<li>';
@@ -233,7 +238,8 @@  discard block
 block discarded – undo
233 238
 	 *
234 239
 	 * @return Individual[]
235 240
 	 */
236
-	public function individualDescendancy(Individual $person, $n, $array) {
241
+	public function individualDescendancy(Individual $person, $n, $array)
242
+	{
237 243
 		if ($n < 1) {
238 244
 			return $array;
239 245
 		}
@@ -260,7 +266,8 @@  discard block
 block discarded – undo
260 266
 	 *
261 267
 	 * @return Family[]
262 268
 	 */
263
-	public function familyDescendancy($person, $n, $array) {
269
+	public function familyDescendancy($person, $n, $array)
270
+	{
264 271
 		if ($n < 1) {
265 272
 			return $array;
266 273
 		}
Please login to merge, or discard this patch.
app/Controller/ChartController.php 1 patch
Braces   +12 added lines, -6 removed lines patch added patch discarded remove patch
@@ -23,7 +23,8 @@  discard block
 block discarded – undo
23 23
 /**
24 24
  * Base controller for all chart pages
25 25
  */
26
-class ChartController extends PageController {
26
+class ChartController extends PageController
27
+{
27 28
 	/** @var Individual Who is chart about? */
28 29
 	public $root;
29 30
 
@@ -40,7 +41,8 @@  discard block
 block discarded – undo
40 41
 	 *
41 42
 	 * @param int $show_full needed for use by charts module
42 43
 	 */
43
-	public function __construct($show_full = 1) {
44
+	public function __construct($show_full = 1)
45
+	{
44 46
 		global $WT_TREE;
45 47
 
46 48
 		parent::__construct();
@@ -80,7 +82,8 @@  discard block
 block discarded – undo
80 82
 	 *
81 83
 	 * @return Individual
82 84
 	 */
83
-	public function getSignificantIndividual() {
85
+	public function getSignificantIndividual()
86
+	{
84 87
 		if ($this->root) {
85 88
 			return $this->root;
86 89
 		} else {
@@ -95,7 +98,8 @@  discard block
 block discarded – undo
95 98
 	 *
96 99
 	 * @return Individual[]
97 100
 	 */
98
-	public function sosaAncestors($generations) {
101
+	public function sosaAncestors($generations)
102
+	{
99 103
 		$ancestors = array(
100 104
 			1 => $this->root,
101 105
 		);
@@ -128,7 +132,8 @@  discard block
 block discarded – undo
128 132
 	 *
129 133
 	 * @return bool
130 134
 	 */
131
-	public function showFull() {
135
+	public function showFull()
136
+	{
132 137
 		return $this->show_full;
133 138
 	}
134 139
 
@@ -137,7 +142,8 @@  discard block
 block discarded – undo
137 142
 	 *
138 143
 	 * @return \stdClass
139 144
 	 */
140
-	public function getBoxDimensions() {
145
+	public function getBoxDimensions()
146
+	{
141 147
 		return $this->box;
142 148
 	}
143 149
 }
Please login to merge, or discard this patch.
app/Controller/RelationshipController.php 1 patch
Braces   +10 added lines, -5 removed lines patch added patch discarded remove patch
@@ -24,7 +24,8 @@  discard block
 block discarded – undo
24 24
 /**
25 25
  * Controller for the relationships calculations
26 26
  */
27
-class RelationshipController extends PageController {
27
+class RelationshipController extends PageController
28
+{
28 29
 	/**
29 30
 	 * Calculate the shortest paths - or all paths - between two individuals.
30 31
 	 *
@@ -35,7 +36,8 @@  discard block
 block discarded – undo
35 36
 	 *
36 37
 	 * @return string[][]
37 38
 	 */
38
-	public function calculateRelationships(Individual $individual1, Individual $individual2, $recursion, $ancestor = false) {
39
+	public function calculateRelationships(Individual $individual1, Individual $individual2, $recursion, $ancestor = false)
40
+	{
39 41
 
40 42
 		$rows = Database::prepare(
41 43
 			"SELECT l_from, l_to FROM `##link` WHERE l_file = :tree_id AND l_type IN ('FAMS', 'FAMC')"
@@ -114,7 +116,8 @@  discard block
 block discarded – undo
114 116
 	 *
115 117
 	 * @return string[]
116 118
 	 */
117
-	public function oldStyleRelationshipPath(array $path) {
119
+	public function oldStyleRelationshipPath(array $path)
120
+	{
118 121
 		global $WT_TREE;
119 122
 
120 123
 		$spouse_codes  = array('M' => 'hus', 'F' => 'wif', 'U' => 'spo');
@@ -160,7 +163,8 @@  discard block
 block discarded – undo
160 163
 	 *
161 164
 	 * @return array
162 165
 	 */
163
-	private function allAncestors($xref1, $xref2, $tree_id) {
166
+	private function allAncestors($xref1, $xref2, $tree_id)
167
+	{
164 168
 		$ancestors = array($xref1, $xref2);
165 169
 
166 170
 		$queue = array($xref1, $xref2);
@@ -199,7 +203,8 @@  discard block
 block discarded – undo
199 203
 	 *
200 204
 	 * @return array
201 205
 	 */
202
-	private function excludeFamilies($xref1, $xref2, $tree_id) {
206
+	private function excludeFamilies($xref1, $xref2, $tree_id)
207
+	{
203 208
 		return Database::prepare(
204 209
 			"SELECT l_to" .
205 210
 			" FROM `##link` AS l1" .
Please login to merge, or discard this patch.
app/Controller/PageController.php 1 patch
Braces   +24 added lines, -12 removed lines patch added patch discarded remove patch
@@ -27,7 +27,8 @@  discard block
 block discarded – undo
27 27
 /**
28 28
  * Controller for full-page, themed HTML responses
29 29
  */
30
-class PageController extends BaseController {
30
+class PageController extends BaseController
31
+{
31 32
 	/** @var string Most pages are not intended for robots */
32 33
 	private $meta_robots = 'noindex,nofollow';
33 34
 
@@ -44,7 +45,8 @@  discard block
 block discarded – undo
44 45
 	 *
45 46
 	 * @return $this
46 47
 	 */
47
-	public function setPageTitle($page_title) {
48
+	public function setPageTitle($page_title)
49
+	{
48 50
 		$this->page_title = $page_title;
49 51
 
50 52
 		return $this;
@@ -55,7 +57,8 @@  discard block
 block discarded – undo
55 57
 	 *
56 58
 	 * @return string
57 59
 	 */
58
-	public function getPageTitle() {
60
+	public function getPageTitle()
61
+	{
59 62
 		return $this->page_title;
60 63
 	}
61 64
 
@@ -66,7 +69,8 @@  discard block
 block discarded – undo
66 69
 	 *
67 70
 	 * @return $this
68 71
 	 */
69
-	public function setMetaRobots($meta_robots) {
72
+	public function setMetaRobots($meta_robots)
73
+	{
70 74
 		$this->meta_robots = $meta_robots;
71 75
 
72 76
 		return $this;
@@ -77,7 +81,8 @@  discard block
 block discarded – undo
77 81
 	 *
78 82
 	 * @return string
79 83
 	 */
80
-	public function getMetaRobots() {
84
+	public function getMetaRobots()
85
+	{
81 86
 		return $this->meta_robots;
82 87
 	}
83 88
 
@@ -88,7 +93,8 @@  discard block
 block discarded – undo
88 93
 	 *
89 94
 	 * @return $this
90 95
 	 */
91
-	public function restrictAccess($condition) {
96
+	public function restrictAccess($condition)
97
+	{
92 98
 		if ($condition !== true) {
93 99
 			header('Location: ' . WT_LOGIN_URL . '?url=' . rawurlencode(Functions::getQueryUrl()));
94 100
 			exit;
@@ -100,7 +106,8 @@  discard block
 block discarded – undo
100 106
 	/**
101 107
 	 * Print the page footer, using the theme
102 108
 	 */
103
-	public function pageFooter() {
109
+	public function pageFooter()
110
+	{
104 111
 		echo
105 112
 			Theme::theme()->footerContainer() .
106 113
 			'<!--[if lt IE 9]><script src="' . WT_JQUERY_JS_URL . '"></script><![endif]-->' .
@@ -122,7 +129,8 @@  discard block
 block discarded – undo
122 129
 	 * Print the page footer, using the theme
123 130
 	 * Note that popup windows are deprecated
124 131
 	 */
125
-	public function pageFooterPopupWindow() {
132
+	public function pageFooterPopupWindow()
133
+	{
126 134
 		echo
127 135
 			Theme::theme()->footerContainerPopupWindow() .
128 136
 			'<!--[if lt IE 9]><script src="' . WT_JQUERY_JS_URL . '"></script><![endif]-->' .
@@ -147,7 +155,8 @@  discard block
 block discarded – undo
147 155
 	 *
148 156
 	 * @return $this
149 157
 	 */
150
-	public function pageHeader($popup = false) {
158
+	public function pageHeader($popup = false)
159
+	{
151 160
 		global $WT_TREE;
152 161
 
153 162
 		$this->popup = $popup;
@@ -188,7 +197,8 @@  discard block
 block discarded – undo
188 197
 	 *
189 198
 	 * @return Individual
190 199
 	 */
191
-	public function getSignificantIndividual() {
200
+	public function getSignificantIndividual()
201
+	{
192 202
 		global $WT_TREE;
193 203
 
194 204
 		static $individual; // Only query the DB once.
@@ -224,7 +234,8 @@  discard block
 block discarded – undo
224 234
 	 *
225 235
 	 * @return Family
226 236
 	 */
227
-	public function getSignificantFamily() {
237
+	public function getSignificantFamily()
238
+	{
228 239
 		$individual = $this->getSignificantIndividual();
229 240
 		if ($individual) {
230 241
 			foreach ($individual->getChildFamilies() as $family) {
@@ -245,7 +256,8 @@  discard block
 block discarded – undo
245 256
 	 *
246 257
 	 * @return string
247 258
 	 */
248
-	public function getSignificantSurname() {
259
+	public function getSignificantSurname()
260
+	{
249 261
 		return '';
250 262
 	}
251 263
 }
Please login to merge, or discard this patch.
app/Controller/MediaController.php 1 patch
Braces   +8 added lines, -4 removed lines patch added patch discarded remove patch
@@ -27,11 +27,13 @@  discard block
 block discarded – undo
27 27
 /**
28 28
  * Controller for the media page
29 29
  */
30
-class MediaController extends GedcomRecordController {
30
+class MediaController extends GedcomRecordController
31
+{
31 32
 	/**
32 33
 	 * get edit menu
33 34
 	 */
34
-	public function getEditMenu() {
35
+	public function getEditMenu()
36
+	{
35 37
 		if (!$this->record || $this->record->isPendingDeletion()) {
36 38
 			return null;
37 39
 		}
@@ -84,7 +86,8 @@  discard block
 block discarded – undo
84 86
 	 *
85 87
 	 * @return Fact[]
86 88
 	 */
87
-	public function getFacts() {
89
+	public function getFacts()
90
+	{
88 91
 		$facts = $this->record->getFacts();
89 92
 
90 93
 		// Add some dummy facts to show additional information
@@ -110,7 +113,8 @@  discard block
 block discarded – undo
110 113
 	 *
111 114
 	 * @return string
112 115
 	 */
113
-	public static function getMediaListMenu(Media $mediaobject) {
116
+	public static function getMediaListMenu(Media $mediaobject)
117
+	{
114 118
 		$html = '';
115 119
 
116 120
 		$menu = new Menu(I18N::translate('Edit the details'), '#', 'lb-image_edit', array(
Please login to merge, or discard this patch.
app/Controller/LifespanController.php 1 patch
Braces   +16 added lines, -8 removed lines patch added patch discarded remove patch
@@ -37,7 +37,8 @@  discard block
 block discarded – undo
37 37
 /**
38 38
  * Controller for the timeline chart
39 39
  */
40
-class LifespanController extends PageController {
40
+class LifespanController extends PageController
41
+{
41 42
 	// Base color parameters
42 43
 	const RANGE           = 120; // degrees
43 44
 	const SATURATION      = 100; // percent
@@ -113,7 +114,8 @@  discard block
 block discarded – undo
113 114
 	/**
114 115
 	 * Startup activity
115 116
 	 */
116
-	public function __construct() {
117
+	public function __construct()
118
+	{
117 119
 		global $WT_TREE;
118 120
 
119 121
 		parent::__construct();
@@ -302,7 +304,8 @@  discard block
 block discarded – undo
302 304
 	 *
303 305
 	 * @return array
304 306
 	 */
305
-	private function addFamily(Individual $person, $add_family) {
307
+	private function addFamily(Individual $person, $add_family)
308
+	{
306 309
 		$xrefs   = array();
307 310
 		$xrefs[] = $person->getXref();
308 311
 		if ($add_family) {
@@ -333,7 +336,8 @@  discard block
 block discarded – undo
333 336
 	/**
334 337
 	 * Prints the time line scale
335 338
 	 */
336
-	public function printTimeline() {
339
+	public function printTimeline()
340
+	{
337 341
 		$startYear = $this->timelineMinYear;
338 342
 		while ($startYear < $this->timelineMaxYear) {
339 343
 			$date = new Date($this->calendarEscape . $startYear);
@@ -347,7 +351,8 @@  discard block
 block discarded – undo
347 351
 	 *
348 352
 	 * @return int
349 353
 	 */
350
-	public function fillTimeline() {
354
+	public function fillTimeline()
355
+	{
351 356
 		$rows = array();
352 357
 		$maxY = self::CHART_TOP;
353 358
 		//base case
@@ -480,7 +485,8 @@  discard block
 block discarded – undo
480 485
 	 *
481 486
 	 * @return bool
482 487
 	 */
483
-	public function checkFact(Fact $fact) {
488
+	public function checkFact(Fact $fact)
489
+	{
484 490
 		$valid = !in_array($fact->getTag(), $this->nonfacts);
485 491
 		if ($valid && $this->place_obj) {
486 492
 			$valid = stripos($fact->getPlace()->getGedcomName(), $this->place_obj->getGedcomName()) !== false;
@@ -507,7 +513,8 @@  discard block
 block discarded – undo
507 513
 	 *
508 514
 	 * @return object
509 515
 	 */
510
-	public function getCalendarDate($date) {
516
+	public function getCalendarDate($date)
517
+	{
511 518
 		switch ($this->calendar) {
512 519
 		case 'julian':
513 520
 			$caldate = new JulianDate($date);
@@ -536,7 +543,8 @@  discard block
 block discarded – undo
536 543
 	 *
537 544
 	 * @return string
538 545
 	 */
539
-	public function getCalendarOptionList() {
546
+	public function getCalendarOptionList()
547
+	{
540 548
 		$html = '';
541 549
 		foreach (Date::calendarNames() as $calendar => $name) {
542 550
 			$selected = $this->calendar === $calendar ? 'selected' : '';
Please login to merge, or discard this patch.
app/Controller/HourglassController.php 1 patch
Braces   +14 added lines, -7 removed lines patch added patch discarded remove patch
@@ -24,7 +24,8 @@  discard block
 block discarded – undo
24 24
 /**
25 25
  * Controller for the hourglass chart
26 26
  */
27
-class HourglassController extends ChartController {
27
+class HourglassController extends ChartController
28
+{
28 29
 	/** @var int Whether to show spouse details. */
29 30
 	public $show_spouse;
30 31
 
@@ -56,7 +57,8 @@  discard block
 block discarded – undo
56 57
 	 * @param int    $show_full
57 58
 	 * @param bool   $loadJS
58 59
 	 */
59
-	public function __construct($rootid = '', $show_full = 1, $loadJS = true) {
60
+	public function __construct($rootid = '', $show_full = 1, $loadJS = true)
61
+	{
60 62
 		global $WT_TREE;
61 63
 
62 64
 		parent::__construct($show_full);
@@ -93,7 +95,8 @@  discard block
 block discarded – undo
93 95
 	 * @param Individual $person ID of person to print the pedigree for
94 96
 	 * @param int        $count  generation count, so it recursively calls itself
95 97
 	 */
96
-	public function printPersonPedigree(Individual $person, $count) {
98
+	public function printPersonPedigree(Individual $person, $count)
99
+	{
97 100
 
98 101
 		if ($count >= $this->generations) {
99 102
 			return;
@@ -181,7 +184,8 @@  discard block
 block discarded – undo
181 184
 	 * @return string
182 185
 	 */
183 186
 
184
-	private function printEmptyBox() {
187
+	private function printEmptyBox()
188
+	{
185 189
 		return $this->showFull() ? Theme::theme()->individualBoxEmpty() : Theme::theme()->individualBoxSmallEmpty();
186 190
 	}
187 191
 
@@ -194,7 +198,8 @@  discard block
 block discarded – undo
194 198
 	 *
195 199
 	 * @return int
196 200
 	 */
197
-	public function printDescendency($person, $count, $showNav = true) {
201
+	public function printDescendency($person, $count, $showNav = true)
202
+	{
198 203
 		global $lastGenSecondFam;
199 204
 
200 205
 		if ($count > $this->dgenerations) {
@@ -381,7 +386,8 @@  discard block
 block discarded – undo
381 386
 	 *
382 387
 	 * @return int Number of generations the descendency actually goes
383 388
 	 */
384
-	private function maxDescendencyGenerations(Individual $individual, $depth) {
389
+	private function maxDescendencyGenerations(Individual $individual, $depth)
390
+	{
385 391
 		if ($depth > $this->generations) {
386 392
 			return $depth;
387 393
 		}
@@ -409,7 +415,8 @@  discard block
 block discarded – undo
409 415
 	/**
410 416
 	 * setup all of the javascript that is needed for the hourglass chart
411 417
 	 */
412
-	public function setupJavascript() {
418
+	public function setupJavascript()
419
+	{
413 420
 		$js = "
414 421
 			var WT_HOURGLASS_CHART = (function() {
415 422
 				function sizeLines() {
Please login to merge, or discard this patch.
app/Controller/BaseController.php 1 patch
Braces   +14 added lines, -7 removed lines patch added patch discarded remove patch
@@ -20,7 +20,8 @@  discard block
 block discarded – undo
20 20
 /**
21 21
  * Base controller for all other controllers
22 22
  */
23
-class BaseController {
23
+class BaseController
24
+{
24 25
 	// The controller accumulates Javascript (inline and external), and renders it in the footer
25 26
 	const JS_PRIORITY_HIGH   = 0;
26 27
 	const JS_PRIORITY_NORMAL = 1;
@@ -39,7 +40,8 @@  discard block
 block discarded – undo
39 40
 	/**
40 41
 	 * Startup activity
41 42
 	 */
42
-	public function __construct() {
43
+	public function __construct()
44
+	{
43 45
 	}
44 46
 
45 47
 	/**
@@ -49,7 +51,8 @@  discard block
 block discarded – undo
49 51
 	 *
50 52
 	 * @return $this
51 53
 	 */
52
-	public function addExternalJavascript($script_name) {
54
+	public function addExternalJavascript($script_name)
55
+	{
53 56
 		$this->external_javascript[$script_name] = true;
54 57
 
55 58
 		return $this;
@@ -65,7 +68,8 @@  discard block
 block discarded – undo
65 68
 	 *
66 69
 	 * @return $this
67 70
 	 */
68
-	public function addInlineJavascript($script, $priority = self::JS_PRIORITY_NORMAL) {
71
+	public function addInlineJavascript($script, $priority = self::JS_PRIORITY_NORMAL)
72
+	{
69 73
 		$tmp   = &$this->inline_javascript[$priority];
70 74
 		$tmp[] = $script;
71 75
 
@@ -78,7 +82,8 @@  discard block
 block discarded – undo
78 82
 	 *
79 83
 	 * @return string
80 84
 	 */
81
-	public function getJavascript() {
85
+	public function getJavascript()
86
+	{
82 87
 		$javascript1 = '';
83 88
 		$javascript2 = '';
84 89
 		$javascript3 = '';
@@ -120,7 +125,8 @@  discard block
 block discarded – undo
120 125
 	 *
121 126
 	 * @return $this
122 127
 	 */
123
-	public function pageHeader() {
128
+	public function pageHeader()
129
+	{
124 130
 		// We've displayed the header - display the footer automatically
125 131
 		register_shutdown_function(array($this, 'pageFooter'));
126 132
 
@@ -130,7 +136,8 @@  discard block
 block discarded – undo
130 136
 	/**
131 137
 	 * Print the page footer, using the theme
132 138
 	 */
133
-	public function pageFooter() {
139
+	public function pageFooter()
140
+	{
134 141
 		if (WT_DEBUG_SQL) {
135 142
 			echo Database::getQueryLog();
136 143
 		}
Please login to merge, or discard this patch.