1 | <?php |
||
18 | class PublishCreateSite extends Command |
||
19 | { |
||
20 | use WaitsForSite, InteractsWithEnvironment, ShowsErrorResponse, DiesIfNoEnvFileExists, DiesIfEnvVariableIsnotInstalled; |
||
21 | |||
22 | /** |
||
23 | * Project type. |
||
24 | * |
||
25 | * @var String |
||
26 | */ |
||
27 | protected $project_type; |
||
28 | |||
29 | /** |
||
30 | * Site directory. |
||
31 | * |
||
32 | * @var String |
||
33 | */ |
||
34 | protected $site_directory; |
||
35 | |||
36 | /** |
||
37 | * Domain. |
||
38 | * |
||
39 | * @var String |
||
40 | */ |
||
41 | protected $domain; |
||
42 | |||
43 | |||
44 | /** |
||
45 | * The name and signature of the console command. |
||
46 | * |
||
47 | * @var string |
||
48 | */ |
||
49 | protected $signature = 'publish:create_site {server?} {domain?} {project_type?} {site_directory?}'; |
||
50 | |||
51 | /** |
||
52 | * The console command description. |
||
53 | * |
||
54 | * @var string |
||
55 | */ |
||
56 | protected $description = 'Create site on forge for the current user'; |
||
57 | |||
58 | /** |
||
59 | * Guzzle Http client |
||
60 | * |
||
61 | * @var Client |
||
62 | */ |
||
63 | protected $http; |
||
64 | |||
65 | /** |
||
66 | * Laravel Forge site name. |
||
67 | * |
||
68 | * @var array |
||
69 | */ |
||
70 | protected $sites; |
||
71 | |||
72 | /** |
||
73 | * Laravel Forge site name. |
||
74 | * |
||
75 | * @var String |
||
76 | */ |
||
77 | protected $site; |
||
78 | |||
79 | /** |
||
80 | * Laravel Forge server. |
||
81 | * |
||
82 | * @var String |
||
83 | */ |
||
84 | protected $server; |
||
85 | |||
86 | /** |
||
87 | * Laravel Forge site id. |
||
88 | * |
||
89 | * @var integer |
||
90 | */ |
||
91 | protected $site_id; |
||
92 | |||
93 | /** |
||
94 | * API endpoint URL |
||
95 | * |
||
96 | * @var String |
||
97 | */ |
||
98 | protected $url; |
||
99 | |||
100 | /** |
||
101 | * PublishCreateSite constructor. |
||
102 | * |
||
103 | * @param Client $client |
||
|
|||
104 | */ |
||
105 | public function __construct(Client $http) |
||
110 | |||
111 | /** |
||
112 | * Get Value. |
||
113 | * |
||
114 | * @return array|int|null|string |
||
115 | */ |
||
116 | protected function getValue($value, $env_var, $command) |
||
124 | |||
125 | /** |
||
126 | * Get Forge server. |
||
127 | * |
||
128 | * @return array|int|null|string |
||
129 | */ |
||
130 | protected function getForgeServer() |
||
134 | |||
135 | /** |
||
136 | * Get Domain. |
||
137 | * |
||
138 | * @return array|int|null|string |
||
139 | */ |
||
140 | protected function getDomain() |
||
144 | |||
145 | /** |
||
146 | * Get project type. |
||
147 | * |
||
148 | * @return array|int|null|string |
||
149 | */ |
||
150 | protected function getProjectType() |
||
154 | |||
155 | /** |
||
156 | * Get site directory. |
||
157 | * |
||
158 | * @return array|int|null|string |
||
159 | */ |
||
160 | protected function getSiteDirectory() |
||
164 | |||
165 | /** |
||
166 | * Execute the console command. |
||
167 | * |
||
168 | */ |
||
169 | public function handle() |
||
183 | |||
184 | |||
185 | /** |
||
186 | * Obtain fields. |
||
187 | */ |
||
188 | protected function obtainFields() |
||
195 | |||
196 | /** |
||
197 | * Create site on Forge. |
||
198 | */ |
||
199 | protected function createSiteOnForge() |
||
220 | |||
221 | /** |
||
222 | * Obtain API endpoint URL. |
||
223 | */ |
||
224 | protected function obtainApiEndPointURL() |
||
229 | |||
230 | /** |
||
231 | * Check if command have to be skipped. |
||
232 | */ |
||
233 | protected function abortCommandExecution() |
||
239 | |||
240 | /** |
||
241 | * Is site already created? |
||
242 | */ |
||
243 | protected function siteIsAlreadyCreated() |
||
252 | } |
||
253 |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italy
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.