<?php

declare(strict_types=1);

use App\Framework\Debug\Debugger;

if (!function_exists('dd')) {
    /**
     * Debug und beende (dump and die)
     */
    function dd(mixed $data, string $label = ''): void
    {
        Debugger::dump($data, $label, true);
    }
}

if (!function_exists('debug')) {
    /**
     * Debug ohne beenden
     */
    function debug(mixed $data, string $label = ''): void
    {
        Debugger::dump($data, $label);
    }
}

if (!function_exists('debug_array')) {
    /**
     * Debug speziell für Arrays
     */
    function debug_array(array $data, string $label = ''): void
    {
        Debugger::dumpArray($data, $label);
    }
}

if (!function_exists('debug_object')) {
    /**
     * Debug speziell für Objekte
     */
    function debug_object(object $object, string $label = ''): void
    {
        Debugger::dumpObject($object, $label);
    }
}

if (!function_exists('debug_log')) {
    /**
     * Einfaches Debug-Logging
     */
    function debug_log(string $message, string $level = 'DEBUG'): void
    {
        Debugger::log($message, $level);
    }
}

if (!function_exists('debug_history')) {
    /**
     * Debug-Historie anzeigen
     */
    function debug_history(): void
    {
        Debugger::showHistory();
    }
}
