<?php

declare(strict_types=1);

namespace PackageVersions;

use Composer\InstalledVersions;
use OutOfBoundsException;

class_exists(InstalledVersions::class);

/**
 * This class is generated by composer/package-versions-deprecated, specifically by
 * @see \PackageVersions\Installer
 *
 * This file is overwritten at every run of `composer install` or `composer update`.
 *
 * @deprecated in favor of the Composer\InstalledVersions class provided by Composer 2. Require composer-runtime-api:^2 to ensure it is present.
 */
final class Versions
{
    /**
     * @deprecated please use {@see self::rootPackageName()} instead.
     *             This constant will be removed in version 2.0.0.
     */
    const ROOT_PACKAGE_NAME = 'eventum/eventum';

    /**
     * Array of all available composer packages.
     * Dont read this array from your calling code, but use the \PackageVersions\Versions::getVersion() method instead.
     *
     * @var array<string, string>
     * @internal
     */
    const VERSIONS          = array (
  'cakephp/core' => '4.3.10@499f17738d40560ec077d7d2039c9af4969c6b17',
  'cakephp/database' => '4.3.10@f565f9d296817692031852d142ee28e0d48f4dd9',
  'cakephp/datasource' => '4.3.10@106ac9cb54a852f286dd2fe21e131c51f4a3d7fb',
  'cakephp/utility' => '4.3.10@3d352060ca3e49c81c3fd2bdb092ee345d8f4e38',
  'composer/package-versions-deprecated' => '1.11.99.5@b4f54f74ef3453349c24a845d22392cd31e65f1d',
  'container-interop/container-interop' => '1.2.0@79cbf1341c22ec75643d841642dd5d6acd83bdb8',
  'defuse/php-encryption' => 'v2.3.1@77880488b9954b7884c25555c2a0ea9e7053f9d2',
  'doctrine/annotations' => '1.14.2@ad785217c1e9555a7d6c6c8c9f406395a5e2882b',
  'doctrine/cache' => '1.11.3@3bb5588cec00a0268829cc4a518490df6741af9d',
  'doctrine/collections' => '1.8.0@2b44dd4cbca8b5744327de78bafef5945c7e7b5e',
  'doctrine/common' => '3.4.3@8b5e5650391f851ed58910b3e3d48a71062eeced',
  'doctrine/dbal' => '2.12.1@adce7a954a1c2f14f85e94aed90c8489af204086',
  'doctrine/deprecations' => 'v1.0.0@0e2a4f1f8cdfc7a92ec3b01c9334898c806b30de',
  'doctrine/doctrine-bundle' => '2.3.2@d6b3c37804539a24ba8a7d647a6144cab2f13242',
  'doctrine/event-manager' => '1.2.0@95aa4cb529f1e96576f3fda9f5705ada4056a520',
  'doctrine/inflector' => '2.0.6@d9d313a36c872fd6ee06d9a6cbcf713eaa40f024',
  'doctrine/instantiator' => '1.5.0@0a0fa9780f5d4e507415a065172d26a98d02047b',
  'doctrine/lexer' => '1.2.3@c268e882d4dbdd85e36e4ad69e02dc284f89d229',
  'doctrine/orm' => '2.8.5@a6577b89a2b028b79550ef58d9f272debdd75da4',
  'doctrine/persistence' => '2.5.6@7729fc2a7e5efc8bbfa408a3b8adeb8f5b84f5d1',
  'doctrine/sql-formatter' => '1.1.3@25a06c7bf4c6b8218f47928654252863ffc890a5',
  'enrise/urihelper' => '1.0.2@b43b1ba2d12775339a14359c9b1c7d35cb88bba4',
  'ezyang/htmlpurifier' => 'v4.16.0@523407fb06eb9e5f3d59889b3978d5bfe94299c8',
  'fonts/liberation' => '2.00.1@',
  'giberti/commonmark-emoji-extension' => '0.2@5be21de92f78227df3c65409b20b530feaf14397',
  'giberti/emoji-data' => 'v0.1@f07a1d0dee6453d076bbc8ce89c68856d8cabdde',
  'glen/filename-normalizer' => '2.0.1@2404f55b2cb3e91809d4eaae1d10cbc3c4aa3803',
  'horde/text-flowed' => 'dev-patch-1@ad30eea8e427aba1219d3b8b52750b7d04a60a91',
  'horde/util' => 'dev-patch-1@b9e6f35a9b503469afe3f25e7d78c8b8dc7e1666',
  'ircmaxell/random-lib' => 'v1.2.0@e9e0204f40e49fa4419946c677eccd3fa25b8cf4',
  'ircmaxell/security-lib' => 'v1.1.0@f3db6de12c20c9bcd1aa3db4353a1bbe0e44e1b5',
  'laminas/laminas-config' => '3.7.0@e43d13dcfc273d4392812eb395ce636f73f34dfd',
  'laminas/laminas-loader' => '2.8.0@d0589ec9dd48365fd95ad10d1c906efd7711c16b',
  'laminas/laminas-mail' => '2.16.0@1ee1a384b96c8af29ecad9b3a7adc27a150ebc49',
  'laminas/laminas-mime' => '2.10.0@62a899a7c9100889c2d2386b1357003a2cb52fa9',
  'laminas/laminas-servicemanager' => '3.7.0@2b0aee477fdbd3191af7c302b93dbc5fda0626f4',
  'laminas/laminas-stdlib' => '3.11.0@aad7d2b11ba0069ba0d9b40f6dde3c2fa664b57f',
  'laminas/laminas-validator' => '2.19.0@4875d4e58b6f728981bb767a60530540f82ee1df',
  'laminas/laminas-zendframework-bridge' => '1.4.1@88bf037259869891afce6504cacc4f8a07b24d0f',
  'league/commonmark' => '1.6.7@2b8185c13bc9578367a5bf901881d1c1b5bbd09b',
  'league/flysystem' => '1.1.10@3239285c825c152bcc315fe0e87d6b55f5972ed1',
  'league/html-to-markdown' => '4.10.0@0868ae7a552e809e5cd8f93ba022071640408e88',
  'league/mime-type-detection' => '1.11.0@ff6248ea87a9f116e78edd6002e39e5128a0d4dd',
  'monolog/monolog' => '1.27.1@904713c5929655dc9b97288b69cfeedad610c9a1',
  'ocramius/lazy-property' => '1.0.1@6ebe14852b08a89d28c064a75ea88dbe88dad07c',
  'paragonie/random_compat' => 'v9.99.100@996434e5492cb4c3edcb9168db6fbb1359ef965a',
  'perftools/php-profiler' => '1.1.1@40edd32f8ac471dd4d0f6e7057ed0acab4eb1c36',
  'phlib/flysystem-pdo' => '1.1.0@c55272885db35bca3e21bb5efd8acb9dfaf34ad7',
  'php-ds/php-ds' => 'v1.4.1@43d2df301a9e2017f67b8c11d94a5222f9c00fd1',
  'phplot/phplot' => 'v6.1.0@',
  'phpxmlrpc/phpxmlrpc' => '4.9.3@1658b0c236e490c485e3b1233964223ceece52fe',
  'pimple/pimple' => 'v3.5.0@a94b3a4db7fb774b3d78dad2315ddc07629e1bed',
  'portphp/csv' => '1.1.0@3d29b4dfbb112b6ef0eaef5ae79d04f9431c834b',
  'portphp/doctrine' => '1.2.0@24e83d1c0be33b1985a607af7b4393150fd4cbd4',
  'portphp/portphp' => '1.4.0@5f4a6a90b0ed739f198f3477bc671ec4b1cb7c5e',
  'portphp/steps' => '1.4.0@67291741ef6b7e1ab25083bf824635149c559848',
  'psr/cache' => '1.0.1@d11b50ad223250cf17b86e38383413f5a6764bf8',
  'psr/container' => '1.1.1@8622567409010282b7aeebe4bb841fe98b58dcaf',
  'psr/log' => '1.1.4@d49695b909c3b7628b6289db5479a1c204601f11',
  'psr/simple-cache' => '1.0.1@408d5eafb83c57f6365a3ca330ff23aa4a5fa39b',
  'robmorgan/phinx' => '0.12.13@6eb0f295e140ed2804d93396755f0ce9ada4ec07',
  'sebastian/diff' => '3.0.3@14f72dd46eaf2f2293cbe79c93cc0bc43161a211',
  'seld/signal-handler' => '1.3.0@7904836d112951e9f30ef4871036ab34399c8dd5',
  'smarty-gettext/smarty-gettext' => '1.6.2@22e5b91b642cd643f9acdd8d04ab0e05647b98a7',
  'smarty/smarty' => 'v3.1.47@a09364fe1706cb465e910eb040e592053d7effb8',
  'sphinx/php-sphinxapi' => '2.0.1@',
  'symfony/asset' => 'v4.4.46@6ef0f9f352f90c469e8b363ebc038d81a7198873',
  'symfony/cache' => 'v4.4.48@3b98ed664887ad197b8ede3da2432787212eb915',
  'symfony/cache-contracts' => 'v2.5.2@64be4a7acb83b6f2bf6de9a02cee6dad41277ebc',
  'symfony/config' => 'v4.4.44@ed42f8f9da528d2c6cae36fe1f380b0c1d8f0658',
  'symfony/console' => 'v4.4.49@33fa45ffc81fdcc1ca368d4946da859c8cdb58d9',
  'symfony/debug' => 'v4.4.44@1a692492190773c5310bc7877cb590c04c2f05be',
  'symfony/dependency-injection' => 'v4.4.49@9065fe97dbd38a897e95ea254eb5ddfe1310f734',
  'symfony/deprecation-contracts' => 'v2.5.2@e8b495ea28c1d97b5e0c121748d6f9b53d075c66',
  'symfony/doctrine-bridge' => 'v4.4.48@8dbbec53714eb512321380d582b45ff7e074a5d6',
  'symfony/error-handler' => 'v4.4.44@be731658121ef2d8be88f3a1ec938148a9237291',
  'symfony/event-dispatcher' => 'v4.4.44@1e866e9e5c1b22168e0ce5f0b467f19bba61266a',
  'symfony/event-dispatcher-contracts' => 'v1.1.13@1d5cd762abaa6b2a4169d3e77610193a7157129e',
  'symfony/expression-language' => 'v4.4.47@e4964c7636e19f6008660f450c09121c80c2a7b9',
  'symfony/filesystem' => 'v4.4.42@815412ee8971209bd4c1eecd5f4f481eacd44bf5',
  'symfony/finder' => 'v4.4.44@66bd787edb5e42ff59d3523f623895af05043e4f',
  'symfony/flex' => 'v1.19.4@c82477240111bfe41a1067c9f0ab91d40bafa5b6',
  'symfony/framework-bundle' => 'v4.4.49@d8cf2558249004a29b8e27b1f6eae52337ff471b',
  'symfony/http-client-contracts' => 'v2.5.2@ba6a9f0e8f3edd190520ee3b9a958596b6ca2e70',
  'symfony/http-foundation' => 'v4.4.49@191413c7b832c015bb38eae963f2e57498c3c173',
  'symfony/http-kernel' => 'v4.4.49@4e36db8103062c62b3882b1bd297b02de6b021c4',
  'symfony/inflector' => 'v4.4.44@66185be61805b1e44a5c4000929e700228d426cc',
  'symfony/ldap' => 'v4.4.46@472b1d29e94eaa68514f644e94d44e7ea0cf42af',
  'symfony/lock' => 'v4.4.46@8b060dd4e10f05219698ceb3a4ad735b19c1be4f',
  'symfony/mime' => 'v4.4.47@0eaf33cd6d1b3eaa50e7bc48b17f6e45789df35d',
  'symfony/monolog-bridge' => 'v4.4.43@ad09c9980b912e757c4ecd8363cebf3039d1d471',
  'symfony/monolog-bundle' => 'v3.8.0@a41bbcdc1105603b6d73a7d9a43a3788f8e0fb7d',
  'symfony/options-resolver' => 'v4.4.44@583f56160f716dd435f1cd721fd14b548f4bb510',
  'symfony/polyfill-ctype' => 'v1.27.0@5bbc823adecdae860bb64756d639ecfec17b050a',
  'symfony/polyfill-intl-idn' => 'v1.27.0@639084e360537a19f9ee352433b84ce831f3d2da',
  'symfony/polyfill-intl-normalizer' => 'v1.27.0@19bd1e4fcd5b91116f14d8533c57831ed00571b6',
  'symfony/polyfill-mbstring' => 'v1.27.0@8ad114f6b39e2c98a8b0e3bd907732c207c2b534',
  'symfony/polyfill-php72' => 'v1.27.0@869329b1e9894268a8a61dabb69153029b7a8c97',
  'symfony/polyfill-php73' => 'v1.27.0@9e8ecb5f92152187c4799efd3c96b78ccab18ff9',
  'symfony/polyfill-php80' => 'v1.27.0@7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936',
  'symfony/polyfill-php81' => 'v1.27.0@707403074c8ea6e2edaf8794b0157a0bfa52157a',
  'symfony/property-access' => 'v4.4.44@d49682f6f0764df725c95128213a38f7e0a9f358',
  'symfony/routing' => 'v4.4.44@f7751fd8b60a07f3f349947a309b5bdfce22d6ae',
  'symfony/security-bundle' => 'v4.4.44@d2a6bf4aeb75e75d3faacf9bec286e0de58394b6',
  'symfony/security-core' => 'v4.4.48@423ccb332784b236dfe6c5f396d0ac49db57c914',
  'symfony/security-csrf' => 'v4.4.37@45c956ef58135091f53732646a0acd28034f02c0',
  'symfony/security-guard' => 'v4.4.46@f199eb1b19db11ce254b891580728c45a7ccacfd',
  'symfony/security-http' => 'v4.4.48@41e7666313f140ac8560f8db64ab54cc7348615a',
  'symfony/serializer' => 'v4.4.47@6e01d63c55657930a6de03d6e36aae50af98888d',
  'symfony/service-contracts' => 'v2.4.1@d664541b99d6fb0247ec5ff32e87238582236204',
  'symfony/translation-contracts' => 'v2.5.2@136b19dd05cdf0709db6537d058bcab6dd6e2dbe',
  'symfony/validator' => 'v4.4.48@54781a4c41efbd283b779110bf8ae7f263737775',
  'symfony/var-dumper' => 'v4.4.47@1069c7a3fca74578022fab6f81643248d02f8e63',
  'symfony/var-exporter' => 'v4.4.43@4a7a3a3d55c471d396e6d28011368b7b83cb518b',
  'symfony/yaml' => 'v4.4.45@aeccc4dc52a9e634f1d1eebeb21eacfdcff1053d',
  'theorchard/monolog-cascade' => '0.5.3@034f018e9814c7a057ad2f64242f25e07aaad174',
  'webmozart/assert' => '1.11.0@11cb2199493b2f8a3b53e7f19068fc6aac760991',
  'willdurand/email-reply-parser' => '2.9.0@642bec19af70c2bf2f2611301349107fe2e6dd08',
  'xemlock/htmlpurifier-html5' => 'v0.1.11@f0d563f9fd4a82a3d759043483f9a94c0d8c2255',
  'balbuf/composer-git-merge-driver' => 'v1.1.0@c0ba60db9a39ae984ab300a9f7fd058f453f1299',
  'eventum/rpc' => 'v4.4.0@6555c2434a8488b189a41a9fbf7d2c59c5da83c6',
  'jasig/phpcas' => '1.3.9@7325865c4cfb5005ed4e4c5cf01823be1726a2a0',
  'maximebf/debugbar' => 'v1.18.1@ba0af68dd4316834701ecb30a00ce9604ced3ee9',
  'sentry/sentry' => '1.11.0@159eeaa02bb2ef8a8ec669f3c88e4bff7e6a7ffe',
  'symfony/browser-kit' => 'v4.4.44@2a1ff40723ef6b29c8229a860a9c8f815ad7dbbb',
  'symfony/dom-crawler' => 'v4.4.45@4b8daf6c56801e6d664224261cb100b73edc78a5',
  'symfony/phpunit-bridge' => 'v4.4.49@b3378a7d305666a69e08457b65af8bca179fbbbb',
  'symfony/stopwatch' => 'v4.4.46@757660703fbd139eea0001b759c6c3bf5bc3ea52',
  'symfony/thanks' => 'v1.2.10@e9c4709560296acbd4fe9e12b8d57a925aa7eae8',
  'symfony/twig-bridge' => 'v4.4.49@d6b0fbfd5e2fab79c0c7b8dfe579e47ee0999113',
  'symfony/twig-bundle' => 'v4.4.41@164c1edc69f2c7ee337323efc78a8a8a263f45ff',
  'symfony/web-profiler-bundle' => 'v4.4.47@c173202d8ce82fde63ec0953eaffdf065018b8f4',
  'twig/twig' => 'v3.5.0@3ffcf4b7d890770466da3b2666f82ac054e7ec72',
  'eventum/eventum' => '3.10.12@',
);

    private function __construct()
    {
    }

    /**
     * @psalm-pure
     *
     * @psalm-suppress ImpureMethodCall we know that {@see InstalledVersions} interaction does not
     *                                  cause any side effects here.
     */
    public static function rootPackageName() : string
    {
        if (!self::composer2ApiUsable()) {
            return self::ROOT_PACKAGE_NAME;
        }

        return InstalledVersions::getRootPackage()['name'];
    }

    /**
     * @throws OutOfBoundsException If a version cannot be located.
     *
     * @psalm-param key-of<self::VERSIONS> $packageName
     * @psalm-pure
     *
     * @psalm-suppress ImpureMethodCall we know that {@see InstalledVersions} interaction does not
     *                                  cause any side effects here.
     */
    public static function getVersion(string $packageName): string
    {
        if (self::composer2ApiUsable()) {
            return InstalledVersions::getPrettyVersion($packageName)
                . '@' . InstalledVersions::getReference($packageName);
        }

        if (isset(self::VERSIONS[$packageName])) {
            return self::VERSIONS[$packageName];
        }

        throw new OutOfBoundsException(
            'Required package "' . $packageName . '" is not installed: check your ./vendor/composer/installed.json and/or ./composer.lock files'
        );
    }

    private static function composer2ApiUsable(): bool
    {
        if (!class_exists(InstalledVersions::class, false)) {
            return false;
        }

        if (method_exists(InstalledVersions::class, 'getAllRawData')) {
            $rawData = InstalledVersions::getAllRawData();
            if (count($rawData) === 1 && count($rawData[0]) === 0) {
                return false;
            }
        } else {
            $rawData = InstalledVersions::getRawData();
            if ($rawData === null || $rawData === []) {
                return false;
            }
        }

        return true;
    }
}
