Yaffs site version 1.1
[yaffs-website] / vendor / phpunit / phpunit / src / Runner / Version.php
1 <?php
2 /*
3  * This file is part of PHPUnit.
4  *
5  * (c) Sebastian Bergmann <sebastian@phpunit.de>
6  *
7  * For the full copyright and license information, please view the LICENSE
8  * file that was distributed with this source code.
9  */
10
11 use SebastianBergmann\Version;
12
13 /**
14  * This class defines the current version of PHPUnit.
15  *
16  * @since Class available since Release 2.0.0
17  */
18 class PHPUnit_Runner_Version
19 {
20     private static $pharVersion;
21     private static $version;
22
23     /**
24      * Returns the current version of PHPUnit.
25      *
26      * @return string
27      */
28     public static function id()
29     {
30         if (self::$pharVersion !== null) {
31             return self::$pharVersion;
32         }
33
34         if (self::$version === null) {
35             $version       = new Version('4.8.36', dirname(dirname(__DIR__)));
36             self::$version = $version->getVersion();
37         }
38
39         return self::$version;
40     }
41
42     /**
43      * @return string
44      *
45      * @since Method available since Release 4.8.13
46      */
47     public static function series()
48     {
49         if (strpos(self::id(), '-')) {
50             $tmp     = explode('-', self::id());
51             $version = $tmp[0];
52         } else {
53             $version = self::id();
54         }
55
56         return implode('.', array_slice(explode('.', $version), 0, 2));
57     }
58
59     /**
60      * @return string
61      */
62     public static function getVersionString()
63     {
64         return 'PHPUnit ' . self::id() . ' by Sebastian Bergmann and contributors.';
65     }
66
67     /**
68      * @return string
69      *
70      * @since  Method available since Release 4.0.0
71      */
72     public static function getReleaseChannel()
73     {
74         if (strpos(self::$pharVersion, '-') !== false) {
75             return '-nightly';
76         }
77
78         return '';
79     }
80 }