@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | Event::on( |
55 | 55 | Fields::class, |
56 | 56 | Fields::EVENT_REGISTER_FIELD_TYPES, |
57 | - function (RegisterComponentTypesEvent $event) { |
|
57 | + function(RegisterComponentTypesEvent $event) { |
|
58 | 58 | $event->types[] = RecipeField::class; |
59 | 59 | } |
60 | 60 | ); |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | Event::on( |
64 | 64 | Plugins::class, |
65 | 65 | Plugins::EVENT_AFTER_INSTALL_PLUGIN, |
66 | - function (PluginEvent $event) { |
|
66 | + function(PluginEvent $event) { |
|
67 | 67 | if (!Craft::$app->getRequest()->getIsConsoleRequest() |
68 | 68 | && ($event->plugin === $this)) { |
69 | 69 | Craft::$app->getResponse()->redirect(UrlHelper::cpUrl('recipe/welcome'))->send(); |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | } |
69 | 69 | // Render the template with our vars passed in |
70 | 70 | try { |
71 | - $htmlText = Craft::$app->view->renderTemplate('recipe/' .$templatePath, $params); |
|
71 | + $htmlText = Craft::$app->view->renderTemplate('recipe/'.$templatePath, $params); |
|
72 | 72 | $templateRendered = true; |
73 | 73 | } catch (\Exception $e) { |
74 | 74 | $templateRendered = false; |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | } |
84 | 84 | // Render the template with our vars passed in |
85 | 85 | try { |
86 | - $htmlText = Craft::$app->view->renderTemplate('recipe/' . $templatePath, $params); |
|
86 | + $htmlText = Craft::$app->view->renderTemplate('recipe/'.$templatePath, $params); |
|
87 | 87 | $templateRendered = true; |
88 | 88 | } catch (\Exception $e) { |
89 | 89 | $templateRendered = false; |
@@ -69,8 +69,7 @@ |
||
69 | 69 | 'transFatContent' => round($result->totalNutrients->FATRN->quantity / $yield, 1), |
70 | 70 | 'unsaturatedFatContent' => round(($result->totalNutrients->FAMS->quantity + $result->totalNutrients->FAPU->quantity) / $yield, 1), |
71 | 71 | ]; |
72 | - } |
|
73 | - catch (Exception $exception) { |
|
72 | + } catch (Exception $exception) { |
|
74 | 73 | $message = 'Error fetching nutritional information from API. '; |
75 | 74 | |
76 | 75 | switch ($exception->getCode()) { |
@@ -114,8 +114,7 @@ |
||
114 | 114 | if (!Craft::$app->getElements()->saveElement($entry)) { |
115 | 115 | $failed++; |
116 | 116 | } |
117 | - } |
|
118 | - else { |
|
117 | + } else { |
|
119 | 118 | $failed++; |
120 | 119 | } |
121 | 120 |
@@ -285,7 +285,7 @@ discard block |
||
285 | 285 | $review = [ |
286 | 286 | 'type' => 'Review', |
287 | 287 | 'author' => $rating['author'], |
288 | - 'name' => $this->name . ' ' . Craft::t('recipe', 'Review'), |
|
288 | + 'name' => $this->name.' '.Craft::t('recipe', 'Review'), |
|
289 | 289 | 'description' => $rating['review'], |
290 | 290 | 'reviewRating' => [ |
291 | 291 | 'type' => 'Rating', |
@@ -301,13 +301,13 @@ discard block |
||
301 | 301 | } |
302 | 302 | |
303 | 303 | if ($this->prepTime) { |
304 | - $recipeJSONLD['prepTime'] = 'PT' . $this->prepTime . 'M'; |
|
304 | + $recipeJSONLD['prepTime'] = 'PT'.$this->prepTime.'M'; |
|
305 | 305 | } |
306 | 306 | if ($this->cookTime) { |
307 | - $recipeJSONLD['cookTime'] = 'PT' . $this->cookTime . 'M'; |
|
307 | + $recipeJSONLD['cookTime'] = 'PT'.$this->cookTime.'M'; |
|
308 | 308 | } |
309 | 309 | if ($this->totalTime) { |
310 | - $recipeJSONLD['totalTime'] = 'PT' . $this->totalTime . 'M'; |
|
310 | + $recipeJSONLD['totalTime'] = 'PT'.$this->totalTime.'M'; |
|
311 | 311 | } |
312 | 312 | |
313 | 313 | return $recipeJSONLD; |
@@ -476,11 +476,11 @@ discard block |
||
476 | 476 | $units = rtrim($units); |
477 | 477 | $units = rtrim($units, 's'); |
478 | 478 | } |
479 | - $ingredient .= ' ' . $units; |
|
479 | + $ingredient .= ' '.$units; |
|
480 | 480 | } |
481 | 481 | } |
482 | 482 | if ($row['ingredient']) { |
483 | - $ingredient .= ' ' . $row['ingredient']; |
|
483 | + $ingredient .= ' '.$row['ingredient']; |
|
484 | 484 | } |
485 | 485 | if ($raw) { |
486 | 486 | $ingredient = Template::raw($ingredient); |