1 | <?php |
||
9 | class GenerateJavascript extends Command |
||
10 | { |
||
11 | /** |
||
12 | * The name and signature of the console command. |
||
13 | * |
||
14 | * @var string |
||
15 | */ |
||
16 | protected $signature = 'eloquentjs:generate |
||
17 | {--models= : Models to include in the generated javascript} |
||
18 | {--namespace=App : Namespace prefix to use with the --models option} |
||
19 | {--output=public/eloquent.js : Where to save the generated javascript file}'; |
||
20 | |||
21 | /** |
||
22 | * The console command description. |
||
23 | * |
||
24 | * @var string |
||
25 | */ |
||
26 | protected $description = 'Generate a javascript file for an Eloquent-ish API in the browser'; |
||
27 | |||
28 | /** |
||
29 | * @var ModelInputParser |
||
30 | */ |
||
31 | protected $inputParser; |
||
32 | /** |
||
33 | * @var Generator |
||
34 | */ |
||
35 | protected $generator; |
||
36 | |||
37 | /** |
||
38 | * Create a new command instance. |
||
39 | * |
||
40 | * @param ModelInputParser $inputParser |
||
41 | * @param Generator $generator |
||
42 | */ |
||
43 | public function __construct(ModelInputParser $inputParser, Generator $generator) |
||
50 | |||
51 | /** |
||
52 | * Execute the console command. |
||
53 | * |
||
54 | * @return mixed |
||
55 | */ |
||
56 | public function handle() |
||
72 | |||
73 | /** |
||
74 | * Print the inferred Model => Endpoint mapping. |
||
75 | * |
||
76 | * @param $models |
||
77 | * @return void |
||
78 | */ |
||
79 | protected function printMapping($models) |
||
87 | |||
88 | /** |
||
89 | * Ask user to specify an endpoint for those we failed to determine automatically. |
||
90 | * |
||
91 | * @param array $models |
||
92 | */ |
||
93 | protected function promptUserForMissingEndpoints(&$models) |
||
101 | } |
||
102 |
This check looks at variables that are passed out again to other methods.
If the outgoing method call has stricter type requirements than the method itself, an issue is raised.
An additional type check may prevent trouble.