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

if (!file_exists(__DIR__.'/vendor/symfony/phpunit-bridge/bin/simple-phpunit')) {
    echo "Unable to find the `simple-phpunit` script in `vendor/symfony/phpunit-bridge/bin/`.\nPlease run `composer update` before running this command.\n";
    exit(1);
}
if (!getenv('SYMFONY_PHPUNIT_VERSION')) {
    if (\PHP_VERSION_ID >= 80300) {
        if (\PHP_VERSION_ID >= 80401) {
            putenv('SYMFONY_PHPUNIT_VERSION=13');
        } else {
            putenv('SYMFONY_PHPUNIT_VERSION=12');
        }

        if (!in_array('--fail-on-phpunit-notice', $_SERVER['argv'], true) && !in_array('--do-not-fail-on-phpunit-notice', $_SERVER['argv'], true)) {
            $_SERVER['argv'][] = '--fail-on-phpunit-notice';
        }
    } else {
        putenv('SYMFONY_PHPUNIT_VERSION=11.5');
    }
}
if (!getenv('SYMFONY_PATCH_TYPE_DECLARATIONS')) {
    putenv('SYMFONY_PATCH_TYPE_DECLARATIONS=deprecations=1');
}
if (getcwd() === realpath(__DIR__.'/src/Symfony/Bridge/PhpUnit')) {
    putenv('SYMFONY_DEPRECATIONS_HELPER=disabled');
}
putenv('SYMFONY_PHPUNIT_DIR='.__DIR__.'/.phpunit');
require __DIR__.'/vendor/symfony/phpunit-bridge/bin/simple-phpunit';
