Passed
Branch feature/2.0 (2da243)
by Jonathan
05:05
created
src/Webtrees/Controller/IndividualController.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 	 *
33 33
 	 * @param \Fisharebest\Webtrees\Controller\IndividualController $ctrl_individual_in The Individual Controller to extend
34 34
 	 */
35
-	public function __construct(fw\Controller\IndividualController $ctrl_individual_in){
35
+	public function __construct(fw\Controller\IndividualController $ctrl_individual_in) {
36 36
 		$this->ctrl_individual = $ctrl_individual_in;
37 37
 		$this->dindi = new mw\Individual($this->ctrl_individual->getSignificantIndividual());
38 38
 	}
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 	 * 
44 44
 	 * @uses \MyArtJaub\Webtrees\Hook\Hook
45 45
 	 */
46
-	public function printHeaderExtensions(){
46
+	public function printHeaderExtensions() {
47 47
 		$hook_extend_indi_header_left = new mw\Hook\Hook('hExtendIndiHeaderLeft');
48 48
 		$hook_extend_indi_header_right = new mw\Hook\Hook('hExtendIndiHeaderRight');
49 49
 		$hook_extend_indi_header_left = $hook_extend_indi_header_left->execute($this->ctrl_individual);
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 		echo '<div id="indi_perso_header">',
53 53
 			'<div id="indi_perso_header_left">';
54 54
 		foreach ($hook_extend_indi_header_left as $div) {
55
-			if(count($div)==2){
55
+			if (count($div) == 2) {
56 56
 				echo '<div id="', $div[0], '" class="indi_perso_header_left_div">',
57 57
 					$div[1], '</div>';
58 58
 			}
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 		echo '</div>',
61 61
 			'<div id="indi_perso_header_right">';
62 62
 		foreach ($hook_extend_indi_header_right as $div) {
63
-			if(count($div)==2){
63
+			if (count($div) == 2) {
64 64
 				echo '<div id="', $div[0], '" class="indi_perso_header_right_div">',
65 65
 					$div[1], '</div>';
66 66
 			}
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 	 *
76 76
 	 * @uses \MyArtJaub\Webtrees\Hook\Hook
77 77
 	 */
78
-	public function printHeaderExtraIcons(){
78
+	public function printHeaderExtraIcons() {
79 79
 		$hook_extend_indi_header_icons = new Hook('hExtendIndiHeaderIcons');
80 80
 		$hook_extend_indi_header_icons = $hook_extend_indi_header_icons->execute($this->ctrl_individual);
81 81
 		
Please login to merge, or discard this patch.
src/Webtrees/Mvc/Dispatcher.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -49,10 +49,10 @@  discard block
 block discarded – undo
49 49
     public function handle(fw\Module\AbstractModule $module, $request) {
50 50
 		
51 51
 		$fq_modclass_name = get_class($module);
52
-		$ctrl_namespace = substr($fq_modclass_name, 0, - strlen('Module')) . '\\';
52
+		$ctrl_namespace = substr($fq_modclass_name, 0, - strlen('Module')).'\\';
53 53
 		
54
-		$args = explode( '@', $request, 2);
55
-		switch(count($args)) {
54
+		$args = explode('@', $request, 2);
55
+		switch (count($args)) {
56 56
 			case 1:
57 57
 				$ctrl_name = $args[0];
58 58
 				$method = 'index';
@@ -64,16 +64,16 @@  discard block
 block discarded – undo
64 64
 				break;
65 65
 		}
66 66
 		
67
-		$ctrl_class = $ctrl_namespace . $ctrl_name . 'Controller';
68
-		if(class_exists($ctrl_class) 
67
+		$ctrl_class = $ctrl_namespace.$ctrl_name.'Controller';
68
+		if (class_exists($ctrl_class) 
69 69
 		    && is_subclass_of($ctrl_class, '\\MyArtJaub\\Webtrees\\Mvc\\Controller\\MvcController')
70
-			&& $ctrl = new $ctrl_class($module) ) {
71
-			if(method_exists($ctrl, $method)) {
70
+			&& $ctrl = new $ctrl_class($module)) {
71
+			if (method_exists($ctrl, $method)) {
72 72
 			    try {
73 73
 			        call_user_func_array(array($ctrl, $method), array());
74 74
 			    }
75 75
 			    catch (MvcException $ex) {
76
-			        if(!headers_sent()) {
76
+			        if (!headers_sent()) {
77 77
 			            http_response_code($ex->getHttpCode());
78 78
 			        }
79 79
 			        echo $ex->getMessage();			        
Please login to merge, or discard this patch.
src/Webtrees/Mvc/MvcException.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
 class MvcException extends \Exception {
18 18
 
19 19
     /** @var int[] $VALID_HTTP List of valid HTTP codes */
20
-    protected static $VALID_HTTP =  array(
20
+    protected static $VALID_HTTP = array(
21 21
         100, 101,
22 22
         200, 201, 202, 203, 204, 205, 206,
23 23
         300, 301, 302, 303, 304, 305, 306, 307,
@@ -58,9 +58,9 @@  discard block
 block discarded – undo
58 58
      * @throws InvalidArgumentException Thrown if not valid Http code
59 59
      */
60 60
     public function setHttpCode($http_code) {
61
-        if(!in_array($http_code, self::$VALID_HTTP))
61
+        if (!in_array($http_code, self::$VALID_HTTP))
62 62
             throw new \InvalidArgumentException('Invalid HTTP code');
63
-        $this->http_code= $http_code;
63
+        $this->http_code = $http_code;
64 64
     }   
65 65
 
66 66
 }
Please login to merge, or discard this patch.
src/Webtrees/Module/Sosa/Views/SosaConfigView.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -47,13 +47,13 @@
 block discarded – undo
47 47
         			<div class="value">
48 48
         				<?php 
49 49
         				    $users = $this->data->get('users_settings');
50
-        				    if(count($users) == 1) {
51
-        				        $root_indi = $users[0]['rootid'];  ?>
50
+        				    if (count($users) == 1) {
51
+        				        $root_indi = $users[0]['rootid']; ?>
52 52
         					<label>
53 53
         						<input id="maj_sosa_input_userid" type="hidden" name="userid" value="<?php echo $users[0]['user']->getUserId(); ?>" />
54 54
         						<?php echo $users[0]['user']->getRealNameHtml() ?>
55 55
         					</label>
56
-        				<?php  } else if(count($users) > 1) { ?>
56
+        				<?php  } else if (count($users) > 1) { ?>
57 57
         					<select id='maj-sosa-config-select' name="userid">
58 58
         					<?php 
59 59
         					   $root_indi = $users[0]['rootid'];
Please login to merge, or discard this patch.
src/Webtrees/Functions/FunctionsPrintLists.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -35,8 +35,8 @@
 block discarded – undo
35 35
         $surn = str_replace('@N.N.', 'AAAA', $surn);
36 36
 
37 37
         return array(
38
-            $surn . 'AAAA' . $givn,
39
-            $givn . 'AAAA' . $surn,
38
+            $surn.'AAAA'.$givn,
39
+            $givn.'AAAA'.$surn,
40 40
         );
41 41
     }
42 42
 
Please login to merge, or discard this patch.
src/Webtrees/Module/Certificates/Views/CertificatesListView.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -39,13 +39,13 @@  discard block
 block discarded – undo
39 39
     			<input type="hidden" name="ged" value="<?= $this->data->get('url_ged') ?>">
40 40
     			<select name="city">
41 41
     			<?php foreach ($cities as $city) { ?>
42
-    				<option value="<?= Functions::encryptToSafeBase64($city) ?>" <?php if(trim($city) == trim($selected_city)) echo 'selected="selected"'?> ><?= $city ?></option>
42
+    				<option value="<?= Functions::encryptToSafeBase64($city) ?>" <?php if (trim($city) == trim($selected_city)) echo 'selected="selected"'?> ><?= $city ?></option>
43 43
     			<?php } ?>
44 44
     			</select>
45 45
     			<input type="submit" value="<?= I18N::translate('Show') ?>" />
46 46
     		</form>
47 47
     		
48
-    		<?php if($this->data->get('has_list', false)) { ?>
48
+    		<?php if ($this->data->get('has_list', false)) { ?>
49 49
     		<div class="loading-image">&nbsp;</div>
50 50
     		<div class="certificate-list">
51 51
     			<table id="<?= $this->data->get('table_id') ?>">
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
     				    ?>
63 63
     					<tr>
64 64
     						<!-- Certificate date -->
65
-    						<?php if($date = $certificate->getCertificateDate()) { ?>
65
+    						<?php if ($date = $certificate->getCertificateDate()) { ?>
66 66
     						<td data-sort="<?= $date->julianDay() ?>"><?= $date->display() ?></td>
67 67
     						<?php } else { ?>
68 68
     						<td data-sort="0">&nbsp;</td>
@@ -73,8 +73,8 @@  discard block
 block discarded – undo
73 73
     						<?php 
74 74
     						$name = $certificate->getCertificateDetails() ?: '';
75 75
     						$sortname = "";
76
-    						$ct_names=preg_match("/([A-Z]{2,})/", $name, $match);
77
-    						if($ct_names > 0) $sortname = $match[1].'_';
76
+    						$ct_names = preg_match("/([A-Z]{2,})/", $name, $match);
77
+    						if ($ct_names > 0) $sortname = $match[1].'_';
78 78
     						$sortname .= $name;
79 79
     						?>
80 80
     						<td data-sort="<?= Filter::escapeHtml($sortname) ?>">
Please login to merge, or discard this patch.
src/Webtrees/Module/Sosa/Model/SosaCalculator.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
         $this->tree = $tree;
59 59
         $this->user = $user;
60 60
         
61
-        $this->sosa_provider = new SosaProvider($this->tree, $this->user);;
61
+        $this->sosa_provider = new SosaProvider($this->tree, $this->user); ;
62 62
     }
63 63
     
64 64
     /**
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
     public function computeAll() {
69 69
         $root_id = $this->tree->getUserPreference($this->user, 'MAJ_SOSA_ROOT_ID');        
70 70
         $indi = Individual::getInstance($root_id, $this->tree);
71
-        if($indi){
71
+        if ($indi) {
72 72
             $this->sosa_provider->deleteAll();
73 73
             $this->addNode($indi, 1);
74 74
             $this->flushTmpSosaTable(true);
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
     public function computeFromIndividual(Individual $indi) {
86 86
         $dindi = new \MyArtJaub\Webtrees\Individual($indi);
87 87
         $current_sosas = $dindi->getSosaNumbers();
88
-        foreach($current_sosas as $current_sosa => $gen) {
88
+        foreach ($current_sosas as $current_sosa => $gen) {
89 89
             $this->sosa_provider->deleteAncestors($current_sosa);
90 90
             $this->addNode($indi, $current_sosa);
91 91
         }
@@ -111,9 +111,9 @@  discard block
 block discarded – undo
111 111
         
112 112
         $this->flushTmpSosaTable();
113 113
         
114
-        if($fam = $indi->getPrimaryChildFamily()) {
115
-            if($husb = $fam->getHusband()) $this->addNode($husb, 2 * $sosa);
116
-            if($wife = $fam->getWife()) $this->addNode($wife, 2 * $sosa + 1);
114
+        if ($fam = $indi->getPrimaryChildFamily()) {
115
+            if ($husb = $fam->getHusband()) $this->addNode($husb, 2 * $sosa);
116
+            if ($wife = $fam->getWife()) $this->addNode($wife, 2 * $sosa + 1);
117 117
         }
118 118
     }
119 119
     
@@ -123,8 +123,8 @@  discard block
 block discarded – undo
123 123
      * @param bool $force Should the flush be forced
124 124
      */
125 125
     protected function flushTmpSosaTable($force = false) {
126
-        if( count($this->tmp_sosa_table)> 0 && 
127
-            ($force ||  count($this->tmp_sosa_table) >= self::TMP_SOSA_TABLE_LIMIT)){            
126
+        if (count($this->tmp_sosa_table) > 0 && 
127
+            ($force || count($this->tmp_sosa_table) >= self::TMP_SOSA_TABLE_LIMIT)) {            
128 128
                 $this->sosa_provider->insertOrUpdate($this->tmp_sosa_table);
129 129
                 $this->tmp_sosa_table = array();
130 130
         }
Please login to merge, or discard this patch.
src/Webtrees/Module/HooksModule.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@
 block discarded – undo
57 57
     public function getConfigLink() {
58 58
         Database::updateSchema(self::SCHEMA_MIGRATION_PREFIX, self::SCHEMA_SETTING_NAME, self::SCHEMA_TARGET_VERSION);
59 59
         
60
-        return 'module.php?mod=' . $this->getName() . '&amp;mod_action=AdminConfig';
60
+        return 'module.php?mod='.$this->getName().'&amp;mod_action=AdminConfig';
61 61
     }
62 62
     
63 63
     /**
Please login to merge, or discard this patch.
src/Webtrees/Fact.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 	*
39 39
 	* @param \Fisharebest\Webtrees\Fact $fact_in The Fact to extend
40 40
 	*/
41
-	public function __construct(\Fisharebest\Webtrees\Fact $fact_in){
41
+	public function __construct(\Fisharebest\Webtrees\Fact $fact_in) {
42 42
 		$this->fact = $fact_in;
43 43
 	}
44 44
 	
@@ -54,22 +54,22 @@  discard block
 block discarded – undo
54 54
 	*
55 55
 	* @return int Level of sources
56 56
 	*/
57
-	public function isSourced(){
58
-		$isSourced=0;
57
+	public function isSourced() {
58
+		$isSourced = 0;
59 59
 		$date = $this->fact->getDate();
60
-		if($date->isOK()) {
61
-			$isSourced=-1;
62
-			if($date->qual1=='' && $date->minimumJulianDay() == $date->maximumJulianDay()){
63
-				$isSourced=-2;
60
+		if ($date->isOK()) {
61
+			$isSourced = -1;
62
+			if ($date->qual1 == '' && $date->minimumJulianDay() == $date->maximumJulianDay()) {
63
+				$isSourced = -2;
64 64
 				$citations = $this->fact->getCitations();
65
-				foreach($citations as $citation){
66
-					$isSourced=max($isSourced, 1);
67
-					if(preg_match('/3 _ACT (.*)/', $citation) ){
68
- 						$isSourced=max($isSourced, 2);
65
+				foreach ($citations as $citation) {
66
+					$isSourced = max($isSourced, 1);
67
+					if (preg_match('/3 _ACT (.*)/', $citation)) {
68
+ 						$isSourced = max($isSourced, 2);
69 69
  						preg_match_all("/4 DATE (.*)/", $citation, $datessource, PREG_SET_ORDER);
70
- 						foreach($datessource as $daterec){
70
+ 						foreach ($datessource as $daterec) {
71 71
  							$datesource = new Date($daterec[1]);
72
- 							if(abs($datesource->julianDay() - $date->julianDay()) < self::DATE_PRECISION_MARGIN){
72
+ 							if (abs($datesource->julianDay() - $date->julianDay()) < self::DATE_PRECISION_MARGIN) {
73 73
  								$isSourced = max($isSourced, 3); //If this level increases, do not forget to change the constant MAX_IS_SOURCED_LEVEL
74 74
  							}
75 75
  						}
Please login to merge, or discard this patch.