Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.
Common duplication problems, and corresponding solutions are:
1 | <?php namespace Bantenprov\VueWorkflow\Console\Commands; |
||
11 | class VueWorkflowCommand extends Command |
||
12 | { |
||
13 | |||
14 | /** |
||
15 | * The name and signature of the console command. |
||
16 | * |
||
17 | * @var string |
||
18 | */ |
||
19 | protected $signature = 'vue-workflow:publish-trait'; |
||
20 | |||
21 | /** |
||
22 | * The console command description. |
||
23 | * |
||
24 | * @var string |
||
25 | */ |
||
26 | protected $description = 'Publish Trait for Bantenprov\VueWorkflow package'; |
||
27 | |||
28 | /** |
||
29 | * Create a new command instance. |
||
30 | * |
||
31 | * @return void |
||
|
|||
32 | */ |
||
33 | public function __construct() |
||
37 | |||
38 | /** |
||
39 | * Execute the console command. |
||
40 | * |
||
41 | * @return mixed |
||
42 | */ |
||
43 | public function handle() |
||
64 | } |
||
65 |
Adding a
@return
annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.