diff options
| author | Greg Roach <greg@subaqua.co.uk> | 2026-02-06 11:38:07 +0000 |
|---|---|---|
| committer | Greg Roach <greg@subaqua.co.uk> | 2026-02-06 12:42:24 +0000 |
| commit | 32648f848c9c5b657c3a3bc7882e0a55ae03f209 (patch) | |
| tree | cec29123ac372a15632cf1e3c5c5694577c79323 /app/Census/CensusColumnSexF.php | |
| parent | 1e12bba2ff16616c8813810f50730aa8a0fb7985 (diff) | |
| download | webtrees-32648f848c9c5b657c3a3bc7882e0a55ae03f209.tar.gz webtrees-32648f848c9c5b657c3a3bc7882e0a55ae03f209.tar.bz2 webtrees-32648f848c9c5b657c3a3bc7882e0a55ae03f209.zip | |
Cleanup census classes
Diffstat (limited to 'app/Census/CensusColumnSexF.php')
| -rw-r--r-- | app/Census/CensusColumnSexF.php | 30 |
1 files changed, 5 insertions, 25 deletions
diff --git a/app/Census/CensusColumnSexF.php b/app/Census/CensusColumnSexF.php index c669d0ccff..6e12a11d46 100644 --- a/app/Census/CensusColumnSexF.php +++ b/app/Census/CensusColumnSexF.php @@ -21,33 +21,13 @@ namespace Fisharebest\Webtrees\Census; use Fisharebest\Webtrees\Individual; -/** - * The individual's sex Female? - */ -class CensusColumnSexF extends AbstractCensusColumn implements CensusColumnInterface +final readonly class CensusColumnSexF extends AbstractCensusColumn implements CensusColumnInterface { - protected const string MALE = 'M'; - - protected const string FEMALE = 'F'; - - protected const string 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 { - if ($individual->sex() === 'F') { - return static::X; - } - - return ''; + return match ($individual->sex()) { + 'F' => 'X', + default => '', + }; } } |
