| Conditions | 1 |
| Paths | 1 |
| Total Lines | 10 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 15 | public function dataTable($query) |
||
| 16 | { |
||
| 17 | return datatables($query) |
||
|
1 ignored issue
–
show
|
|||
| 18 | ->editColumn('sensor_id', function ($sensordata) { |
||
| 19 | return '<a href="/sensor/' . $sensordata->sensor_id . '">'. $sensordata->sensor->name . '</a>'; |
||
| 20 | }) |
||
| 21 | ->addColumn('action', 'sensordata.action') |
||
| 22 | ->blacklist([ 'action']) |
||
| 23 | ->rawColumns(['sensor_id', 'action']); |
||
| 24 | } |
||
| 25 | |||
| 101 |
It seems like the method you are trying to call exists only in some of the possible types.
Let’s take a look at an example:
Available Fixes
Add an additional type-check:
Only allow a single type to be passed if the variable comes from a parameter: