11<?php
22
3+ declare (strict_types=1 );
4+
5+ /**
6+ * This file is part of domprojects/codeigniter4-bootstrap.
7+ *
8+ * (c) domProjects
9+ *
10+ * For the full copyright and license information, please view
11+ * the LICENSE file that was distributed with this source code.
12+ */
13+
314namespace domProjects \CodeIgniterBootstrap \Commands ;
415
516use CodeIgniter \CLI \BaseCommand ;
617use CodeIgniter \CLI \CLI ;
718use domProjects \CodeIgniterBootstrap \Publishers \BootstrapPublisher ;
819use Throwable ;
920
21+ /**
22+ * Spark command used to publish Bootstrap distribution assets.
23+ */
1024class PublishBootstrap extends BaseCommand
1125{
26+ /**
27+ * Command group shown in the Spark command list.
28+ *
29+ * @var string
30+ */
1231 protected $ group = 'Bootstrap ' ;
32+
33+ /**
34+ * Command name used from the CLI.
35+ *
36+ * @var string
37+ */
1338 protected $ name = 'assets:publish-bootstrap ' ;
39+
40+ /**
41+ * Short description displayed in Spark help.
42+ *
43+ * @var string
44+ */
1445 protected $ description = 'Publishes Bootstrap 5 assets to public/assets/bootstrap. ' ;
46+
47+ /**
48+ * Usage string displayed in Spark help.
49+ *
50+ * @var string
51+ */
1552 protected $ usage = 'assets:publish-bootstrap [--force] ' ;
53+
54+ /**
55+ * Supported command options.
56+ *
57+ * @var array<string, string>
58+ */
1659 protected $ options = [
1760 '--force ' => 'Overwrite existing files. ' ,
1861 '-f ' => 'Alias of --force. ' ,
1962 ];
2063
21- public function run (array $ params )
64+ /**
65+ * Publishes the Bootstrap assets to the configured public destination.
66+ *
67+ * When `--force` is provided, existing files are overwritten.
68+ *
69+ * @param array<int|string, string|null> $params
70+ *
71+ * @return int CLI exit status code.
72+ */
73+ public function run (array $ params ): int
2274 {
2375 $ force = array_key_exists ('force ' , $ params )
2476 || array_key_exists ('f ' , $ params )
@@ -29,7 +81,7 @@ public function run(array $params)
2981
3082 CLI ::write (
3183 'Publishing Bootstrap assets to ' . $ publisher ->getDestination () . ($ force ? ' with overwrite... ' : '... ' ),
32- 'yellow '
84+ 'yellow ' ,
3385 );
3486
3587 try {
0 commit comments