Issues (40)

src/Contracts/ResourceControllerInterface.php (1 issue)

Labels
Severity
1
<?php
2
3
namespace RafflesArgentina\ResourceController\Contracts;
4
5
use Illuminate\Http\Request;
6
use Illuminate\Support\MessageBag;
7
8
use RafflesArgentina\ResourceController\Exceptions\ResourceControllerException;
9
10
interface ResourceControllerInterface
11
{
12
    /**
13
     * Display a listing of the resource.
14
     *
15
     * @param Request $request The request object.
16
     *
17
     * @return mixed
18
     */
19
    public function index(Request $request);
20
21
    /**
22
     * Show the form for creating a new resource.
23
     *
24
     * @param Request $request The request object.
25
     *
26
     * @return mixed
27
     */
28
    public function create(Request $request);
29
30
    /**
31
     * Store a newly created resource in storage.
32
     *
33
     * @param Request $request The request object.
34
     *
35
     * @throws ResourceControllerException
36
     *
37
     * @return mixed
38
     */
39
    public function store(Request $request);
40
41
    /**
42
     * Display the specified resource.
43
     *
44
     * @param Request $request The request object.
45
     * @param string  $key     The model key.
46
     *
47
     * @return mixed
48
     */
49
    public function show(Request $request, $key);
50
51
    /**
52
     * Show the form for editing the specified resource.
53
     *
54
     * @param Request $request The request object.
55
     * @param string  $key     The model key.
56
     *
57
     * @return mixed
58
     */
59
    public function edit(Request $request, $key);
60
61
    /**
62
     * Update the specified resource in storage.
63
     *
64
     * @param Request $request The request object.
65
     * @param string  $key     The model key.
66
     *
67
     * @throws ResourceControllerException
68
     *
69
     * @return mixed
70
     */
71
    public function update(Request $request, $key);
72
73
    /**
74
     * Remove the specified resource from storage.
75
     *
76
     * @param Request $request The request object.
77
     * @param string  $key     The model key.
78
     *
79
     * @throws ResourceControllerException
80
     *
81
     * @return mixed
82
     */
83
    public function destroy(Request $request, $key);
84
85
    /**
86
     * Get named route for the specified action.
87
     *
88
     * @param string $action The action.
89
     *
90
     * @return string
91
     */
92
    public function getRouteName($action);
93
94
    /**
95
     * Validate rules from a FormRequest instance.
96
     *
97
     * @return \Illuminate\Validation\Validator
98
     */
99
    public function validateRules();
100
101
    /**
102
     * Throw an exception if the view doesn't exist.
103
     *
104
     * @param string $view The view.
105
     *
106
     * @throws ResourceControllerException
107
     *
108
     * @return void
109
     */
110
    public function checkViewExists($view);
111
112
    /**
113
     * Find first by key.
114
     *
115
     * @param string $key The model key.
116
     *
117
     * @return Model|null
0 ignored issues
show
The type RafflesArgentina\Resourc...troller\Contracts\Model 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. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
118
     */
119
    public function findFirstByKey($key);
120
121
    /**
122
     * Get the FormRequest instance.
123
     *
124
     * @return mixed
125
     */
126
    public function getFormRequestInstance();
127
128
    /**
129
     * Get items collection.
130
     *
131
     * @param string $orderBy The order key.
132
     * @param string $order   The order direction.
133
     *
134
     * @return \Illuminate\Database\Eloquent\Collection
135
     */
136
    public function getItemsCollection($orderBy = 'updated_at', $order = 'desc');
137
138
    /**
139
     * Get Paginator instance.
140
     *
141
     * @param string $orderBy The order key.
142
     * @param string $order   The order direction.
143
     *
144
     * @return \Illuminate\Pagination\LengthAwarePaginator
145
     */
146
    public function getPaginatorInstance($orderBy = 'updated_at', $order = 'desc');
147
148
    /**
149
     * Get redirection route.
150
     *
151
     * @return string
152
     */
153
    public function getRedirectionRoute();
154
155
    /**
156
     * Get view location for the specified action.
157
     *
158
     * @param string $action The action.
159
     *
160
     * @return string
161
     */
162
    public function getViewLocation($action);
163
164
    /**
165
     * Redirect back with errors.
166
     *
167
     * @param \Illuminate\Validation\Validator $validator The validator instance.
168
     *
169
     * @return \Illuminate\Http\RedirectResponse
170
     */
171
    public function redirectBackWithErrors($validator);
172
}
173