|
17 | 17 | use Illuminate\Contracts\View\Factory; |
18 | 18 | use Illuminate\Filesystem\Filesystem; |
19 | 19 | use Illuminate\Support\Collection; |
| 20 | +use Illuminate\Support\Env; |
20 | 21 | use RuntimeException; |
21 | 22 | use Symfony\Component\Console\Input\InputOption; |
22 | 23 | use Symfony\Component\Console\Output\OutputInterface; |
@@ -68,9 +69,7 @@ class MetaCommand extends Command |
68 | 69 | protected $configMethods = [ |
69 | 70 | '\config()', |
70 | 71 | '\Illuminate\Config\Repository::get()', |
71 | | - '\Illuminate\Config\Repository::set()', |
72 | 72 | '\Illuminate\Support\Facades\Config::get()', |
73 | | - '\Illuminate\Support\Facades\Config::set()', |
74 | 73 | ]; |
75 | 74 |
|
76 | 75 | protected $userMethods = [ |
@@ -202,59 +201,105 @@ protected function registerClassAutoloadExceptions(): callable |
202 | 201 | protected function getExpectedArgumentSets() |
203 | 202 | { |
204 | 203 | return [ |
| 204 | + 'auth' => $this->loadTemplate('auth')->keys()->filter()->toArray(), |
205 | 205 | 'configs' => $this->loadTemplate('configs')->pluck('name')->filter()->toArray(), |
| 206 | + 'middleware' => $this->loadTemplate('middleware')->keys()->filter()->toArray(), |
206 | 207 | 'routes' => $this->loadTemplate('routes')->pluck('name')->filter()->toArray(), |
207 | 208 | 'views' => $this->loadTemplate('views')->pluck('key')->filter()->map(function ($value) { |
208 | 209 | return (string) $value; |
209 | 210 | })->toArray(), |
210 | 211 | 'translations' => $this->loadTemplate('translations')->filter()->keys()->toArray(), |
| 212 | + 'env' => array_keys($_ENV), |
211 | 213 | ]; |
212 | 214 | } |
213 | 215 |
|
214 | 216 | protected function getExpectedArguments() |
215 | 217 | { |
216 | 218 | return [ |
217 | | - '\config()' => [ |
218 | | - 0 => 'configs', |
| 219 | + [ |
| 220 | + 'class' => '\Illuminate\Support\Facades\Gate', |
| 221 | + 'method' => [ |
| 222 | + 'has', |
| 223 | + 'allows', |
| 224 | + 'denies', |
| 225 | + 'check', |
| 226 | + 'any', |
| 227 | + 'none', |
| 228 | + 'authorize', |
| 229 | + 'inspect', |
| 230 | + ], |
| 231 | + 'argumentSet' => 'auth' |
219 | 232 | ], |
220 | | - '\Illuminate\Config\Repository::get()' => [ |
221 | | - 0 => 'configs', |
| 233 | + [ |
| 234 | + 'class' => ['\Illuminate\Support\Facades\Route', '\Illuminate\Support\Facades\Auth'], |
| 235 | + 'method' => ['can', 'cannot'], |
| 236 | + 'argumentSet' => 'auth' |
222 | 237 | ], |
223 | | - '\Illuminate\Config\Repository::set()' => [ |
224 | | - 0 => 'configs', |
| 238 | + [ |
| 239 | + 'method' => 'config', |
| 240 | + 'argumentSet' => 'configs' |
225 | 241 | ], |
226 | | - '\Illuminate\Support\Facades\Config::get()' => [ |
227 | | - 0 => 'configs', |
| 242 | + [ |
| 243 | + 'class' => ['\Illuminate\Config\Repository', '\Illuminate\Support\Facades\Config'], |
| 244 | + 'method' => [ |
| 245 | + 'get', |
| 246 | + 'getMany', |
| 247 | + 'set', |
| 248 | + 'string', |
| 249 | + 'integer', |
| 250 | + 'boolean', |
| 251 | + 'float', |
| 252 | + 'array', |
| 253 | + 'prepend', |
| 254 | + 'push', |
| 255 | + ], |
| 256 | + 'argumentSet' => 'configs' |
228 | 257 | ], |
229 | | - '\Illuminate\Support\Facades\Config::set()' => [ |
230 | | - 0 => 'configs', |
| 258 | + [ |
| 259 | + 'class' => ['\Illuminate\Support\Facades\Route', '\Illuminate\Routing\Router'], |
| 260 | + 'method' => ['middleware', 'withoutMiddleware'], |
| 261 | + 'argumentSet' => 'middleware' |
231 | 262 | ], |
232 | | - '\route()' => [ |
233 | | - 0 => 'routes', |
| 263 | + [ |
| 264 | + 'method' => ['route', 'to_route', 'signedRoute'], |
| 265 | + 'argumentSet' => 'routes' |
234 | 266 | ], |
235 | | - '\Illuminate\Support\Facades\Route::get()' => [ |
236 | | - 0 => 'routes', |
| 267 | + [ |
| 268 | + 'class' => [ |
| 269 | + '\Illuminate\Support\Facades\Redirect', |
| 270 | + '\Illuminate\Support\Facades\URL', |
| 271 | + '\Illuminate\Routing\Redirector', |
| 272 | + '\Illuminate\Routing\UrlGenerator' |
| 273 | + ], |
| 274 | + 'method' => ['route', 'signedRoute', 'temporarySignedRoute'], |
| 275 | + 'argumentSet' => 'routes' |
237 | 276 | ], |
238 | | - '\Illuminate\Routing\Router::get()' => [ |
239 | | - 0 => 'routes', |
| 277 | + [ |
| 278 | + 'method' => 'view', |
| 279 | + 'argumentSet' => 'views' |
240 | 280 | ], |
241 | | - '\view()' => [ |
242 | | - 0 => 'views', |
| 281 | + [ |
| 282 | + 'class' => ['\Illuminate\Support\Facades\View', '\Illuminate\View\Factory'], |
| 283 | + 'method' => 'make', |
| 284 | + 'argumentSet' => 'views' |
243 | 285 | ], |
244 | | - '\Illuminate\Support\Facades\View::make()' => [ |
245 | | - 0 => 'views', |
| 286 | + [ |
| 287 | + 'method' => ['__', 'trans'], |
| 288 | + 'argumentSet' => 'translations' |
246 | 289 | ], |
247 | | - '\Illuminate\View\Factory::make()' => [ |
248 | | - 0 => 'views', |
| 290 | + [ |
| 291 | + 'class' => ['\Illuminate\Contracts\Translation\Translator'], |
| 292 | + 'method' => ['get'], |
| 293 | + 'argumentSet' => 'translations' |
249 | 294 | ], |
250 | | - '\__()' => [ |
251 | | - 0 => 'translations', |
| 295 | + [ |
| 296 | + 'method' => 'env', |
| 297 | + 'argumentSet' => 'env' |
252 | 298 | ], |
253 | | - '\trans()' => [ |
254 | | - 0 => 'translations', |
255 | | - ], |
256 | | - '\Illuminate\Contracts\Translation\Translator::get()' => [ |
257 | | - 0 => 'translations', |
| 299 | + [ |
| 300 | + 'class' => '\Illuminate\Support\Env', |
| 301 | + 'method' => 'get', |
| 302 | + 'argumentSet' => 'env' |
258 | 303 | ], |
259 | 304 | ]; |
260 | 305 | } |
|
0 commit comments