<?php

declare(strict_types=1);

spl_autoload_register(function (string $class): void {
    $prefix = 'WorkforceOS\\';
    if (!str_starts_with($class, $prefix)) {
        return;
    }

    $relative = substr($class, strlen($prefix));
    $path = __DIR__ . '/' . str_replace('\\', '/', $relative) . '.php';

    if (is_file($path)) {
        require $path;
    }
});
