1 | <?php |
||
19 | class TagsController extends AuthorizedController |
||
20 | { |
||
21 | /** |
||
22 | * {@inheritdoc} |
||
23 | */ |
||
24 | protected $resource = Tag::class; |
||
25 | |||
26 | /** |
||
27 | * List all tags. |
||
28 | * |
||
29 | * @param \Cortex\Tags\DataTables\Adminarea\TagsDataTable $tagsDataTable |
||
30 | * |
||
31 | * @return \Illuminate\Http\JsonResponse|\Illuminate\View\View |
||
32 | */ |
||
33 | public function index(TagsDataTable $tagsDataTable) |
||
39 | |||
40 | /** |
||
41 | * List tag logs. |
||
42 | * |
||
43 | * @param \Cortex\Tags\Models\Tag $tag |
||
44 | * @param \Cortex\Foundation\DataTables\LogsDataTable $logsDataTable |
||
45 | * |
||
46 | * @return \Illuminate\Http\JsonResponse|\Illuminate\Http\RedirectResponse |
||
|
|||
47 | */ |
||
48 | public function logs(Tag $tag, LogsDataTable $logsDataTable) |
||
49 | { |
||
50 | return $logsDataTable->with([ |
||
51 | 'resource' => $tag, |
||
52 | 'tabs' => 'adminarea.tags.tabs', |
||
53 | 'id' => "adminarea-tags-{$tag->getRouteKey()}-logs-table", |
||
54 | ])->render('cortex/foundation::adminarea.pages.datatable-tab'); |
||
55 | } |
||
56 | |||
57 | /** |
||
58 | * Import tags. |
||
59 | * |
||
60 | * @param \Cortex\Tags\Models\Tag $tag |
||
61 | * @param \Cortex\Foundation\DataTables\ImportRecordsDataTable $importRecordsDataTable |
||
62 | * |
||
63 | * @return \Illuminate\View\View |
||
64 | */ |
||
65 | public function import(Tag $tag, ImportRecordsDataTable $importRecordsDataTable) |
||
74 | |||
75 | /** |
||
76 | * Stash tags. |
||
77 | * |
||
78 | * @param \Cortex\Foundation\Http\Requests\ImportFormRequest $request |
||
79 | * @param \Cortex\Foundation\Importers\DefaultImporter $importer |
||
80 | * |
||
81 | * @return void |
||
82 | */ |
||
83 | public function stash(ImportFormRequest $request, DefaultImporter $importer) |
||
89 | |||
90 | /** |
||
91 | * Hoard tags. |
||
92 | * |
||
93 | * @param \Cortex\Foundation\Http\Requests\ImportFormRequest $request |
||
94 | * |
||
95 | * @return \Illuminate\Http\JsonResponse|\Illuminate\Http\RedirectResponse |
||
96 | */ |
||
97 | public function hoard(ImportFormRequest $request) |
||
120 | |||
121 | /** |
||
122 | * List tag import logs. |
||
123 | * |
||
124 | * @param \Cortex\Foundation\DataTables\ImportLogsDataTable $importLogsDatatable |
||
125 | * |
||
126 | * @return \Illuminate\Http\JsonResponse|\Illuminate\Http\RedirectResponse |
||
127 | */ |
||
128 | public function importLogs(ImportLogsDataTable $importLogsDatatable) |
||
136 | |||
137 | /** |
||
138 | * Show tag create/edit form. |
||
139 | * |
||
140 | * @param \Cortex\Tags\Models\Tag $tag |
||
141 | * |
||
142 | * @return \Illuminate\View\View |
||
143 | */ |
||
144 | protected function form(Tag $tag) |
||
150 | |||
151 | /** |
||
152 | * Store new tag. |
||
153 | * |
||
154 | * @param \Cortex\Tags\Http\Requests\Adminarea\TagFormRequest $request |
||
155 | * @param \Cortex\Tags\Models\Tag $tag |
||
156 | * |
||
157 | * @return \Illuminate\Http\JsonResponse|\Illuminate\Http\RedirectResponse |
||
158 | */ |
||
159 | public function store(TagFormRequest $request, Tag $tag) |
||
163 | |||
164 | /** |
||
165 | * Update given tag. |
||
166 | * |
||
167 | * @param \Cortex\Tags\Http\Requests\Adminarea\TagFormRequest $request |
||
168 | * @param \Cortex\Tags\Models\Tag $tag |
||
169 | * |
||
170 | * @return \Illuminate\Http\JsonResponse|\Illuminate\Http\RedirectResponse |
||
171 | */ |
||
172 | public function update(TagFormRequest $request, Tag $tag) |
||
176 | |||
177 | /** |
||
178 | * Process stored/updated tag. |
||
179 | * |
||
180 | * @param \Illuminate\Foundation\Http\FormRequest $request |
||
181 | * @param \Cortex\Tags\Models\Tag $tag |
||
182 | * |
||
183 | * @return \Illuminate\Http\JsonResponse|\Illuminate\Http\RedirectResponse |
||
184 | */ |
||
185 | protected function process(FormRequest $request, Tag $tag) |
||
198 | |||
199 | /** |
||
200 | * Destroy given tag. |
||
201 | * |
||
202 | * @param \Cortex\Tags\Models\Tag $tag |
||
203 | * |
||
204 | * @throws \Exception |
||
205 | * |
||
206 | * @return \Illuminate\Http\JsonResponse|\Illuminate\Http\RedirectResponse |
||
207 | */ |
||
208 | public function destroy(Tag $tag) |
||
217 | } |
||
218 |
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.