#!/bin/bash

# Script para corrigir problemas de duplo <?php em arquivos PHP

for file in /media/ealmeida/Dados/Dev/care-api/src/includes/models/*.php; do
    echo "Fixing double PHP tags in $file"
    
    # Remove duplo <?php
    sed -i '1{/^<?php$/N; s/^<?php\n<?php$/<?php/;}' "$file"
    
    echo "Fixed $file"
done

echo "All model files have been fixed!"