<?php

require __DIR__ . '/vendor/autoload.php';

use App\Framework\Core\Application;
use App\Framework\View\TemplateRenderer;

try {
    $app = new Application();
    $container = $app->getContainer();

    $templateRenderer = $container->get(TemplateRenderer::class);

    echo "TemplateRenderer class: " . get_class($templateRenderer) . "\n";
    echo "TemplateRenderer instance of TemplateRenderer: " . ($templateRenderer instanceof TemplateRenderer ? 'YES' : 'NO') . "\n";

    if (method_exists($templateRenderer, 'render')) {
        echo "Has render method: YES\n";
    } else {
        echo "Has render method: NO\n";
    }

    // Check if it's the Engine class we expect
    if (get_class($templateRenderer) === 'App\Framework\View\Engine') {
        echo "Is Engine class: YES\n";
    } else {
        echo "Is Engine class: NO\n";
        echo "Actual class: " . get_class($templateRenderer) . "\n";
    }

} catch (Exception $e) {
    echo "Error: " . $e->getMessage() . "\n";
    echo "Trace: " . $e->getTraceAsString() . "\n";
}