<?php

declare(strict_types=1);

spl_autoload_register(function (string $class) {

    $directories = [

        __DIR__ . '/Core',

        __DIR__ . '/Services',

        __DIR__ . '/Helpers',

        __DIR__ . '/Jobs',

        __DIR__ . '/Engines',

    ];

    foreach ($directories as $directory) {

        $file = $directory . '/' . $class . '.php';

        if (is_file($file)) {

            require_once $file;

            return;
        }
    }

});