tpaksu /
laravel-todobar
| 1 | <?php |
||||
| 2 | |||||
| 3 | namespace TPaksu\TodoBar\Controllers; |
||||
| 4 | |||||
| 5 | use App\Http\Controllers\Controller; |
||||
|
0 ignored issues
–
show
|
|||||
| 6 | use Illuminate\Http\Request; |
||||
|
0 ignored issues
–
show
The type
Illuminate\Http\Request was not found. Maybe you did not declare it correctly or list all dependencies?
The issue could also be caused by a filter entry in the build configuration.
If the path has been excluded in your configuration, e.g. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths Loading history...
|
|||||
| 7 | use TPaksu\TodoBar\Storage\DataStorageInterface; |
||||
| 8 | |||||
| 9 | class TodoBarProjects extends Controller |
||||
| 10 | { |
||||
| 11 | |||||
| 12 | protected $storage; |
||||
| 13 | |||||
| 14 | public function __construct(DataStorageInterface $storage) |
||||
| 15 | { |
||||
| 16 | $this->storage = $storage; |
||||
| 17 | } |
||||
| 18 | /** |
||||
| 19 | * Display a listing of the resource. |
||||
| 20 | * |
||||
| 21 | * @return \Illuminate\Http\Response |
||||
|
0 ignored issues
–
show
The type
Illuminate\Http\Response was not found. Maybe you did not declare it correctly or list all dependencies?
The issue could also be caused by a filter entry in the build configuration.
If the path has been excluded in your configuration, e.g. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths Loading history...
|
|||||
| 22 | */ |
||||
| 23 | public function index() |
||||
| 24 | { |
||||
| 25 | $data = collect($this->storage->all())->pluck("name"); |
||||
|
0 ignored issues
–
show
The function
collect was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||
| 26 | return response()->json(["status" => "success", "data" => $data], 200); |
||||
|
0 ignored issues
–
show
The function
response was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||
| 27 | } |
||||
| 28 | |||||
| 29 | /** |
||||
| 30 | * Store a newly created resource in storage. |
||||
| 31 | * |
||||
| 32 | * @param \Illuminate\Http\Request $request |
||||
| 33 | * @return \Illuminate\Http\Response |
||||
| 34 | */ |
||||
| 35 | public function store(Request $request) |
||||
| 36 | { |
||||
| 37 | $new_id = $this->storage->insert([ |
||||
| 38 | "name" => $request->name, |
||||
| 39 | "tasks" => [] |
||||
| 40 | ]); |
||||
| 41 | return response()->json(["status" => "success", "id" => $new_id, "name" => $request->name], 200); |
||||
|
0 ignored issues
–
show
The function
response was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||
| 42 | |||||
| 43 | } |
||||
| 44 | |||||
| 45 | /** |
||||
| 46 | * Display the specified resource. |
||||
| 47 | * |
||||
| 48 | * @param int $id |
||||
| 49 | * @return \Illuminate\Http\Response |
||||
| 50 | */ |
||||
| 51 | public function show($id) |
||||
| 52 | { |
||||
| 53 | $tasks = $this->storage->find($id) ?? []; |
||||
| 54 | return response()->json(["status" => "success", "tasks" => $tasks], 200); |
||||
|
0 ignored issues
–
show
The function
response was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||
| 55 | } |
||||
| 56 | |||||
| 57 | /** |
||||
| 58 | * Update the specified resource in storage. |
||||
| 59 | * |
||||
| 60 | * @param \Illuminate\Http\Request $request |
||||
| 61 | * @param int $id |
||||
| 62 | * @return \Illuminate\Http\Response |
||||
| 63 | */ |
||||
| 64 | public function update(Request $request, $id) |
||||
| 65 | { |
||||
| 66 | $this->storage->update($id, [ |
||||
| 67 | "name" => $request->name, |
||||
| 68 | ]); |
||||
| 69 | return response()->json(["status" => "success", "id" => $id, "name" => $request->name], 200); |
||||
|
0 ignored issues
–
show
The function
response was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||
| 70 | } |
||||
| 71 | |||||
| 72 | /** |
||||
| 73 | * Remove the specified resource from storage. |
||||
| 74 | * |
||||
| 75 | * @param int $id |
||||
| 76 | * @return \Illuminate\Http\Response |
||||
| 77 | */ |
||||
| 78 | public function destroy($id) |
||||
| 79 | { |
||||
| 80 | $this->storage->delete($id); |
||||
| 81 | return response()->json(["status" => "success"], 200); |
||||
|
0 ignored issues
–
show
The function
response was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||
| 82 | } |
||||
| 83 | } |
||||
| 84 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths