Skip to content

Commit 0d22d34

Browse files
committed
csfix
1 parent aac1ba1 commit 0d22d34

35 files changed

+62
-62
lines changed

app/Exceptions/Handler.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,12 @@ public function register()
6060
}
6161
});
6262

63-
$this->renderable(fn(NotFoundHttpException $e, $request) => response()->json([
63+
$this->renderable(fn (NotFoundHttpException $e, $request) => response()->json([
6464
'type' => 'api_error',
6565
'message' => 'Resource not found.',
6666
], 404));
6767

68-
$this->renderable(fn(MethodNotAllowedHttpException $e, $request) => response()->json([
68+
$this->renderable(fn (MethodNotAllowedHttpException $e, $request) => response()->json([
6969
'type' => 'api_error',
7070
'message' => $e->getMessage(),
7171
], 405));

app/External/Import/FromDataPack.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ private function importIngredients(Filesystem $dataDisk, Bar $bar, User $user):
175175
{
176176
$timerStart = microtime(true);
177177

178-
$existingIngredients = DB::table('ingredients')->select('id', 'name')->where('bar_id', $bar->id)->get()->keyBy(fn($ingredient) => Str::slug($ingredient->name));
178+
$existingIngredients = DB::table('ingredients')->select('id', 'name')->where('bar_id', $bar->id)->get()->keyBy(fn ($ingredient) => Str::slug($ingredient->name));
179179

180180
$ingredientsToInsert = [];
181181
$parentIngredientsToInsert = [];
@@ -320,7 +320,7 @@ private function importBaseCocktails(Filesystem $dataDisk, Bar $bar, User $user)
320320
$dbIngredients = DB::table('ingredients')->select('id', DB::raw('LOWER(name) AS name'))->where('bar_id', $bar->id)->get()->keyBy('name')->map(fn ($row) => $row->id)->toArray();
321321
$dbGlasses = DB::table('glasses')->select('id', DB::raw('LOWER(name) AS name'))->where('bar_id', $bar->id)->get()->keyBy('name')->map(fn ($row) => $row->id)->toArray();
322322
$dbMethods = DB::table('cocktail_methods')->select('id', DB::raw('LOWER(name) AS name'))->where('bar_id', $bar->id)->get()->keyBy('name')->map(fn ($row) => $row->id)->toArray();
323-
$existingCocktails = DB::table('cocktails')->select('id', 'name')->where('bar_id', $bar->id)->get()->keyBy(fn($cocktail) => Str::slug($cocktail->name));
323+
$existingCocktails = DB::table('cocktails')->select('id', 'name')->where('bar_id', $bar->id)->get()->keyBy(fn ($cocktail) => Str::slug($cocktail->name));
324324

325325
$cocktailImages = [];
326326
$uniqueTags = [];

app/External/Model/Calculator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public static function fromModel(CalculatorModel $model): self
2727
$model->getExternalId(),
2828
$model->name,
2929
$model->description,
30-
$model->blocks->map(fn(CalculatorBlock $block) => [
30+
$model->blocks->map(fn (CalculatorBlock $block) => [
3131
'label' => $block->label,
3232
'variable_name' => $block->variable_name,
3333
'value' => $block->value,

app/External/Model/Cocktail.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ private function __construct(
4545

4646
public static function fromModel(CocktailModel $model, bool $useFileURI = false, ?Units $toUnits = null): self
4747
{
48-
$images = $model->images->map(fn(ImageModel $image) => Image::fromModel($image, $useFileURI))->toArray();
48+
$images = $model->images->map(fn (ImageModel $image) => Image::fromModel($image, $useFileURI))->toArray();
4949

50-
$ingredients = $model->ingredients->map(fn(CocktailIngredientModel $cocktailIngredient) => CocktailIngredient::fromModel($cocktailIngredient, $toUnits))->toArray();
50+
$ingredients = $model->ingredients->map(fn (CocktailIngredientModel $cocktailIngredient) => CocktailIngredient::fromModel($cocktailIngredient, $toUnits))->toArray();
5151

5252
return new self(
5353
$model->getExternalId(),
@@ -207,7 +207,7 @@ public function toJSONLD(): string
207207
"recipeCategory" => "Drink",
208208
"recipeCuisine" => "Cocktail",
209209
"keywords" => implode(', ', $this->tags),
210-
"recipeIngredient" => array_map(fn(CocktailIngredient $ci) => (new CocktailIngredientFormatter($ci->amount, $ci->ingredient->name, $ci->optional))->format(), $this->ingredients),
210+
"recipeIngredient" => array_map(fn (CocktailIngredient $ci) => (new CocktailIngredientFormatter($ci->amount, $ci->ingredient->name, $ci->optional))->format(), $this->ingredients),
211211
], ['image' => $image]);
212212

213213
if ($data = json_encode($data, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES)) {

app/External/Model/CocktailIngredient.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ private function __construct(
3131

3232
public static function fromModel(CocktailIngredientModel $model, ?Units $toUnits = null): self
3333
{
34-
$substitutes = $model->substitutes->map(fn(CocktailIngredientSubstituteModel $substitute) => CocktailIngredientSubstitute::fromModel($substitute, $toUnits))->toArray();
34+
$substitutes = $model->substitutes->map(fn (CocktailIngredientSubstituteModel $substitute) => CocktailIngredientSubstitute::fromModel($substitute, $toUnits))->toArray();
3535

3636
$amount = $model->getAmount();
3737
if ($toUnits && !$model->getAmount()->units->isDash()) {

app/External/Model/Ingredient.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@ private function __construct(
4545

4646
public static function fromModel(IngredientModel $model, bool $useFileURI = false, ?Units $toUnits = null): self
4747
{
48-
$images = $model->images->map(fn(ImageModel $image) => Image::fromModel($image, $useFileURI))->toArray();
48+
$images = $model->images->map(fn (ImageModel $image) => Image::fromModel($image, $useFileURI))->toArray();
4949

50-
$ingredientParts = $model->ingredientParts->map(fn(ComplexIngredient $part) => Ingredient::fromModel($part->ingredient))->toArray();
50+
$ingredientParts = $model->ingredientParts->map(fn (ComplexIngredient $part) => Ingredient::fromModel($part->ingredient))->toArray();
5151

52-
$ingredientPrices = $model->prices->map(fn(IngredientPriceModel $price) => IngredientPrice::fromModel($price))->toArray();
52+
$ingredientPrices = $model->prices->map(fn (IngredientPriceModel $price) => IngredientPrice::fromModel($price))->toArray();
5353

5454
$defaultIngredientUnits = $model->getDefaultUnits();
5555
if ($model->getDefaultUnits()?->isConvertable() && $toUnits) {

app/Http/Controllers/IngredientController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ public function extra(Request $request, CocktailService $cocktailRepo, string $i
217217
$extraCocktails = Cocktail::whereIn('id', $extraShelfCocktails->diff($currentShelfCocktails)->values())->where('bar_id', '=', $ingredient->bar_id)->get();
218218

219219
return response()->json([
220-
'data' => $extraCocktails->map(fn(Cocktail $cocktail) => [
220+
'data' => $extraCocktails->map(fn (Cocktail $cocktail) => [
221221
'id' => $cocktail->id,
222222
'slug' => $cocktail->slug,
223223
'name' => $cocktail->name,

app/Http/Controllers/Public/CocktailController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function index(Request $request, string $slugOrId): JsonResource
5959
abort(400, $e->getMessage());
6060
}
6161

62-
$cocktails = $cocktailsQuery->paginate(50);
62+
$cocktails = $cocktailsQuery->paginate(52);
6363

6464
Cache::put($cacheKey, $cocktails, 3600);
6565

app/Http/Middleware/CheckMetricsAccess.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function handle(Request $request, Closure $next)
2626
return $next($request);
2727
}
2828

29-
$whitelist = array_filter(config('bar-assistant.metrics.allowed_ips', []), fn($ip) => $ip !== '');
29+
$whitelist = array_filter(config('bar-assistant.metrics.allowed_ips', []), fn ($ip) => $ip !== '');
3030

3131
if (count($whitelist) === 0) {
3232
abort(404);

app/Http/Middleware/EnsureRequestHasBarQuery.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ public function handle(Request $request, Closure $next): Response
2424
abort(400, sprintf("Missing required bar reference while requesting '%s'. Use 'Bar-Assistant-Bar-Id' header to specify bar id.", $request->path()));
2525
}
2626

27-
$bar = Cache::remember('ba:bar:' . $barId, 60 * 60 * 24, fn() => Bar::findOrFail($barId));
27+
$bar = Cache::remember('ba:bar:' . $barId, 60 * 60 * 24, fn () => Bar::findOrFail($barId));
2828

2929
if ($request->user()->cannot('access', $bar)) {
3030
abort(403);
3131
}
3232

33-
app()->singleton(BarContext::class, fn() => new BarContext($bar));
33+
app()->singleton(BarContext::class, fn () => new BarContext($bar));
3434

3535
return $next($request);
3636
}

0 commit comments

Comments
 (0)