Passed
Push — develop ( 9b7cfe...741c85 )
by Andrew
06:49
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
@@ -322,7 +322,7 @@  discard block
 block discarded – undo
322 322
                 $review = [
323 323
                     'type' => 'Review',
324 324
                     'author' => $rating['author'],
325
-                    'name' => $this->name . ' ' . Craft::t('recipe', 'Review'),
325
+                    'name' => $this->name.' '.Craft::t('recipe', 'Review'),
326 326
                     'description' => $rating['review'],
327 327
                     'reviewRating' => [
328 328
                         'type' => 'Rating',
@@ -338,13 +338,13 @@  discard block
 block discarded – undo
338 338
         }
339 339
 
340 340
         if ($this->prepTime) {
341
-            $recipeJSONLD['prepTime'] = 'PT' . $this->prepTime . 'M';
341
+            $recipeJSONLD['prepTime'] = 'PT'.$this->prepTime.'M';
342 342
         }
343 343
         if ($this->cookTime) {
344
-            $recipeJSONLD['cookTime'] = 'PT' . $this->cookTime . 'M';
344
+            $recipeJSONLD['cookTime'] = 'PT'.$this->cookTime.'M';
345 345
         }
346 346
         if ($this->totalTime) {
347
-            $recipeJSONLD['totalTime'] = 'PT' . $this->totalTime . 'M';
347
+            $recipeJSONLD['totalTime'] = 'PT'.$this->totalTime.'M';
348 348
         }
349 349
 
350 350
         return $recipeJSONLD;
@@ -538,11 +538,11 @@  discard block
 block discarded – undo
538 538
                             $units = rtrim($units);
539 539
                             $units = rtrim($units, 's');
540 540
                         }
541
-                        $ingredient .= ' ' . $units;
541
+                        $ingredient .= ' '.$units;
542 542
                     }
543 543
                 }
544 544
                 if ($row['ingredient']) {
545
-                    $ingredient .= ' ' . $row['ingredient'];
545
+                    $ingredient .= ' '.$row['ingredient'];
546 546
                 }
547 547
                 if ($raw) {
548 548
                     $ingredient = Template::raw($ingredient);
@@ -703,8 +703,8 @@  discard block
 block discarded – undo
703 703
      */
704 704
     public function getServes(): string
705 705
     {
706
-        if(!empty($this->servesUnit)) {
707
-            return $this->serves . ' ' . $this->servesUnit;
706
+        if (!empty($this->servesUnit)) {
707
+            return $this->serves.' '.$this->servesUnit;
708 708
         }
709 709
 
710 710
         return $this->serves;
Please login to merge, or discard this patch.