We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
| 1 | <?php |
||
| 7 | class CrudModelBackpackCommand extends GeneratorCommand |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * The console command name. |
||
| 11 | * |
||
| 12 | * @var string |
||
| 13 | */ |
||
| 14 | protected $name = 'backpack:crud-model'; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * The name and signature of the console command. |
||
| 18 | * |
||
| 19 | * @var string |
||
| 20 | */ |
||
| 21 | protected $signature = 'backpack:crud-model |
||
| 22 | {name : Name of the model} |
||
| 23 | {--nomigration : Disables creating of the migration file}'; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * The console command description. |
||
| 27 | * |
||
| 28 | * @var string |
||
| 29 | */ |
||
| 30 | protected $description = 'Generate a Backpack CRUD model and migration'; |
||
| 31 | |||
| 32 | /** |
||
| 33 | * The type of class being generated. |
||
| 34 | * |
||
| 35 | * @var string |
||
| 36 | */ |
||
| 37 | protected $type = 'Model'; |
||
| 38 | |||
| 39 | /** |
||
| 40 | * Get the stub file for the generator. |
||
| 41 | * |
||
| 42 | * @return string |
||
| 43 | */ |
||
| 44 | protected function getStub() |
||
| 48 | |||
| 49 | /** |
||
| 50 | * Get the default namespace for the class. |
||
| 51 | * |
||
| 52 | * @param string $rootNamespace |
||
| 53 | * |
||
| 54 | * @return string |
||
| 55 | */ |
||
| 56 | protected function getDefaultNamespace($rootNamespace) |
||
| 60 | |||
| 61 | /** |
||
| 62 | * Replace the table name for the given stub. |
||
| 63 | * |
||
| 64 | * @param string $stub |
||
| 65 | * @param string $name |
||
| 66 | * |
||
| 67 | * @return string |
||
|
|
|||
| 68 | */ |
||
| 69 | protected function replaceTable(&$stub, $name) |
||
| 77 | |||
| 78 | /** |
||
| 79 | * Build the class with the given name. |
||
| 80 | * |
||
| 81 | * @param string $name |
||
| 82 | * |
||
| 83 | * @return string |
||
| 84 | */ |
||
| 85 | protected function buildClass($name) |
||
| 91 | |||
| 92 | /** |
||
| 93 | * Get the console command options. |
||
| 94 | * |
||
| 95 | * @return array |
||
| 96 | */ |
||
| 97 | protected function getOptions() |
||
| 103 | |||
| 104 | protected function buildMigration($name) |
||
| 111 | |||
| 112 | public function handle() |
||
| 120 | } |
||
| 121 |
This check compares the return type specified in the
@returnannotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.