@@ -32,7 +32,7 @@ class MainController extends Controller {
3232 * @var IURLGenerator
3333 */
3434 private $ urlGenerator ;
35-
35+
3636 /**
3737 * @var RestParameterParser
3838 */
@@ -68,13 +68,13 @@ public function index(): TemplateResponse {
6868 * will prevent the controller to be called. If this does not happen for some reason, let the exception be
6969 * thrown and the user most probably has found a bug. A stack trace might help there.
7070 */
71-
71+
7272 $ this ->dbCacheService ->triggerCheck ();
7373
7474 Util::addScript ('cookbook ' , 'nextcloud-cookbook-main ' );
7575 return new TemplateResponse ($ this ->appName , 'index ' ); // templates/index.php
7676 }
77-
77+
7878 /**
7979 * @NoAdminRequired
8080 * @NoCSRFRequired
@@ -98,7 +98,7 @@ public function getApiVersion(): DataResponse {
9898 */
9999 public function categories () {
100100 $ this ->dbCacheService ->triggerCheck ();
101-
101+
102102 $ categories = $ this ->service ->getAllCategoriesInSearchIndex ();
103103 return new DataResponse ($ categories , 200 , ['Content-Type ' => 'application/json ' ]);
104104 }
@@ -109,18 +109,19 @@ public function categories() {
109109 */
110110 public function keywords () {
111111 $ this ->dbCacheService ->triggerCheck ();
112-
112+
113113 $ keywords = $ this ->service ->getAllKeywordsInSearchIndex ();
114114 return new DataResponse ($ keywords , 200 , ['Content-Type ' => 'application/json ' ]);
115115 }
116116
117117 /**
118118 * @NoAdminRequired
119119 * @NoCSRFRequired
120+ * @param string $query
120121 */
121122 public function search ($ query ) {
122123 $ this ->dbCacheService ->triggerCheck ();
123-
124+
124125 $ query = urldecode ($ query );
125126 try {
126127 $ recipes = $ this ->service ->findRecipesInSearchIndex ($ query );
@@ -152,10 +153,11 @@ public function search($query) {
152153 /**
153154 * @NoAdminRequired
154155 * @NoCSRFRequired
156+ * @param string $category
155157 */
156158 public function category ($ category ) {
157159 $ this ->dbCacheService ->triggerCheck ();
158-
160+
159161 $ category = urldecode ($ category );
160162 try {
161163 $ recipes = $ this ->service ->getRecipesByCategory ($ category );
@@ -186,6 +188,7 @@ public function category($category) {
186188 /**
187189 * @NoAdminRequired
188190 * @NoCSRFRequired
191+ * @param string $category
189192 */
190193 public function categoryUpdate ($ category ) {
191194 $ this ->dbCacheService ->triggerCheck ();
@@ -215,6 +218,7 @@ public function categoryUpdate($category) {
215218 /**
216219 * @NoAdminRequired
217220 * @NoCSRFRequired
221+ * @param string $keywords
218222 */
219223 public function tags ($ keywords ) {
220224 $ this ->dbCacheService ->triggerCheck ();
@@ -253,9 +257,9 @@ public function tags($keywords) {
253257 */
254258 public function import () {
255259 $ this ->dbCacheService ->triggerCheck ();
256-
260+
257261 $ data = $ this ->restParser ->getParameters ();
258-
262+
259263 if (!isset ($ data ['url ' ])) {
260264 return new DataResponse ('Field "url" is required ' , 400 );
261265 }
@@ -284,7 +288,7 @@ public function import() {
284288 */
285289 public function new () {
286290 $ this ->dbCacheService ->triggerCheck ();
287-
291+
288292 try {
289293 $ recipe_data = $ this ->restParser ->getParameters ();
290294 $ file = $ this ->service ->addRecipe ($ recipe_data );
@@ -299,18 +303,19 @@ public function new() {
299303 /**
300304 * @NoAdminRequired
301305 * @NoCSRFRequired
306+ * @param int $id
302307 */
303308 public function update ($ id ) {
304309 $ this ->dbCacheService ->triggerCheck ();
305-
310+
306311 try {
307312 $ recipe_data = $ this ->restParser ->getParameters ();
308313
309314 $ recipe_data ['id ' ] = $ id ;
310315
311316 $ file = $ this ->service ->addRecipe ($ recipe_data );
312317 $ this ->dbCacheService ->addRecipe ($ file );
313-
318+
314319 return new DataResponse ($ id );
315320 } catch (\Exception $ e ) {
316321 return new DataResponse ($ e ->getMessage (), 500 );
0 commit comments