fix: compatibilidad PHP 7.4 — str_starts_with, str_contains, match, never, mixed
This commit is contained in:
@@ -332,26 +332,26 @@ HTML;
|
||||
private static function typeLabel(string $field, string $type): string
|
||||
{
|
||||
if ($field === 'statuses') {
|
||||
$cls = match ($type) {
|
||||
'sent' => 'badge-blue',
|
||||
'delivered' => 'badge-green',
|
||||
'read' => 'badge-teal',
|
||||
'failed' => 'badge-red',
|
||||
default => 'badge-gray',
|
||||
};
|
||||
switch ($type) {
|
||||
case 'sent': $cls = 'badge-blue'; break;
|
||||
case 'delivered': $cls = 'badge-green'; break;
|
||||
case 'read': $cls = 'badge-teal'; break;
|
||||
case 'failed': $cls = 'badge-red'; break;
|
||||
default: $cls = 'badge-gray'; break;
|
||||
}
|
||||
return '<span class="badge ' . $cls . '">' . self::h($type) . '</span>';
|
||||
}
|
||||
return match ($type) {
|
||||
'text' => '💬 Texto',
|
||||
'image' => '🖼️ Imagen',
|
||||
'audio' => '🎵 Audio',
|
||||
'video' => '🎥 Video',
|
||||
'document' => '📄 Documento',
|
||||
'location' => '📍 Ubicación',
|
||||
'interactive' => '🔘 Interactivo',
|
||||
'button' => '🔲 Botón',
|
||||
default => self::h($type),
|
||||
};
|
||||
switch ($type) {
|
||||
case 'text': return '💬 Texto';
|
||||
case 'image': return '📷 Imagen';
|
||||
case 'audio': return '🎵 Audio';
|
||||
case 'video': return '🎬 Video';
|
||||
case 'document': return '📄 Documento';
|
||||
case 'location': return '📍 Ubicación';
|
||||
case 'interactive': return '🔘 Interactivo';
|
||||
case 'button': return '🔲 Botón';
|
||||
default: return self::h($type);
|
||||
}
|
||||
}
|
||||
|
||||
// ─── Render ───────────────────────────────────────────────────────────────
|
||||
|
||||
Reference in New Issue
Block a user