<?php declare(strict_types=1);
/**
 * @package messenger
 * @author kputyr
 * @date 20.04.2026
 */

spl_autoload_register(function($className) {
    $classPath = strtr($className, '\\', '/');
    if (str_starts_with($classPath, 'Psr/Log/')) {
        include __DIR__ . '/vendor/psr/log/src/' . substr($classPath, 8) . '.php';
    } elseif (str_starts_with($classPath, 'IMATHUZH/Messenger/')) {
        include __DIR__ . '/php/Classes/' . substr($classPath, 19) . '.php';
    } else {
        trigger_error("class not found: $className");
    }
});
