fix: compatibilidad PHP 7.4 — str_starts_with, str_contains, match, never, mixed

This commit is contained in:
Lizandro Guarnizo
2026-06-04 20:04:37 -05:00
parent 943e629120
commit 43f337ee34
5 changed files with 54 additions and 50 deletions
+18 -18
View File
@@ -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 '&#128172; Texto';
case 'image': return '&#128247; Imagen';
case 'audio': return '&#127925; Audio';
case 'video': return '&#127916; Video';
case 'document': return '&#128196; Documento';
case 'location': return '&#128205; Ubicaci&oacute;n';
case 'interactive': return '&#128280; Interactivo';
case 'button': return '&#128306; Bot&oacute;n';
default: return self::h($type);
}
}
// ─── Render ───────────────────────────────────────────────────────────────