diff --git a/src/Twig/LoginFormExtension.php b/src/Twig/LoginFormExtension.php
index 3815d92..302dbba 100644
--- a/src/Twig/LoginFormExtension.php
+++ b/src/Twig/LoginFormExtension.php
@@ -64,7 +64,7 @@ public function getLoginForm(bool $withLabels = true, array $labels = []): strin
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 = '';
@@ -74,7 +74,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 = '';
@@ -84,7 +84,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 = '';
@@ -94,7 +94,7 @@ public function getEmailField(bool $withLabel, array $labels): 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);
}