Completed
Push — master ( 8c59e5...eb013e )
by Jonathan
09:17
created
src/Webtrees/ImageBuilder.php 1 patch
Braces   +13 added lines, -6 removed lines patch added patch discarded remove patch
@@ -87,7 +87,9 @@  discard block
 block discarded – undo
87 87
 	 * @return ImageBuilder
88 88
 	 */
89 89
 	public function setExpireOffset($expireOffset) {
90
-	    if($expireOffset) $this->expire_offset = $expireOffset;
90
+	    if($expireOffset) {
91
+	    	$this->expire_offset = $expireOffset;
92
+	    }
91 93
 	    return $this;
92 94
 	}
93 95
 	
@@ -107,7 +109,9 @@  discard block
 block discarded – undo
107 109
 	 * @return ImageBuilder
108 110
 	 */
109 111
 	public function setShowWatermark($show_watermark) {
110
-	    if(!is_null($show_watermark)) $this->show_watermark = $show_watermark;
112
+	    if(!is_null($show_watermark)) {
113
+	    	$this->show_watermark = $show_watermark;
114
+	    }
111 115
 	    return $this;
112 116
 	}
113 117
 	
@@ -118,7 +122,9 @@  discard block
 block discarded – undo
118 122
 	 * @return ImageBuilder
119 123
 	 */
120 124
 	public function setFontMaxSize($font_max_size) {
121
-	    if($font_max_size) $this->font_max_size = $font_max_size;
125
+	    if($font_max_size) {
126
+	    	$this->font_max_size = $font_max_size;
127
+	    }
122 128
 	    return $this;
123 129
 	}
124 130
 	
@@ -129,7 +135,9 @@  discard block
 block discarded – undo
129 135
 	 * @return ImageBuilder
130 136
 	 */
131 137
 	public function setFontColor($font_color) {
132
-	    if($font_color) $this->font_color = $font_color;
138
+	    if($font_color) {
139
+	    	$this->font_color = $font_color;
140
+	    }
133 141
 	    return $this;
134 142
 	}
135 143
 	
@@ -280,8 +288,7 @@  discard block
 block discarded – undo
280 288
 	    // text to watermark with	    
281 289
 	    if(method_exists($this->media, 'getWatermarkText')) {
282 290
 	       $word1_text = $this->media->getWatermarkText();
283
-	    }
284
-	    else {
291
+	    } else {
285 292
 	        $word1_text = $this->media->getTitle();
286 293
 	    }
287 294
 	
Please login to merge, or discard this patch.
src/Webtrees/Cache.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -80,7 +80,9 @@  discard block
 block discarded – undo
80 80
 	 *
81 81
 	 */
82 82
 	protected function checkInit(){
83
-		if(!$this->is_init) $this->init();
83
+		if(!$this->is_init) {
84
+			$this->init();
85
+		}
84 86
 	}
85 87
 	
86 88
 	/**
@@ -93,7 +95,9 @@  discard block
 block discarded – undo
93 95
 	protected function getKeyName($value, AbstractModule $mod = null){
94 96
 	    $this->checkInit();
95 97
 		$mod_name = 'myartjaub';
96
-		if($mod !== null) $mod_name = $mod->getName();
98
+		if($mod !== null) {
99
+			$mod_name = $mod->getName();
100
+		}
97 101
 		return $mod_name.'_'.$value;
98 102
 	}
99 103
 
Please login to merge, or discard this patch.
src/Webtrees/Module/PatronymicLineage/Model/LineageBuilder.php 1 patch
Braces   +24 added lines, -18 removed lines patch added patch discarded remove patch
@@ -54,7 +54,9 @@  discard block
 block discarded – undo
54 54
 	public function buildLineages() {				
55 55
 		$indis = \Fisharebest\Webtrees\Query\QueryName::individuals($this->tree, $this->surname, null, null, false, false);
56 56
 		
57
-		if(count($indis) == 0) return null;
57
+		if(count($indis) == 0) {
58
+			return null;
59
+		}
58 60
 		
59 61
 		$root_lineages = array();
60 62
 		
@@ -72,12 +74,13 @@  discard block
 block discarded – undo
72 74
 						if($indiChildFamily !== null){
73 75
 							$root_node = new LineageRootNode(null); 
74 76
 							$root_node->addFamily($indiChildFamily);
75
-						}
76
-						else{
77
+						} else{
77 78
 							$root_node = new LineageRootNode($indiFirst);
78 79
 						}
79 80
 						$root_node = $this->buildLineage($root_node);		
80
-						if($root_node) $root_lineages[] = $root_node;
81
+						if($root_node) {
82
+							$root_lineages[] = $root_node;
83
+						}
81 84
 					}
82 85
 				}
83 86
 			}
@@ -116,23 +119,19 @@  discard block
 block discarded – undo
116 119
 					//Check if the child is a natural child of the mother (based on the surname - Warning : surname must be identical)
117 120
 					if(!$dwife->isNewAddition() && I18N::strcasecmp($wife_surname, $indi_surname) == 0){
118 121
 						$resIndi=$wife;
119
-					}
120
-					else{
122
+					} else{
121 123
 						$is_first=true;
122 124
 					}
123
-				}
124
-				else{
125
+				} else{
125 126
 					$is_first=true;
126 127
 				}
127
-			}
128
-			else{
128
+			} else{
129 129
 				$is_first=true;
130 130
 			}
131 131
 		}
132 132
 		if(isset($this->used_indis[$resIndi->getXref()])){
133 133
 			return null;
134
-		}
135
-		else{
134
+		} else{
136 135
 			return $resIndi;
137 136
 		}
138 137
 	}
@@ -145,7 +144,9 @@  discard block
 block discarded – undo
145 144
 	 * @return LineageNode Computed lineage
146 145
 	 */
147 146
 	protected function buildLineage(LineageNode $node) {
148
-		if($node === null) return;
147
+		if($node === null) {
148
+			return;
149
+		}
149 150
 		
150 151
 		$indi_surname = null;
151 152
 		
@@ -198,7 +199,9 @@  discard block
 block discarded – undo
198 199
 								$nbNatural++;
199 200
 								$node_child = new LineageNode($child, $node->getRootNode());							
200 201
 								$node_child = $this->buildLineage($node_child);
201
-								if($node_child) $node->addChild($family, $node_child);
202
+								if($node_child) {
203
+									$node->addChild($family, $node_child);
204
+								}
202 205
 							}
203 206
 						}
204 207
 					}
@@ -212,12 +215,15 @@  discard block
 block discarded – undo
212 215
 							$nbNatural++;
213 216
 							$node_child = new LineageNode($child, $node->getRootNode());							
214 217
 							$node_child = $this->buildLineage($node_child);
215
-							if($node_child) $node->addChild($family, $node_child);
216
-						}
217
-						else {
218
+							if($node_child) {
219
+								$node->addChild($family, $node_child);
220
+							}
221
+						} else {
218 222
 							$nbNatural++;
219 223
 							$node_child = new LineageNode($child, $node->getRootNode(), $child_surname);
220
-							if($node_child) $node->addChild($family, $node_child);
224
+							if($node_child) {
225
+								$node->addChild($family, $node_child);
226
+							}
221 227
 						}
222 228
 					}
223 229
 				}
Please login to merge, or discard this patch.
src/Webtrees/Family.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -45,7 +45,9 @@
 block discarded – undo
45 45
 	* @return int Level of sources
46 46
 	* */
47 47
 	function isMarriageSourced(){
48
-		if($this->is_marriage_sourced !== null) return $this->is_marriage_sourced;
48
+		if($this->is_marriage_sourced !== null) {
49
+			return $this->is_marriage_sourced;
50
+		}
49 51
 		$this->is_marriage_sourced = $this->isFactSourced(WT_EVENTS_MARR.'|MARC');
50 52
 		return $this->is_marriage_sourced;
51 53
 	}
Please login to merge, or discard this patch.
src/Webtrees/Individual.php 1 patch
Braces   +8 added lines, -6 removed lines patch added patch discarded remove patch
@@ -65,8 +65,7 @@  discard block
 block discarded – undo
65 65
 				$ct2 = preg_match_all($pattern, $titlefact->getValue(), $match2);
66 66
 				if($ct2>0){
67 67
 					$this->titles[$match2[1][0]][]= trim($match2[2][0]);
68
-				}
69
-				else{
68
+				} else{
70 69
 					$this->titles[$titlefact->getValue()][]='';
71 70
 				}
72 71
 			}
@@ -98,8 +97,7 @@  discard block
 block discarded – undo
98 97
 		if($bplace = $this->gedcomrecord->getBirthPlace()){
99 98
 			if($perc){
100 99
 				return array ($bplace, 1);
101
-			}
102
-			else{
100
+			} else{
103 101
 				return $bplace;
104 102
 			}
105 103
 		}
@@ -168,7 +166,9 @@  discard block
 block discarded – undo
168 166
 	 * @return int Level of sources
169 167
 	 * */
170 168
 	public function isBirthSourced(){
171
-		if($this->is_birth_sourced !== null) return $this->is_birth_sourced;
169
+		if($this->is_birth_sourced !== null) {
170
+			return $this->is_birth_sourced;
171
+		}
172 172
 		$this->is_birth_sourced = $this->isFactSourced(WT_EVENTS_BIRT);
173 173
 		return $this->is_birth_sourced;
174 174
 	}
@@ -179,7 +179,9 @@  discard block
 block discarded – undo
179 179
 	* @return int Level of sources
180 180
 	* */
181 181
 	public function isDeathSourced(){
182
-		if($this->is_death_sourced !== null) return $this->is_death_sourced;
182
+		if($this->is_death_sourced !== null) {
183
+			return $this->is_death_sourced;
184
+		}
183 185
 		$this->is_death_sourced = $this->isFactSourced(WT_EVENTS_DEAT);
184 186
 		return $this->is_death_sourced;
185 187
 	}
Please login to merge, or discard this patch.
src/Webtrees/Mvc/Dispatcher.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -71,19 +71,16 @@
 block discarded – undo
71 71
 			if(method_exists($ctrl, $method)) {
72 72
 			    try {
73 73
 			        call_user_func_array(array($ctrl, $method), array());
74
-			    }
75
-			    catch (MvcException $ex) {
74
+			    } catch (MvcException $ex) {
76 75
 			        if(!headers_sent()) {
77 76
 			            http_response_code($ex->getHttpCode());
78 77
 			        }
79 78
 			        echo $ex->getMessage();			        
80 79
 			    }
81
-			}
82
-			 else {
80
+			} else {
83 81
 				 throw new \Exception('The page requested does not exist');
84 82
 			 }
85
-		 }
86
-		 else {
83
+		 } else {
87 84
 			 throw new \Exception('The page requested does not exist');
88 85
 		 }
89 86
     }
Please login to merge, or discard this patch.
src/Webtrees/Mvc/MvcException.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -58,8 +58,9 @@
 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))
62
-            throw new \InvalidArgumentException('Invalid HTTP code');
61
+        if(!in_array($http_code, self::$VALID_HTTP)) {
62
+                    throw new \InvalidArgumentException('Invalid HTTP code');
63
+        }
63 64
         $this->http_code= $http_code;
64 65
     }   
65 66
 
Please login to merge, or discard this patch.
src/Webtrees/Module/HooksModule.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -68,8 +68,7 @@
 block discarded – undo
68 68
         try {
69 69
             Database::updateSchema(self::SCHEMA_MIGRATION_PREFIX, self::SCHEMA_SETTING_NAME, self::SCHEMA_TARGET_VERSION);
70 70
             return true;
71
-        }
72
-        catch (\Exception $ex) { }
71
+        } catch (\Exception $ex) { }
73 72
         return false;
74 73
     }
75 74
     
Please login to merge, or discard this patch.
src/Webtrees/Module/GeoDispersionModule.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -79,8 +79,7 @@
 block discarded – undo
79 79
             Database::updateSchema(self::SCHEMA_MIGRATION_PREFIX, self::SCHEMA_SETTING_NAME, self::SCHEMA_TARGET_VERSION);
80 80
             
81 81
             return !is_null(Module::getModuleByName(Constants::MODULE_MAJ_SOSA_NAME));
82
-        }
83
-        catch (\Exception $ex) {  }
82
+        } catch (\Exception $ex) {  }
84 83
         return false;
85 84
     }
86 85
     
Please login to merge, or discard this patch.