mirror of
https://github.com/grocy/grocy.git
synced 2025-08-18 03:25:50 +00:00
Optimized imports
This commit is contained in:
@@ -4,12 +4,14 @@ namespace Grocy\Controllers;
|
||||
|
||||
use Grocy\Services\RecipesService;
|
||||
use Grocy\Helpers\Grocycode;
|
||||
use Psr\Http\Message\ResponseInterface as Response;
|
||||
use Psr\Http\Message\ServerRequestInterface as Request;
|
||||
|
||||
class RecipesController extends BaseController
|
||||
{
|
||||
use GrocycodeTrait;
|
||||
|
||||
public function MealPlan(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||
public function MealPlan(Request $request, Response $response, array $args)
|
||||
{
|
||||
$start = date('Y-m-d');
|
||||
if (isset($request->getQueryParams()['start']) && IsIsoDate($request->getQueryParams()['start']))
|
||||
@@ -69,7 +71,7 @@ class RecipesController extends BaseController
|
||||
]);
|
||||
}
|
||||
|
||||
public function Overview(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||
public function Overview(Request $request, Response $response, array $args)
|
||||
{
|
||||
$recipes = $this->getDatabase()->recipes()->where('type', RecipesService::RECIPE_TYPE_NORMAL)->orderBy('name', 'COLLATE NOCASE');
|
||||
$recipesResolved = $this->getRecipesService()->GetRecipesResolved('recipe_id > 0');
|
||||
@@ -147,7 +149,7 @@ class RecipesController extends BaseController
|
||||
return $this->renderPage($response, 'recipes', $viewData);
|
||||
}
|
||||
|
||||
public function RecipeEditForm(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||
public function RecipeEditForm(Request $request, Response $response, array $args)
|
||||
{
|
||||
$recipeId = $args['recipeId'];
|
||||
|
||||
@@ -164,7 +166,7 @@ class RecipesController extends BaseController
|
||||
]);
|
||||
}
|
||||
|
||||
public function RecipePosEditForm(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||
public function RecipePosEditForm(Request $request, Response $response, array $args)
|
||||
{
|
||||
if ($args['recipePosId'] == 'new')
|
||||
{
|
||||
@@ -190,12 +192,12 @@ class RecipesController extends BaseController
|
||||
}
|
||||
}
|
||||
|
||||
public function RecipesSettings(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||
public function RecipesSettings(Request $request, Response $response, array $args)
|
||||
{
|
||||
return $this->renderPage($response, 'recipessettings');
|
||||
}
|
||||
|
||||
public function MealPlanSectionEditForm(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||
public function MealPlanSectionEditForm(Request $request, Response $response, array $args)
|
||||
{
|
||||
if ($args['sectionId'] == 'new')
|
||||
{
|
||||
@@ -212,14 +214,14 @@ class RecipesController extends BaseController
|
||||
}
|
||||
}
|
||||
|
||||
public function MealPlanSectionsList(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||
public function MealPlanSectionsList(Request $request, Response $response, array $args)
|
||||
{
|
||||
return $this->renderPage($response, 'mealplansections', [
|
||||
'mealplanSections' => $this->getDatabase()->meal_plan_sections()->where('id > 0')->orderBy('sort_number')
|
||||
]);
|
||||
}
|
||||
|
||||
public function RecipeGrocycodeImage(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||
public function RecipeGrocycodeImage(Request $request, Response $response, array $args)
|
||||
{
|
||||
$gc = new Grocycode(Grocycode::RECIPE, $args['recipeId']);
|
||||
return $this->ServeGrocycodeImage($request, $response, $gc);
|
||||
|
Reference in New Issue
Block a user