<?php

if (!defined('QUIQQER_SYSTEM')) {
    define('QUIQQER_SYSTEM', true);
}

if (!defined('QUIQQER_AJAX')) {
    define('QUIQQER_AJAX', true);
}

putenv("QUIQQER_OTHER_AUTOLOADERS=KEEP");

require_once __DIR__ . '/../../../../bootstrap.php';

$optionalClassStubs = [
    QUI\ERP\Shipping\Methods\Standard\ShippingType::class
        => 'QUI/ERP/Shipping/Methods/Standard/ShippingType.php',
    QUI\ERP\Shipping\Rules\Factory::class
        => 'QUI/ERP/Shipping/Rules/Factory.php',
    QUI\ERP\Shipping\Rules\ShippingRule::class
        => 'QUI/ERP/Shipping/Rules/ShippingRule.php',
    QUI\ERP\Shipping\Types\Factory::class
        => 'QUI/ERP/Shipping/Types/Factory.php',
    QUI\ERP\Shipping\Types\ShippingEntry::class
        => 'QUI/ERP/Shipping/Types/ShippingEntry.php'
];

foreach ($optionalClassStubs as $className => $stubFile) {
    if (!class_exists($className, false)) {
        require_once __DIR__ . '/phpstan-stubs/' . $stubFile;
    }
}
