Repository navigation
Expand file tree
/
Copy pathHelpCommand.php
More file actions
34 lines (29 loc) · 2 KB
/
Copy pathHelpCommand.php
File metadata and controls
34 lines (29 loc) · 2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
declare(strict_types=1);
namespace TypePHP\Internal\Cli;
final class HelpCommand implements CommandInterface
{
public function execute(array $args, $outputStream = STDOUT, $errorStream = STDERR): int
{
$c = [CliFormatter::class, 'color'];
fwrite($outputStream, "\n " . $c(' TYPEPHP ', 'badge_green') . ' ' . $c('Runtime Type Checker', 'bold') . "\n\n");
fwrite($outputStream, ' ' . $c('USAGE', 'yellow') . "\n");
fwrite($outputStream, " vendor/bin/typephp <script.php>\n\n");
fwrite($outputStream, ' ' . $c('COMMANDS', 'yellow') . "\n");
fwrite($outputStream, ' ' . $c('config:init', 'green') . " Generate default typephp.php configuration file\n");
fwrite($outputStream, ' ' . $c('report', 'green') . " Display audit report summary in terminal\n");
fwrite($outputStream, ' ' . $c('report:merge', 'green') . " Merge multiple JSON report files into a unified report\n");
fwrite($outputStream, ' ' . $c('report:clear', 'green') . " Delete generated report file and shards\n");
fwrite($outputStream, ' ' . $c('cache:clear', 'green') . " Clear all cached transformed files\n");
fwrite($outputStream, ' ' . $c('cache:warm', 'green') . " Pre-transform and warm up cache for included files\n");
fwrite($outputStream, ' ' . $c('cache:rebuild', 'green') . " Clear and immediately warm up cache\n");
fwrite($outputStream, ' ' . $c('help', 'green') . " Display this help menu\n\n");
fwrite($outputStream, ' ' . $c('EXAMPLES', 'yellow') . "\n");
fwrite($outputStream, " vendor/bin/typephp config:init\n");
fwrite($outputStream, " vendor/bin/typephp report\n");
fwrite($outputStream, " vendor/bin/typephp report:merge module1.json module2.json --output=all.json\n");
fwrite($outputStream, " vendor/bin/typephp index.php\n");
fwrite($outputStream, " vendor/bin/typephp cache:rebuild\n\n");
return 0;
}
}