diff options
| author | Greg Roach <fisharebest@webtrees.net> | 2019-03-07 18:49:27 +0000 |
|---|---|---|
| committer | Greg Roach <fisharebest@webtrees.net> | 2019-03-07 21:37:35 +0000 |
| commit | e364afe4ae4e316fc4ebd53eccbaff2d29e419a5 (patch) | |
| tree | 9e269d16bd3714e9943169fc4a31c192b065c36c /app/Functions/Functions.php | |
| parent | 7d99559cb9c1475576caf7ef2fe79a5aad947d30 (diff) | |
| download | webtrees-e364afe4ae4e316fc4ebd53eccbaff2d29e419a5.tar.gz webtrees-e364afe4ae4e316fc4ebd53eccbaff2d29e419a5.tar.bz2 webtrees-e364afe4ae4e316fc4ebd53eccbaff2d29e419a5.zip | |
Code style and testing
Diffstat (limited to 'app/Functions/Functions.php')
| -rw-r--r-- | app/Functions/Functions.php | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/app/Functions/Functions.php b/app/Functions/Functions.php index 3b42da319a..a64efe2233 100644 --- a/app/Functions/Functions.php +++ b/app/Functions/Functions.php @@ -35,7 +35,7 @@ class Functions * * @return string */ - public static function fileUploadErrorText($error_code) + public static function fileUploadErrorText($error_code): string { switch ($error_code) { case UPLOAD_ERR_OK: @@ -96,7 +96,7 @@ class Functions $tag = trim($tag); $searchTarget = "~[\n]" . $tag . "[\s]~"; $ct = preg_match_all($searchTarget, $gedrec, $match, PREG_SET_ORDER | PREG_OFFSET_CAPTURE); - if ($ct == 0) { + if ($ct === 0) { return ''; } if ($ct < $num) { @@ -177,7 +177,7 @@ class Functions * * @return string */ - private static function reflexivePronoun(Individual $individual) + private static function reflexivePronoun(Individual $individual): string { switch ($individual->sex()) { case 'M': @@ -204,7 +204,7 @@ class Functions * @return array An array of nodes on the relationship path, or false if no path found * @throws Exception If no relationship exists */ - public static function getRelationship(Individual $individual1, Individual $individual2, $maxlength = 4) + public static function getRelationship(Individual $individual1, Individual $individual2, $maxlength = 4): array { $spouse_codes = [ 'M' => 'hus', @@ -363,7 +363,7 @@ class Functions * * @return string */ - public static function cousinName($n, $sex) + public static function cousinName($n, $sex): string { if ($sex === 'M') { switch ($n) { @@ -2226,7 +2226,7 @@ class Functions return self::cousinName($up + $down - 3, $sex2); case 'es': // Source: Wes Groleau. See http://UniGen.us/Parentesco.html & http://UniGen.us/Parentesco-D.html - if ($down == $up) { + if ($down === $up) { return self::cousinName($cousin, $sex2); } |
