mirror of
https://github.com/grocy/grocy.git
synced 2025-08-19 03:40:10 +00:00
Applied PHP formatting rules
This commit is contained in:
@@ -6,11 +6,6 @@ use Grocy\Controllers\Users\User;
|
||||
|
||||
class RecipesApiController extends BaseApiController
|
||||
{
|
||||
public function __construct(\DI\Container $container)
|
||||
{
|
||||
parent::__construct($container);
|
||||
}
|
||||
|
||||
public function AddNotFulfilledProductsToShoppingList(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||
{
|
||||
User::checkPermission($request, User::PERMISSION_SHOPPINGLIST_ITEMS_ADD);
|
||||
@@ -40,19 +35,21 @@ class RecipesApiController extends BaseApiController
|
||||
{
|
||||
return $this->GenericErrorResponse($response, $ex->getMessage());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function GetRecipeFulfillment(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||
{
|
||||
try
|
||||
{
|
||||
if(!isset($args['recipeId']))
|
||||
if (!isset($args['recipeId']))
|
||||
{
|
||||
return $this->ApiResponse($response, $this->getRecipesService()->GetRecipesResolved());
|
||||
}
|
||||
|
||||
$recipeResolved = FindObjectInArrayByPropertyValue($this->getRecipesService()->GetRecipesResolved(), 'recipe_id', $args['recipeId']);
|
||||
if(!$recipeResolved)
|
||||
|
||||
if (!$recipeResolved)
|
||||
{
|
||||
throw new \Exception('Recipe does not exist');
|
||||
}
|
||||
@@ -60,10 +57,18 @@ class RecipesApiController extends BaseApiController
|
||||
{
|
||||
return $this->ApiResponse($response, $recipeResolved);
|
||||
}
|
||||
|
||||
}
|
||||
catch (\Exception $ex)
|
||||
{
|
||||
return $this->GenericErrorResponse($response, $ex->getMessage());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function __construct(\DI\Container $container)
|
||||
{
|
||||
parent::__construct($container);
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user