<?php

spl_autoload_register(function ($class) {
    if (str_starts_with($class, 'YOOtheme\\Demo\\')) {
        $path = array_slice(explode('/', str_replace('\\', '/', $class)), 2);
        $name = array_pop($path);

        require_once __DIR__ . '/src/' . strtolower(implode('/', $path)) . '/' . $name . '.php';
    }
});
