File tree Expand file tree Collapse file tree 4 files changed +54
-1
lines changed
Expand file tree Collapse file tree 4 files changed +54
-1
lines changed Original file line number Diff line number Diff line change 1212 runs-on : ubuntu-latest
1313 steps :
1414 - name : Checkout code
15- uses : actions/checkout@v2
15+ uses : actions/checkout@v4
1616 - name : Create Release
1717 id : create_release
1818 uses : actions/create-release@v1
Original file line number Diff line number Diff line change 2929 'aspect ' => [
3030 'namespace ' => 'App \\Aspect ' ,
3131 ],
32+ 'class ' => [
33+ 'namespace ' => 'App ' ,
34+ ],
3235 'command ' => [
3336 'namespace ' => 'App \\Command ' ,
3437 ],
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ declare (strict_types=1 );
4+ /**
5+ * This file is part of Hyperf.
6+ *
7+ * @link https://www.hyperf.io
8+ * @document https://hyperf.wiki
9+ 10+ * @license https://github.com/hyperf/hyperf/blob/master/LICENSE
11+ */
12+ namespace Hyperf \Devtool \Generator ;
13+
14+ use Hyperf \Command \Annotation \Command ;
15+
16+ #[Command]
17+ class ClassCommand extends GeneratorCommand
18+ {
19+ public function __construct ()
20+ {
21+ parent ::__construct ('gen:class ' );
22+ }
23+
24+ public function configure ()
25+ {
26+ $ this ->setDescription ('Create a new class ' );
27+
28+ parent ::configure ();
29+ }
30+
31+ protected function getStub (): string
32+ {
33+ return $ this ->getConfig ()['stub ' ] ?? __DIR__ . '/stubs/class.stub ' ;
34+ }
35+
36+ protected function getDefaultNamespace (): string
37+ {
38+ return $ this ->getConfig ()['namespace ' ] ?? 'App ' ;
39+ }
40+ }
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ declare(strict_types=1);
4+
5+ namespace %NAMESPACE%;
6+
7+ class %CLASS%
8+ {
9+
10+ }
You can’t perform that action at this time.
0 commit comments