|
11 | 11 |
|
12 | 12 | use const PHP_EOL;
|
13 | 13 | use function count;
|
| 14 | +use function defined; |
14 | 15 | use function explode;
|
15 | 16 | use function max;
|
16 | 17 | use function preg_replace_callback;
|
@@ -149,7 +150,7 @@ static function ($matches)
|
149 | 150 | */
|
150 | 151 | private function elements(): array
|
151 | 152 | {
|
152 |
| - return [ |
| 153 | + $elements = [ |
153 | 154 | 'Usage' => [
|
154 | 155 | ['text' => 'phpunit [options] UnitTest [UnitTest.php]'],
|
155 | 156 | ['text' => 'phpunit [options] <directory>'],
|
@@ -250,13 +251,23 @@ private function elements(): array
|
250 | 251 | ['arg' => '--generate-configuration', 'desc' => 'Generate configuration file with suggested settings'],
|
251 | 252 | ['arg' => '--cache-result-file=<file>', 'desc' => 'Specify result cache path and filename'],
|
252 | 253 | ],
|
| 254 | + ]; |
253 | 255 |
|
254 |
| - 'Miscellaneous Options' => [ |
255 |
| - ['arg' => '-h|--help', 'desc' => 'Prints this usage information'], |
256 |
| - ['arg' => '--version', 'desc' => 'Prints the version and exits'], |
257 |
| - ['arg' => '--atleast-version <min>', 'desc' => 'Checks that version is greater than min and exits'], |
258 |
| - ['arg' => '--check-version', 'desc' => 'Check whether PHPUnit is the latest version'], |
259 |
| - ], |
| 256 | + if (defined('__PHPUNIT_PHAR__')) { |
| 257 | + $elements['PHAR Options'] = [ |
| 258 | + ['arg' => '--manifest', 'desc' => 'Print Software Bill of Materials (SBOM) in plain-text format'], |
| 259 | + ['arg' => '--sbom', 'desc' => 'Print Software Bill of Materials (SBOM) in CycloneDX XML format'], |
| 260 | + ['arg' => '--composer-lock', 'desc' => 'Print composer.lock file used to build the PHAR'], |
| 261 | + ]; |
| 262 | + } |
| 263 | + |
| 264 | + $elements['Miscellaneous Options'] = [ |
| 265 | + ['arg' => '-h|--help', 'desc' => 'Prints this usage information'], |
| 266 | + ['arg' => '--version', 'desc' => 'Prints the version and exits'], |
| 267 | + ['arg' => '--atleast-version <min>', 'desc' => 'Checks that version is greater than min and exits'], |
| 268 | + ['arg' => '--check-version', 'desc' => 'Check whether PHPUnit is the latest version'], |
260 | 269 | ];
|
| 270 | + |
| 271 | + return $elements; |
261 | 272 | }
|
262 | 273 | }
|
0 commit comments