Passed
Pull Request — develop (#37)
by
unknown
07:42
created
src/Recipe.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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();
Please login to merge, or discard this patch.
src/helpers/PluginTemplate.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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;
Please login to merge, or discard this patch.
src/services/NutritionApi.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -69,8 +69,7 @@
 block discarded – undo
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()) {
Please login to merge, or discard this patch.
src/console/controllers/NutritionApiController.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -114,8 +114,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/models/Recipe.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -288,7 +288,7 @@  discard block
 block discarded – undo
288 288
                 $review = [
289 289
                     'type' => 'Review',
290 290
                     'author' => $rating['author'],
291
-                    'name' => $this->name . ' ' . Craft::t('recipe', 'Review'),
291
+                    'name' => $this->name.' '.Craft::t('recipe', 'Review'),
292 292
                     'description' => $rating['review'],
293 293
                     'reviewRating' => [
294 294
                         'type' => 'Rating',
@@ -304,13 +304,13 @@  discard block
 block discarded – undo
304 304
         }
305 305
 
306 306
         if ($this->prepTime) {
307
-            $recipeJSONLD['prepTime'] = 'PT' . $this->prepTime . 'M';
307
+            $recipeJSONLD['prepTime'] = 'PT'.$this->prepTime.'M';
308 308
         }
309 309
         if ($this->cookTime) {
310
-            $recipeJSONLD['cookTime'] = 'PT' . $this->cookTime . 'M';
310
+            $recipeJSONLD['cookTime'] = 'PT'.$this->cookTime.'M';
311 311
         }
312 312
         if ($this->totalTime) {
313
-            $recipeJSONLD['totalTime'] = 'PT' . $this->totalTime . 'M';
313
+            $recipeJSONLD['totalTime'] = 'PT'.$this->totalTime.'M';
314 314
         }
315 315
 
316 316
         return $this->renderJsonLd($recipeJSONLD, $raw);
@@ -449,11 +449,11 @@  discard block
 block discarded – undo
449 449
                             $units = rtrim($units);
450 450
                             $units = rtrim($units, 's');
451 451
                         }
452
-                        $ingredient .= ' ' . $units;
452
+                        $ingredient .= ' '.$units;
453 453
                     }
454 454
                 }
455 455
                 if ($row['ingredient']) {
456
-                    $ingredient .= ' ' . $row['ingredient'];
456
+                    $ingredient .= ' '.$row['ingredient'];
457 457
                 }
458 458
                 if ($raw) {
459 459
                     $ingredient = Template::raw($ingredient);
@@ -591,8 +591,8 @@  discard block
 block discarded – undo
591 591
      */
592 592
     public function getServes(): string
593 593
     {
594
-        if(!empty($this->servesUnit)) {
595
-            return $this->serves . ' ' . $this->servesUnit;
594
+        if (!empty($this->servesUnit)) {
595
+            return $this->serves.' '.$this->servesUnit;
596 596
         } else {
597 597
             return $this->serves;
598 598
         }
Please login to merge, or discard this patch.