3 * This file is part of PHPUnit.
5 * (c) Sebastian Bergmann <sebastian@phpunit.de>
7 * For the full copyright and license information, please view the LICENSE
8 * file that was distributed with this source code.
11 use SebastianBergmann\Version;
14 * This class defines the current version of PHPUnit.
16 * @since Class available since Release 2.0.0
18 class PHPUnit_Runner_Version
20 private static $pharVersion;
21 private static $version;
24 * Returns the current version of PHPUnit.
28 public static function id()
30 if (self::$pharVersion !== null) {
31 return self::$pharVersion;
34 if (self::$version === null) {
35 $version = new Version('4.8.36', dirname(dirname(__DIR__)));
36 self::$version = $version->getVersion();
39 return self::$version;
45 * @since Method available since Release 4.8.13
47 public static function series()
49 if (strpos(self::id(), '-')) {
50 $tmp = explode('-', self::id());
53 $version = self::id();
56 return implode('.', array_slice(explode('.', $version), 0, 2));
62 public static function getVersionString()
64 return 'PHPUnit ' . self::id() . ' by Sebastian Bergmann and contributors.';
70 * @since Method available since Release 4.0.0
72 public static function getReleaseChannel()
74 if (strpos(self::$pharVersion, '-') !== false) {