@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | |
14 | 14 | use PHPUnit\Runner\Version; |
15 | 15 | |
16 | -if ( \class_exists('ConsoleHelpers\PHPUnitCompat\Autoload', false) === false ) { |
|
16 | +if (\class_exists('ConsoleHelpers\PHPUnitCompat\Autoload', false) === false) { |
|
17 | 17 | |
18 | 18 | /** |
19 | 19 | * Custom autoloader. |
@@ -38,26 +38,26 @@ discard block |
||
38 | 38 | public static function load($class_name) |
39 | 39 | { |
40 | 40 | // Only load classes belonging to this library. |
41 | - if ( \stripos($class_name, 'ConsoleHelpers\PHPUnitCompat') !== 0 ) { |
|
41 | + if (\stripos($class_name, 'ConsoleHelpers\PHPUnitCompat') !== 0) { |
|
42 | 42 | return false; |
43 | 43 | } |
44 | 44 | |
45 | - switch ( $class_name ) { |
|
45 | + switch ($class_name) { |
|
46 | 46 | case 'ConsoleHelpers\PHPUnitCompat\AbstractTestCase': |
47 | 47 | self::defineAliases(); |
48 | 48 | |
49 | 49 | $phpunit_version = self::getPhpUnitVersion(); |
50 | 50 | |
51 | - if ( version_compare($phpunit_version, '5.0.0', '<') ) { |
|
51 | + if (version_compare($phpunit_version, '5.0.0', '<')) { |
|
52 | 52 | require_once __DIR__ . '/src/PHPUnitCompat/AbstractTestCase4.php'; |
53 | 53 | } |
54 | - elseif ( version_compare($phpunit_version, '6.0.0', '<') ) { |
|
54 | + elseif (version_compare($phpunit_version, '6.0.0', '<')) { |
|
55 | 55 | require_once __DIR__ . '/src/PHPUnitCompat/AbstractTestCase5.php'; |
56 | 56 | } |
57 | - elseif ( version_compare($phpunit_version, '7.0.0', '<') ) { |
|
57 | + elseif (version_compare($phpunit_version, '7.0.0', '<')) { |
|
58 | 58 | require_once __DIR__ . '/src/PHPUnitCompat/AbstractTestCase6.php'; |
59 | 59 | } |
60 | - elseif ( version_compare($phpunit_version, '8.0.0', '<') ) { |
|
60 | + elseif (version_compare($phpunit_version, '8.0.0', '<')) { |
|
61 | 61 | require_once __DIR__ . '/src/PHPUnitCompat/AbstractTestCase7.php'; |
62 | 62 | } |
63 | 63 | else { |
@@ -69,16 +69,16 @@ discard block |
||
69 | 69 | case 'ConsoleHelpers\PHPUnitCompat\AbstractTestSuite': |
70 | 70 | $phpunit_version = self::getPhpUnitVersion(); |
71 | 71 | |
72 | - if ( version_compare($phpunit_version, '5.0.0', '<') ) { |
|
72 | + if (version_compare($phpunit_version, '5.0.0', '<')) { |
|
73 | 73 | require_once __DIR__ . '/src/PHPUnitCompat/AbstractTestSuite4.php'; |
74 | 74 | } |
75 | - elseif ( version_compare($phpunit_version, '6.0.0', '<') ) { |
|
75 | + elseif (version_compare($phpunit_version, '6.0.0', '<')) { |
|
76 | 76 | require_once __DIR__ . '/src/PHPUnitCompat/AbstractTestSuite5.php'; |
77 | 77 | } |
78 | - elseif ( version_compare($phpunit_version, '7.0.0', '<') ) { |
|
78 | + elseif (version_compare($phpunit_version, '7.0.0', '<')) { |
|
79 | 79 | require_once __DIR__ . '/src/PHPUnitCompat/AbstractTestSuite6.php'; |
80 | 80 | } |
81 | - elseif ( version_compare($phpunit_version, '8.0.0', '<') ) { |
|
81 | + elseif (version_compare($phpunit_version, '8.0.0', '<')) { |
|
82 | 82 | require_once __DIR__ . '/src/PHPUnitCompat/AbstractTestSuite7.php'; |
83 | 83 | } |
84 | 84 | else { |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | default: |
96 | 96 | $file = \realpath(__DIR__ . '/src/' . \strtr(\substr($class_name, 15), '\\', '/') . '.php'); |
97 | 97 | |
98 | - if ( \is_string($file) && \file_exists($file) === true ) { |
|
98 | + if (\is_string($file) && \file_exists($file) === true) { |
|
99 | 99 | require_once $file; |
100 | 100 | |
101 | 101 | return true; |
@@ -112,8 +112,8 @@ discard block |
||
112 | 112 | */ |
113 | 113 | protected static function getPhpUnitVersion() |
114 | 114 | { |
115 | - if ( self::$phpUnitVersion === null ) { |
|
116 | - if ( \class_exists('PHPUnit\Runner\Version') ) { |
|
115 | + if (self::$phpUnitVersion === null) { |
|
116 | + if (\class_exists('PHPUnit\Runner\Version')) { |
|
117 | 117 | self::$phpUnitVersion = Version::id(); |
118 | 118 | } |
119 | 119 | else { |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | protected static function defineAliases() |
133 | 133 | { |
134 | 134 | // PHPUnit Compat. |
135 | - if ( \class_exists('\PHPUnit_Framework_IncompleteTestError') ) { |
|
135 | + if (\class_exists('\PHPUnit_Framework_IncompleteTestError')) { |
|
136 | 136 | \class_alias( |
137 | 137 | '\PHPUnit_Framework_IncompleteTestError', |
138 | 138 | '\ConsoleHelpers\PHPUnitCompat\Framework\IncompleteTestError' |
@@ -145,14 +145,14 @@ discard block |
||
145 | 145 | ); |
146 | 146 | } |
147 | 147 | |
148 | - if ( class_exists('\PHPUnit_Framework_SkippedTestError') ) { |
|
148 | + if (class_exists('\PHPUnit_Framework_SkippedTestError')) { |
|
149 | 149 | \class_alias('\PHPUnit_Framework_SkippedTestError', '\ConsoleHelpers\PHPUnitCompat\Framework\SkippedTestError'); |
150 | 150 | } |
151 | 151 | else { |
152 | 152 | \class_alias('\PHPUnit\Framework\SkippedTestError', '\ConsoleHelpers\PHPUnitCompat\Framework\SkippedTestError'); |
153 | 153 | } |
154 | 154 | |
155 | - if ( class_exists('\PHPUnit_Framework_TestSuite_DataProvider') ) { |
|
155 | + if (class_exists('\PHPUnit_Framework_TestSuite_DataProvider')) { |
|
156 | 156 | \class_alias( |
157 | 157 | '\PHPUnit_Framework_TestSuite_DataProvider', |
158 | 158 | '\ConsoleHelpers\PHPUnitCompat\Framework\DataProviderTestSuite' |
@@ -165,14 +165,14 @@ discard block |
||
165 | 165 | ); |
166 | 166 | } |
167 | 167 | |
168 | - if ( class_exists('\PHPUnit_Framework_TestResult') ) { |
|
168 | + if (class_exists('\PHPUnit_Framework_TestResult')) { |
|
169 | 169 | \class_alias('\PHPUnit_Framework_TestResult', '\ConsoleHelpers\PHPUnitCompat\Framework\TestResult'); |
170 | 170 | } |
171 | 171 | else { |
172 | 172 | \class_alias('\PHPUnit\Framework\TestResult', '\ConsoleHelpers\PHPUnitCompat\Framework\TestResult'); |
173 | 173 | } |
174 | 174 | |
175 | - if ( class_exists('\PHPUnit_Framework_Test') ) { |
|
175 | + if (class_exists('\PHPUnit_Framework_Test')) { |
|
176 | 176 | \class_alias('\PHPUnit_Framework_Test', '\ConsoleHelpers\PHPUnitCompat\Framework\Test'); |
177 | 177 | } |
178 | 178 | else { |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | } |
181 | 181 | |
182 | 182 | // CodeCoverage Compat. |
183 | - if ( class_exists('\PHP_CodeCoverage') ) { |
|
183 | + if (class_exists('\PHP_CodeCoverage')) { |
|
184 | 184 | \class_alias('\PHP_CodeCoverage', '\ConsoleHelpers\CodeCoverageCompat\CodeCoverage'); |
185 | 185 | } |
186 | 186 | else { |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | ); |
191 | 191 | } |
192 | 192 | |
193 | - if ( \interface_exists('\PHP_CodeCoverage_Driver') ) { |
|
193 | + if (\interface_exists('\PHP_CodeCoverage_Driver')) { |
|
194 | 194 | \class_alias('\PHP_CodeCoverage_Driver', '\ConsoleHelpers\CodeCoverageCompat\Driver\Driver'); |
195 | 195 | } |
196 | 196 | else { |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | ); |
201 | 201 | } |
202 | 202 | |
203 | - if ( class_exists('\PHP_CodeCoverage_Filter') ) { |
|
203 | + if (class_exists('\PHP_CodeCoverage_Filter')) { |
|
204 | 204 | \class_alias('\PHP_CodeCoverage_Filter', '\ConsoleHelpers\CodeCoverageCompat\Filter'); |
205 | 205 | } |
206 | 206 | else { |