diff --git a/src/Twig/RegistrationFormExtension.php b/src/Twig/RegistrationFormExtension.php index a76f4f6..e403f5e 100644 --- a/src/Twig/RegistrationFormExtension.php +++ b/src/Twig/RegistrationFormExtension.php @@ -60,7 +60,7 @@ public function getRegistrationForm(string $group, bool $withLabels = true, arra public function getDisplayNameField(bool $withLabel, array $labels): string { - $text = in_array('displayname', $labels, true) ? $labels['displayname'] : 'Display Name'; + $text = array_key_exists('displayname', $labels) ? $labels['displayname'] : 'Display Name'; $label = $withLabel ? sprintf('', $text) : ''; $input = ''; @@ -70,7 +70,7 @@ public function getDisplayNameField(bool $withLabel, array $labels): string public function getUsernameField(bool $withLabel, array $labels): string { - $text = in_array('username', $labels, true) ? $labels['username'] : 'Username'; + $text = array_key_exists('username', $labels) ? $labels['username'] : 'Username'; $label = $withLabel ? sprintf('', $text) : ''; $input = ''; @@ -80,7 +80,7 @@ public function getUsernameField(bool $withLabel, array $labels): string public function getPasswordField(bool $withLabel, array $labels): string { - $text = in_array('password', $labels, true) ? $labels['password'] : 'Password'; + $text = array_key_exists('password', $labels) ? $labels['password'] : 'Password'; $label = $withLabel ? sprintf('', $text) : ''; $input = ''; @@ -90,7 +90,7 @@ public function getPasswordField(bool $withLabel, array $labels): string public function getEmailField(bool $withLabel, array $labels): string { - $text = in_array('email', $labels, true) ? $labels['email'] : 'Email'; + $text = array_key_exists('email', $labels) ? $labels['email'] : 'Email'; $label = $withLabel ? sprintf('', $text) : ''; $input = ''; @@ -105,7 +105,7 @@ public function getGroupField(string $group): string public function getSubmitButton(array $labels = []): string { - $text = in_array('submit', $labels, true) ? $labels['submit'] : 'Submit'; + $text = array_key_exists('submit', $labels) ? $labels['submit'] : 'Submit'; return sprintf('', $text); }