PHP 8.3.31
Preview: Version.php Size: 1.69 KB
/home/getspomw/royalsquad.us/vendor/phpunit/phpunit/src/Runner/Version.php

<?php declare(strict_types=1);
/*
 * This file is part of PHPUnit.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\Runner;

use function array_slice;
use function dirname;
use function explode;
use function implode;
use function str_contains;
use SebastianBergmann\Version as VersionId;

/**
 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
 */
final class Version
{
    private static string $pharVersion = '';
    private static string $version     = '';

    /**
     * @return non-empty-string
     */
    public static function id(): string
    {
        if (self::$pharVersion !== '') {
            return self::$pharVersion;
        }

        if (self::$version === '') {
            self::$version = (new VersionId('11.5.7', dirname(__DIR__, 2)))->asString();
        }

        return self::$version;
    }

    /**
     * @return non-empty-string
     */
    public static function series(): string
    {
        if (str_contains(self::id(), '-')) {
            $version = explode('-', self::id(), 2)[0];
        } else {
            $version = self::id();
        }

        return implode('.', array_slice(explode('.', $version), 0, 2));
    }

    /**
     * @return positive-int
     */
    public static function majorVersionNumber(): int
    {
        return (int) explode('.', self::series())[0];
    }

    /**
     * @return non-empty-string
     */
    public static function getVersionString(): string
    {
        return 'PHPUnit ' . self::id() . ' by Sebastian Bergmann and contributors.';
    }
}

Directory Contents

Dirs: 10 × Files: 6

Name Size Perms Modified Actions
Baseline DIR
- drwxrwxrwx 2025-09-17 06:53:09
Edit Download
- drwxrwxrwx 2025-09-17 06:53:09
Edit Download
Exception DIR
- drwxrwxrwx 2025-09-17 06:53:09
Edit Download
Extension DIR
- drwxrwxrwx 2025-09-17 06:53:09
Edit Download
Filter DIR
- drwxrwxrwx 2025-09-17 06:53:09
Edit Download
- drwxrwxrwx 2025-09-17 06:53:09
Edit Download
- drwxrwxrwx 2025-09-17 06:53:09
Edit Download
PHPT DIR
- drwxrwxrwx 2025-09-17 06:53:09
Edit Download
- drwxrwxrwx 2025-09-17 06:53:09
Edit Download
- drwxrwxrwx 2025-09-17 06:53:09
Edit Download
13.25 KB lrw-rw-rw- 2025-09-17 06:53:09
Edit Download
12.40 KB lrw-rw-rw- 2025-09-17 06:53:09
Edit Download
3.86 KB lrw-rw-rw- 2025-09-17 06:53:09
Edit Download
3.89 KB lrw-rw-rw- 2025-09-17 06:53:09
Edit Download
10.40 KB lrw-rw-rw- 2025-09-17 06:53:09
Edit Download
1.69 KB lrw-rw-rw- 2025-09-17 06:53:09
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).