| Conditions | 1 |
| Paths | 1 |
| Total Lines | 41 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 59 | public function setup() |
||
| 60 | { |
||
| 61 | /* |
||
| 62 | |-------------------------------------------------------------------------- |
||
| 63 | | BASIC CRUD INFORMATION |
||
| 64 | |-------------------------------------------------------------------------- |
||
| 65 | */ |
||
| 66 | $this->crud->setModel(Import::class); |
||
| 67 | $this->crud->setRoute(config('backpack.base.route_prefix') . '/projects/' . request()->project . '/imports'); |
||
| 68 | $this->crud->setEntityNameStrings('Import', 'Imports'); |
||
| 69 | $this->addCustomDoctrineColumnTypes(); |
||
| 70 | //$this->crud->setFromDb(); |
||
|
1 ignored issue
–
show
|
|||
| 71 | |||
| 72 | // ------ CRUD FIELDS |
||
| 73 | |||
| 74 | // $this->crud->addFields(); |
||
|
1 ignored issue
–
show
|
|||
| 75 | // $this->crud->addFields($array_of_arrays, 'update/create/both'); |
||
|
1 ignored issue
–
show
|
|||
| 76 | // $this->crud->removeField('name', 'update/create/both'); |
||
|
1 ignored issue
–
show
|
|||
| 77 | // $this->crud->removeFields($array_of_names, 'update/create/both'); |
||
|
1 ignored issue
–
show
|
|||
| 78 | |||
| 79 | // ------ CRUD COLUMNS |
||
| 80 | // $this->crud->addColumn(); // add a single column, at the end of the stack |
||
|
1 ignored issue
–
show
|
|||
| 81 | // $this->crud->addColumns(); // add multiple columns, at the end of the stack |
||
|
1 ignored issue
–
show
|
|||
| 82 | // $this->crud->removeColumn('column_name'); // remove a column from the stack |
||
|
1 ignored issue
–
show
|
|||
| 83 | // $this->crud->removeColumns(['column_name_1', 'column_name_2']); // remove an array of columns from the stack |
||
|
1 ignored issue
–
show
|
|||
| 84 | // $this->crud->setColumnDetails('column_name', ['attribute' => 'value']); // adjusts the properties of the passed in column (by name) |
||
|
1 ignored issue
–
show
|
|||
| 85 | // $this->crud->setColumnsDetails(['column_1', 'column_2'], ['attribute' => 'value']); |
||
|
1 ignored issue
–
show
|
|||
| 86 | |||
| 87 | // ------ CRUD BUTTONS |
||
| 88 | // possible positions: 'beginning' and 'end'; defaults to 'beginning' for the 'line' stack, 'end' for the others; |
||
| 89 | // $this->crud->addButton($stack, $name, $type, $content, $position); // add a button; possible types are: view, model_function |
||
|
1 ignored issue
–
show
|
|||
| 90 | // $this->crud->addButtonFromModelFunction($stack, $name, $model_function_name, $position); // add a button whose HTML is returned by a method in the CRUD model |
||
|
1 ignored issue
–
show
|
|||
| 91 | // $this->crud->addButtonFromView($stack, $name, $view, $position); // add a button whose HTML is in a view placed at resources\views\vendor\backpack\crud\buttons |
||
|
1 ignored issue
–
show
|
|||
| 92 | // $this->crud->removeButton($name); |
||
|
1 ignored issue
–
show
|
|||
| 93 | // $this->crud->removeButtonFromStack($name, $stack); |
||
|
1 ignored issue
–
show
|
|||
| 94 | // $this->crud->removeAllButtons(); |
||
|
1 ignored issue
–
show
|
|||
| 95 | // $this->crud->removeAllButtonsFromStack('line'); |
||
|
1 ignored issue
–
show
|
|||
| 96 | |||
| 97 | // ------ CRUD ACCESS |
||
| 98 | $this->crud->allowAccess(['list', 'show']); |
||
| 99 | $this->crud->denyAccess(['create', 'update', 'delete', 'importProject']); |
||
| 100 | |||
| 361 |
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.
The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.
This check looks for comments that seem to be mostly valid code and reports them.