1 | <?php |
||
12 | class PublishDomain extends SaveEnvVariable |
||
13 | { |
||
14 | /** |
||
15 | * The name and signature of the console command. |
||
16 | * |
||
17 | * @var string |
||
18 | */ |
||
19 | protected $signature = 'publish:domain {domain?}'; |
||
20 | |||
21 | /** |
||
22 | * The console command description. |
||
23 | * |
||
24 | * @var string |
||
25 | */ |
||
26 | protected $description = 'Save acacha forge domain'; |
||
27 | |||
28 | /** |
||
29 | * ForgePublishRCParser |
||
30 | * |
||
31 | * @var ForgePublishRCParser |
||
32 | */ |
||
33 | protected $parser; |
||
34 | |||
35 | /** |
||
36 | * SaveEnvVariable constructor. |
||
37 | * |
||
38 | */ |
||
39 | public function __construct(ForgePublishRCParser $parser) |
||
44 | |||
45 | /** |
||
46 | * Env var to set. |
||
47 | * |
||
48 | * @return mixed |
||
49 | */ |
||
50 | protected function envVar() |
||
54 | |||
55 | /** |
||
56 | * Argument key. |
||
57 | * |
||
58 | * @return mixed |
||
59 | */ |
||
60 | protected function argKey() |
||
64 | |||
65 | /** |
||
66 | * Question text. |
||
67 | * |
||
68 | * @return mixed |
||
69 | */ |
||
70 | protected function questionText() |
||
74 | |||
75 | /** |
||
76 | * Default proposed value when asking. |
||
77 | * |
||
78 | */ |
||
79 | protected function default() |
||
83 | |||
84 | /** |
||
85 | * Default domain. |
||
86 | * |
||
87 | * @return string |
||
88 | */ |
||
89 | protected function defaultDomain() |
||
96 | } |
||
97 |
The PSR-1: Basic Coding Standard recommends that a file should either introduce new symbols, that is classes, functions, constants or similar, or have side effects. Side effects are anything that executes logic, like for example printing output, changing ini settings or writing to a file.
The idea behind this recommendation is that merely auto-loading a class should not change the state of an application. It also promotes a cleaner style of programming and makes your code less prone to errors, because the logic is not spread out all over the place.
To learn more about the PSR-1, please see the PHP-FIG site on the PSR-1.