Array has 2 duplicate keys with value 'ServiceDeskLabel' ('ServiceDeskLabel', 'ServiceDeskLabel')
70 'ForumLabel' => 'Forum',
71 'AccountLabel' => 'Akun',
72 'CharacterLabel' => 'Character',
73 'ServiceDeskLabel' => 'Service Desk', 74 'CPLogsLabel' => 'CP Logs',
75 'FluxAdminLabel' => 'Flux Admin',
76 'PagesLabel' => 'Pages',
Array has 2 duplicate keys with value 'ResetPassTitle' ('ResetPassTitle', 'ResetPassTitle')
282 'ResendEmailInfo' => 'Se trata de la dirección de correo electrónico que usaste cuando registraste la cuenta del campo anterior.',
283 'ResendButton' => 'Volver a Enviar Correo Electrónico de Confirmación',
284 // - account/resetpass
285 'ResetPassTitle' => 'Recuperar Contraseña',286 'ResetPassEnterAccount' => 'Introduce el nombre de usuario de tu cuenta.',
287 'ResetPassEnterEmail' => 'Introduce tu dirección de correo electrónico.',
288 'ResetPassDisallowed' => 'No se puede hacer uso de la recuperación de contraseña para esta cuenta.',
Array has 2 duplicate keys with value 'ServiceDeskLabel' ('ServiceDeskLabel', 'ServiceDeskLabel')
78 'ForumLabel' => 'Forum',
79 'AccountLabel' => 'Cuenta',
80 'CharacterLabel' => 'Personaje',
81 'ServiceDeskLabel' => 'Service Desk', 82 'CPLogsLabel' => 'CP Logs',
83 'FluxAdminLabel' => 'Flux Admin',
84 'PagesLabel' => 'Pages',
Description
This array contains one or more duplicate keys, which can result in unexpected output. Only the last value associated with the duplicated key will be present in the array.
It is recommended to either make all keys unique or remove the key-value pairs with duplicate keys.
Bad practice
class Symbol
{
// The constants EQ and IS have the same value here
private const EQ = '=';
private const IS = '=';
private const NEQ = '!=';
public function map($sign): string
{
$array = [
self::EQ => '= %s',
self::IS => '== %s', // invalid: self::IS has the same value as self::EQ, meaning the value associated with self::EQ will be overwritten.
self::NEQ => '!= %s',
];
return $array[$sign];
}
}
Recommended
class Symbol
{
// Assign a unique value to each constant
private const EQ = '=';
private const IS = '=';
private const NEQ = '!=';
public function map($sign): string
{
$array = [
self::EQ => '= %s',
self::IS => '== %s', // valid: this is okay now since the keys have been fixed.
self::NEQ => '!= %s',
];
return $array[$sign];
}
}