@@ -57,8 +57,7 @@ discard block |
||
| 57 | 57 | $ct2 = preg_match_all($pattern, $titlefact->getValue(), $match2); |
| 58 | 58 | if($ct2>0){ |
| 59 | 59 | $this->titles[$match2[1][0]][]= trim($match2[2][0]); |
| 60 | - } |
|
| 61 | - else{ |
|
| 60 | + } else{ |
|
| 62 | 61 | $this->titles[$titlefact->getValue()][]=''; |
| 63 | 62 | } |
| 64 | 63 | } |
@@ -90,8 +89,7 @@ discard block |
||
| 90 | 89 | if($bplace = $this->gedcomrecord->getBirthPlace()){ |
| 91 | 90 | if($perc){ |
| 92 | 91 | return array ($bplace, 1); |
| 93 | - } |
|
| 94 | - else{ |
|
| 92 | + } else{ |
|
| 95 | 93 | return $bplace; |
| 96 | 94 | } |
| 97 | 95 | } |
@@ -108,16 +108,18 @@ discard block |
||
| 108 | 108 | $len_chars = count($chars); |
| 109 | 109 | $token = ''; |
| 110 | 110 | |
| 111 | - for ($i = 0; $i < $length; $i++) |
|
| 112 | - $token .= $chars[ mt_rand(0, $len_chars - 1) ]; |
|
| 111 | + for ($i = 0; $i < $length; $i++) { |
|
| 112 | + $token .= $chars[ mt_rand(0, $len_chars - 1) ]; |
|
| 113 | + } |
|
| 113 | 114 | |
| 114 | 115 | # Number of 32 char chunks |
| 115 | 116 | $chunks = ceil( strlen($token) / 32 ); |
| 116 | 117 | $md5token = ''; |
| 117 | 118 | |
| 118 | 119 | # Run each chunk through md5 |
| 119 | - for ( $i=1; $i<=$chunks; $i++ ) |
|
| 120 | - $md5token .= md5( substr($token, $i * 32 - 32, 32) ); |
|
| 120 | + for ( $i=1; $i<=$chunks; $i++ ) { |
|
| 121 | + $md5token .= md5( substr($token, $i * 32 - 32, 32) ); |
|
| 122 | + } |
|
| 121 | 123 | |
| 122 | 124 | # Trim the token |
| 123 | 125 | return substr($md5token, 0, $length); |
@@ -157,7 +159,9 @@ discard block |
||
| 157 | 159 | * @return boolean True if path valid |
| 158 | 160 | */ |
| 159 | 161 | public static function isValidPath($filename, $acceptfolder = FALSE) { |
| 160 | - if(strpbrk($filename, $acceptfolder ? '?%*:|"<>' : '\\/?%*:|"<>') === FALSE) return true; |
|
| 162 | + if(strpbrk($filename, $acceptfolder ? '?%*:|"<>' : '\\/?%*:|"<>') === FALSE) { |
|
| 163 | + return true; |
|
| 164 | + } |
|
| 161 | 165 | return false; |
| 162 | 166 | } |
| 163 | 167 | |
@@ -64,10 +64,16 @@ |
||
| 64 | 64 | */ |
| 65 | 65 | private function extractPlace(?Place $place, int $depth, bool $strict_depth): ?Place |
| 66 | 66 | { |
| 67 | - if($place === null) return null; |
|
| 68 | - if(mb_strlen($place->gedcomName()) === 0) return null; |
|
| 67 | + if($place === null) { |
|
| 68 | + return null; |
|
| 69 | + } |
|
| 70 | + if(mb_strlen($place->gedcomName()) === 0) { |
|
| 71 | + return null; |
|
| 72 | + } |
|
| 69 | 73 | $parts = $place->lastParts($depth); |
| 70 | - if($strict_depth && $parts->count() !== $depth) return new Place(self::INVALID_PLACE, $place->tree()); |
|
| 74 | + if($strict_depth && $parts->count() !== $depth) { |
|
| 75 | + return new Place(self::INVALID_PLACE, $place->tree()); |
|
| 76 | + } |
|
| 71 | 77 | return new Place($parts->implode(', '), $place->tree()); |
| 72 | 78 | } |
| 73 | 79 | |
@@ -77,8 +77,7 @@ |
||
| 77 | 77 | if($feature_collection instanceof FeatureCollection) { |
| 78 | 78 | return $feature_collection->getFeatures(); |
| 79 | 79 | } |
| 80 | - } |
|
| 81 | - catch(Throwable $ex) { } |
|
| 80 | + } catch(Throwable $ex) { } |
|
| 82 | 81 | return []; |
| 83 | 82 | } |
| 84 | 83 | |