. */ declare(strict_types=1); namespace Fisharebest\Webtrees\Elements; use Fisharebest\Webtrees\I18N; use function strtoupper; /** * := {Size=1:35} * Type the demographic data for a place. * [ HSHO | CITI ] means: household | resident */ class DemographicDataType extends AbstractElement { /** * Convert a value to a canonical form. * * @param string $value * * @return string */ public function canonical(string $value): string { return strtoupper(parent::canonical($value)); } /** * A list of controlled values for this element * * @return array */ public function values(): array { $values = [ '' => '', 'HSHO' => /* I18N: Type of demographic data */ I18N::translate('household'), 'CITI' => /* I18N: Type of demographic data */ I18N::translate('citizen'), ]; uasort($values, [I18N::class, 'strcasecmp']); return $values; } }