Passed
Push — develop ( 83476a...6feee8 )
by Andrew
04:11
created
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/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.
src/Recipe.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
         Event::on(
84 84
             Fields::class,
85 85
             Fields::EVENT_REGISTER_FIELD_TYPES,
86
-            function (RegisterComponentTypesEvent $event) {
86
+            function(RegisterComponentTypesEvent $event) {
87 87
                 $event->types[] = RecipeField::class;
88 88
             }
89 89
         );
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
         Event::on(
93 93
             Plugins::class,
94 94
             Plugins::EVENT_AFTER_INSTALL_PLUGIN,
95
-            function (PluginEvent $event) {
95
+            function(PluginEvent $event) {
96 96
                 if (!Craft::$app->getRequest()->getIsConsoleRequest()
97 97
                     && ($event->plugin === $this)) {
98 98
                     Craft::$app->getResponse()->redirect(UrlHelper::cpUrl('recipe/welcome'))->send();
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
         $feedMeInstalled = Craft::$app->getPlugins()->isPluginInstalled('feed-me') && Craft::$app->getPlugins()->isPluginEnabled('feed-me');
104 104
 
105 105
         if ($feedMeInstalled) {
106
-            Event::on(FeedMeFields::class, FeedMeFields::EVENT_REGISTER_FEED_ME_FIELDS, function (RegisterFeedMeFieldsEvent $e) {
106
+            Event::on(FeedMeFields::class, FeedMeFields::EVENT_REGISTER_FEED_ME_FIELDS, function(RegisterFeedMeFieldsEvent $e) {
107 107
                 $e->fields[] = RecipeFeedMeField::class;
108 108
             });
109 109
         }
Please login to merge, or discard this patch.
src/services/ServicesTrait.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@
 block discarded – undo
35 35
         // ref: https://github.com/craftcms/cms/issues/1989
36 36
         $config = ArrayHelper::merge([
37 37
             'components' => [
38
-                'nutritionApi' => NutritionApi::class,]
38
+                'nutritionApi' => NutritionApi::class, ]
39 39
         ], $config);
40 40
 
41 41
         parent::__construct($id, $parent, $config);
Please login to merge, or discard this patch.
src/services/NutritionApi.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@
 block discarded – undo
56 56
             $yield = $result->yield ?: 1;
57 57
 
58 58
             return [
59
-                'servingSize' => round($result->totalWeight ?? 0 / $yield, 0) . ' grams',
59
+                'servingSize' => round($result->totalWeight ?? 0 / $yield, 0).' grams',
60 60
                 'calories' => round($result->totalNutrients->ENERC_KCAL->quantity ?? 0 / $yield, 0),
61 61
                 'carbohydrateContent' => round($result->totalNutrients->CHOCDF->quantity ?? 0 / $yield, 1),
62 62
                 'cholesterolContent' => round($result->totalNutrients->CHOLE->quantity ?? 0 / $yield, 1),
Please login to merge, or discard this patch.