We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
Conditions | 6 |
Paths | 5 |
Total Lines | 35 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
14 | public function show($id) |
||
15 | { |
||
16 | $this->crud->hasAccessOrFail('show'); |
||
17 | |||
18 | // get entry ID from Request (makes sure its the last ID for nested resources) |
||
19 | $id = $this->crud->getCurrentEntryId() ?? $id; |
||
20 | |||
21 | // set columns from db |
||
22 | $this->crud->setFromDb(); |
||
23 | |||
24 | // cycle through columns |
||
25 | foreach ($this->crud->columns as $key => $column) { |
||
26 | // remove any autoset relationship columns |
||
27 | if (array_key_exists('model', $column) && array_key_exists('autoset', $column) && $column['autoset']) { |
||
28 | $this->crud->removeColumn($column['name']); |
||
29 | } |
||
30 | |||
31 | // remove the row_number column, since it doesn't make sense in this context |
||
32 | if ($column['type'] == 'row_number') { |
||
33 | $this->crud->removeColumn($column['name']); |
||
34 | } |
||
35 | } |
||
36 | |||
37 | // get the info for that entry |
||
38 | $this->data['entry'] = $this->crud->getEntry($id); |
||
39 | $this->data['crud'] = $this->crud; |
||
40 | $this->data['title'] = trans('backpack::crud.preview').' '.$this->crud->entity_name; |
||
41 | |||
42 | // remove preview button from stack:line |
||
43 | $this->crud->removeButton('preview'); |
||
44 | $this->crud->removeButton('delete'); |
||
45 | |||
46 | // load the view from /resources/views/vendor/backpack/crud/ if it exists, otherwise load the one in the package |
||
47 | return view($this->crud->getShowView(), $this->data); |
||
48 | } |
||
49 | } |
||
50 |
This check compares the return type specified in the
@return
annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.