<?php
declare(strict_types=1);

namespace {
    require __DIR__ . '/../vendor/autoload.php';
}

// The host framework provides the logger() helper at runtime; vault only calls it, it
// does not require the package. Stub it here so tests that exercise execute()/executeRaw()
// (which log via logger('query')) can run in isolation.
//
// io 6 folded io-logger into io and namespaced the function, so the stub has to live at
// `Apexl\Io\Logger\logger` — a global one is never reached, and every test that touches a
// driver dies with `Call to undefined function Apexl\Io\Logger\logger()`.
namespace Apexl\Io\Logger {
    if (!function_exists('Apexl\Io\Logger\logger')) {
        function logger(string $stream = 'default'): object
        {
            return new class {
                public function __call(string $name, array $args): void
                {
                    // no-op
                }
            };
        }
    }
}
