@@ -5,7 +5,7 @@ |
||
| 5 | 5 | |
| 6 | 6 | return static function(ECSConfig $ecsConfig): void { |
| 7 | 7 | $ecsConfig->paths([ |
| 8 | - __DIR__ . '/src', |
|
| 8 | + __DIR__.'/src', |
|
| 9 | 9 | __FILE__, |
| 10 | 10 | ]); |
| 11 | 11 | $ecsConfig->parallel(); |
@@ -364,7 +364,7 @@ discard block |
||
| 364 | 364 | $review = [ |
| 365 | 365 | 'type' => 'Review', |
| 366 | 366 | 'author' => $rating['author'], |
| 367 | - 'name' => $this->name . ' ' . Craft::t('recipe', 'Review'), |
|
| 367 | + 'name' => $this->name.' '.Craft::t('recipe', 'Review'), |
|
| 368 | 368 | 'description' => $rating['review'], |
| 369 | 369 | 'reviewRating' => [ |
| 370 | 370 | 'type' => 'Rating', |
@@ -380,13 +380,13 @@ discard block |
||
| 380 | 380 | } |
| 381 | 381 | |
| 382 | 382 | if ($this->prepTime) { |
| 383 | - $recipeJSONLD['prepTime'] = 'PT' . $this->prepTime . 'M'; |
|
| 383 | + $recipeJSONLD['prepTime'] = 'PT'.$this->prepTime.'M'; |
|
| 384 | 384 | } |
| 385 | 385 | if ($this->cookTime) { |
| 386 | - $recipeJSONLD['cookTime'] = 'PT' . $this->cookTime . 'M'; |
|
| 386 | + $recipeJSONLD['cookTime'] = 'PT'.$this->cookTime.'M'; |
|
| 387 | 387 | } |
| 388 | 388 | if ($this->totalTime) { |
| 389 | - $recipeJSONLD['totalTime'] = 'PT' . $this->totalTime . 'M'; |
|
| 389 | + $recipeJSONLD['totalTime'] = 'PT'.$this->totalTime.'M'; |
|
| 390 | 390 | } |
| 391 | 391 | |
| 392 | 392 | return $recipeJSONLD; |
@@ -617,11 +617,11 @@ discard block |
||
| 617 | 617 | $units = rtrim($units); |
| 618 | 618 | $units = rtrim($units, 's'); |
| 619 | 619 | } |
| 620 | - $ingredient .= ' ' . $units; |
|
| 620 | + $ingredient .= ' '.$units; |
|
| 621 | 621 | } |
| 622 | 622 | } |
| 623 | 623 | if ($row['ingredient']) { |
| 624 | - $ingredient .= ' ' . $row['ingredient']; |
|
| 624 | + $ingredient .= ' '.$row['ingredient']; |
|
| 625 | 625 | } |
| 626 | 626 | if ($raw) { |
| 627 | 627 | $ingredient = Template::raw($ingredient); |
@@ -720,7 +720,7 @@ discard block |
||
| 720 | 720 | public function getServes() |
| 721 | 721 | { |
| 722 | 722 | if (!empty($this->servesUnit)) { |
| 723 | - return $this->serves . ' ' . $this->servesUnit; |
|
| 723 | + return $this->serves.' '.$this->servesUnit; |
|
| 724 | 724 | } |
| 725 | 725 | |
| 726 | 726 | return $this->serves; |
@@ -789,7 +789,7 @@ discard block |
||
| 789 | 789 | $whole = ''; |
| 790 | 790 | } |
| 791 | 791 | |
| 792 | - return $whole . $fraction; |
|
| 792 | + return $whole.$fraction; |
|
| 793 | 793 | } |
| 794 | 794 | |
| 795 | 795 | // Private Methods |
@@ -53,25 +53,25 @@ discard block |
||
| 53 | 53 | public function actionGenerate() |
| 54 | 54 | { |
| 55 | 55 | if (Recipe::$plugin->settings->hasApiCredentials() === false) { |
| 56 | - $this->stderr(Craft::t('recipe', 'API credentials do not exist in plugin settings.') . PHP_EOL, Console::FG_RED); |
|
| 56 | + $this->stderr(Craft::t('recipe', 'API credentials do not exist in plugin settings.').PHP_EOL, Console::FG_RED); |
|
| 57 | 57 | |
| 58 | 58 | return ExitCode::OK; |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | if ($this->section === null) { |
| 62 | - $this->stderr(Craft::t('recipe', 'A section handle must be provided using --section.') . PHP_EOL, Console::FG_RED); |
|
| 62 | + $this->stderr(Craft::t('recipe', 'A section handle must be provided using --section.').PHP_EOL, Console::FG_RED); |
|
| 63 | 63 | |
| 64 | 64 | return ExitCode::OK; |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | if ($this->field === null) { |
| 68 | - $this->stderr(Craft::t('recipe', 'A field handle must be provided using --field.') . PHP_EOL, Console::FG_RED); |
|
| 68 | + $this->stderr(Craft::t('recipe', 'A field handle must be provided using --field.').PHP_EOL, Console::FG_RED); |
|
| 69 | 69 | |
| 70 | 70 | return ExitCode::OK; |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | if ($this->field === null) { |
| 74 | - $this->stderr(Craft::t('recipe', 'A field handle must be provided using --field.') . PHP_EOL, Console::FG_RED); |
|
| 74 | + $this->stderr(Craft::t('recipe', 'A field handle must be provided using --field.').PHP_EOL, Console::FG_RED); |
|
| 75 | 75 | |
| 76 | 76 | return ExitCode::OK; |
| 77 | 77 | } |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | $entries = Entry::find()->section($this->section)->all(); |
| 80 | 80 | |
| 81 | 81 | if (empty($entries)) { |
| 82 | - $this->stderr(Craft::t('recipe', 'No entries found in the section with handle `{handle}`.', ['handle' => $this->section]) . PHP_EOL, Console::FG_RED); |
|
| 82 | + $this->stderr(Craft::t('recipe', 'No entries found in the section with handle `{handle}`.', ['handle' => $this->section]).PHP_EOL, Console::FG_RED); |
|
| 83 | 83 | |
| 84 | 84 | return ExitCode::OK; |
| 85 | 85 | } |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | $count = 0; |
| 89 | 89 | $failed = 0; |
| 90 | 90 | |
| 91 | - $this->stdout(Craft::t('recipe', 'Generating nutritional information for {count} entries...', ['count' => $total]) . PHP_EOL, Console::FG_YELLOW); |
|
| 91 | + $this->stdout(Craft::t('recipe', 'Generating nutritional information for {count} entries...', ['count' => $total]).PHP_EOL, Console::FG_YELLOW); |
|
| 92 | 92 | |
| 93 | 93 | Console::startProgress($count, $total, '', 0.8); |
| 94 | 94 | |
@@ -127,10 +127,10 @@ discard block |
||
| 127 | 127 | |
| 128 | 128 | $succeeded = $count - $failed; |
| 129 | 129 | |
| 130 | - $this->stdout(Craft::t('recipe', 'Successfully generated nutritional information for {count} entries.', ['count' => $succeeded]) . PHP_EOL, Console::FG_GREEN); |
|
| 130 | + $this->stdout(Craft::t('recipe', 'Successfully generated nutritional information for {count} entries.', ['count' => $succeeded]).PHP_EOL, Console::FG_GREEN); |
|
| 131 | 131 | |
| 132 | 132 | if ($failed > 0) { |
| 133 | - $this->stderr(Craft::t('recipe', 'Failed to generate nutritional information for {count} entries.', ['count' => $failed]) . PHP_EOL, Console::FG_RED); |
|
| 133 | + $this->stderr(Craft::t('recipe', 'Failed to generate nutritional information for {count} entries.', ['count' => $failed]).PHP_EOL, Console::FG_RED); |
|
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | return ExitCode::OK; |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | |
| 67 | 67 | // Render the template with our vars passed in |
| 68 | 68 | try { |
| 69 | - $htmlText = Craft::$app->view->renderTemplate('recipe/' . $templatePath, $params); |
|
| 69 | + $htmlText = Craft::$app->view->renderTemplate('recipe/'.$templatePath, $params); |
|
| 70 | 70 | $templateRendered = true; |
| 71 | 71 | } catch (\Exception $exception) { |
| 72 | 72 | $templateRendered = false; |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | |
| 83 | 83 | // Render the template with our vars passed in |
| 84 | 84 | try { |
| 85 | - $htmlText = Craft::$app->view->renderTemplate('recipe/' . $templatePath, $params); |
|
| 85 | + $htmlText = Craft::$app->view->renderTemplate('recipe/'.$templatePath, $params); |
|
| 86 | 86 | $templateRendered = true; |
| 87 | 87 | } catch (\Exception $exception) { |
| 88 | 88 | $templateRendered = false; |
@@ -135,7 +135,7 @@ |
||
| 135 | 135 | 'prefix' => Craft::$app->getView()->namespaceInputId(''), |
| 136 | 136 | ]; |
| 137 | 137 | $jsonVars = Json::encode($jsonVars); |
| 138 | - Craft::$app->getView()->registerJs("$('#{$nameSpacedId}-field').RecipeRecipe(" . $jsonVars . ");"); |
|
| 138 | + Craft::$app->getView()->registerJs("$('#{$nameSpacedId}-field').RecipeRecipe(".$jsonVars.");"); |
|
| 139 | 139 | |
| 140 | 140 | // Set asset elements |
| 141 | 141 | $elements = []; |
@@ -37,8 +37,8 @@ discard block |
||
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | $url = 'https://api.edamam.com/api/nutrition-details' |
| 40 | - . '?app_id=' . Craft::parseEnv(Recipe::$plugin->settings->apiApplicationId) |
|
| 41 | - . '&app_key=' . Craft::parseEnv(Recipe::$plugin->settings->apiApplicationKey); |
|
| 40 | + . '?app_id='.Craft::parseEnv(Recipe::$plugin->settings->apiApplicationId) |
|
| 41 | + . '&app_key='.Craft::parseEnv(Recipe::$plugin->settings->apiApplicationKey); |
|
| 42 | 42 | |
| 43 | 43 | $data = [ |
| 44 | 44 | 'ingr' => $ingredients, |
@@ -56,7 +56,7 @@ discard block |
||
| 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), |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | break; |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | - Craft::error($message . $exception->getMessage(), __METHOD__); |
|
| 84 | + Craft::error($message.$exception->getMessage(), __METHOD__); |
|
| 85 | 85 | |
| 86 | 86 | return ['error' => $message]; |
| 87 | 87 | } |