#!/usr/bin/env php
<?php

/*
 * This file is part of the TYPO3 project.
 *
 * (c) 2019-2024 Benni Mack
 *               Simon Gilli
 *
 * For the full copyright and license information, please view
 * the LICENSE file that was distributed with this source code.
 *
 * The TYPO3 project - inspiring people to share!
 */

/**
 * Loads Composer's autoload.php.
 */
(static function (): void {
    $possibleAutoloaders = [
        __DIR__ . '/../../autoload.php',
        __DIR__ . '/../autoload.php',
        __DIR__ . '/vendor/autoload.php',
    ];
    $autoloader = null;
    foreach ($possibleAutoloaders as $possibleAutoloader) {
        if (file_exists($possibleAutoloader)) {
            $autoloader = $possibleAutoloader;

            break;
        }
    }

    if ($autoloader === null) {
        throw new RuntimeException(sprintf('Unable to locate autoload.php file from %s.', __FILE__));
    }

    require_once $autoloader;
})();

use TYPO3\CodingStandards\Console\Application;

(new Application())->run();

__HALT_COMPILER();
