summaryrefslogtreecommitdiff
path: root/app/Census/CensusColumnSexF.php
diff options
context:
space:
mode:
authorglarwill <58348988+glarwill@users.noreply.github.com>2021-07-16 07:48:58 -0700
committerGitHub <noreply@github.com>2021-07-16 15:48:58 +0100
commitda3cb887318b253ac0a743309ac1b537880d6ba2 (patch)
tree1ce0799002aea7bb5cfcc684382b6efbe68c1230 /app/Census/CensusColumnSexF.php
parent4aa3be6dd4f7e3c3cc3f482380e6eed68b8d17ae (diff)
downloadwebtrees-da3cb887318b253ac0a743309ac1b537880d6ba2.tar.gz
webtrees-da3cb887318b253ac0a743309ac1b537880d6ba2.tar.bz2
webtrees-da3cb887318b253ac0a743309ac1b537880d6ba2.zip
Canada census 3 (#3936)
* Added 3 years of Canada Census formats * Added tests for Canadian census data * Fixed month-day order and moved Canadian to bottom of default * a bit of cleanup to the spacing, and comments * Fix style for spacing * 5 more years of Canadian census documents * Corrected cp artifact in original file version * Adjusted date of 1851 Canada census to be in 1851 * Fixed <tab> vs space * typo * Adapted to comments * Removed change in Age.php, per comments * restored AgeTest * small clean up, spacing and some comments
Diffstat (limited to 'app/Census/CensusColumnSexF.php')
-rw-r--r--app/Census/CensusColumnSexF.php54
1 files changed, 54 insertions, 0 deletions
diff --git a/app/Census/CensusColumnSexF.php b/app/Census/CensusColumnSexF.php
new file mode 100644
index 0000000000..5cb45fe468
--- /dev/null
+++ b/app/Census/CensusColumnSexF.php
@@ -0,0 +1,54 @@
+<?php
+
+/**
+ * webtrees: online genealogy
+ * Copyright (C) 2021 webtrees development team
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
+declare(strict_types=1);
+
+namespace Fisharebest\Webtrees\Census;
+
+use Fisharebest\Webtrees\Individual;
+
+/**
+ * The individual's sex Female?
+ */
+class CensusColumnSexF extends AbstractCensusColumn implements CensusColumnInterface
+{
+ protected const MALE = 'M';
+
+ protected const FEMALE = 'F';
+
+ protected const X = 'X';
+
+ /**
+ * Generate the likely value of this census column, based on available information.
+ * X is the value returned for this column as it is a selection of F column or M
+ * column.
+ *
+ * @param Individual $individual
+ * @param Individual $head
+ *
+ * @return string
+ */
+ public function generate(Individual $individual, Individual $head): string
+ {
+ switch ($individual->sex()) {
+ case 'F':
+ return static::X;
+ default:
+ return '';
+ }
+ }
+}