Skip to content

Commit

Permalink
Merge pull request #347 from karlomikus/develop
Browse files Browse the repository at this point in the history
Update docs
  • Loading branch information
karlomikus authored Oct 26, 2024
2 parents 2469098 + 3054521 commit 5a0e940
Show file tree
Hide file tree
Showing 36 changed files with 404 additions and 391 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# v4.0.3
## Changes
- Added prod target to docker image

## Fixes
- Fixed wrong endpoint name

# v4.0.2
## Fixes
- Fixed a bug where the bar import command checked the wrong filepath
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/AuthController.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ function (User $user, string $password) {
abort(400, $status);
}

#[OAT\Post(path: '/auth/verify/{id}/{hash}', tags: ['Authentication'], summary: 'Confirm user account', parameters: [
#[OAT\Get(path: '/auth/verify/{id}/{hash}', tags: ['Authentication'], summary: 'Confirm user account', parameters: [
new OAT\Parameter(name: 'id', in: 'path', required: true, description: 'Database id of a user', schema: new OAT\Schema(type: 'integer')),
new OAT\Parameter(name: 'hash', in: 'path', required: true, description: 'Hash string sent to user email', schema: new OAT\Schema(type: 'string')),
], security: [])]
Expand Down
10 changes: 5 additions & 5 deletions app/Models/Bar.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public function getSlugOptions(): SlugOptions
}

/**
* @return BelongsToMany<User>
* @return BelongsToMany<User, $this>
*/
public function users(): BelongsToMany
{
Expand All @@ -82,31 +82,31 @@ public function users(): BelongsToMany
}

/**
* @return HasMany<BarMembership>
* @return HasMany<BarMembership, $this>
*/
public function memberships(): HasMany
{
return $this->hasMany(BarMembership::class);
}

/**
* @return HasMany<Cocktail>
* @return HasMany<Cocktail, $this>
*/
public function cocktails(): HasMany
{
return $this->hasMany(Cocktail::class);
}

/**
* @return HasMany<Ingredient>
* @return HasMany<Ingredient, $this>
*/
public function ingredients(): HasMany
{
return $this->hasMany(Ingredient::class);
}

/**
* @return HasMany<Export>
* @return HasMany<Export, $this>
*/
public function exports(): HasMany
{
Expand Down
14 changes: 7 additions & 7 deletions app/Models/BarMembership.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,55 +21,55 @@ class BarMembership extends Model
];

/**
* @return BelongsTo<Bar, BarMembership>
* @return BelongsTo<Bar, $this>
*/
public function bar(): BelongsTo
{
return $this->belongsTo(Bar::class);
}

/**
* @return BelongsTo<UserRole, BarMembership>
* @return BelongsTo<UserRole, $this>
*/
public function role(): BelongsTo
{
return $this->belongsTo(UserRole::class, 'user_role_id');
}

/**
* @return BelongsTo<User, BarMembership>
* @return BelongsTo<User, $this>
*/
public function user(): BelongsTo
{
return $this->belongsTo(User::class);
}

/**
* @return HasMany<UserIngredient>
* @return HasMany<UserIngredient, $this>
*/
public function userIngredients(): HasMany
{
return $this->hasMany(UserIngredient::class);
}

/**
* @return HasMany<UserShoppingList>
* @return HasMany<UserShoppingList, $this>
*/
public function shoppingListIngredients(): HasMany
{
return $this->hasMany(UserShoppingList::class);
}

/**
* @return HasMany<CocktailFavorite>
* @return HasMany<CocktailFavorite, $this>
*/
public function cocktailFavorites(): HasMany
{
return $this->hasMany(CocktailFavorite::class);
}

/**
* @return HasMany<CocktailCollection>
* @return HasMany<CocktailCollection, $this>
*/
public function cocktailCollections(): HasMany
{
Expand Down
14 changes: 7 additions & 7 deletions app/Models/Cocktail.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,55 +60,55 @@ public function getExternalId(): string
}

/**
* @return BelongsTo<Glass, Cocktail>
* @return BelongsTo<Glass, $this>
*/
public function glass(): BelongsTo
{
return $this->belongsTo(Glass::class);
}

/**
* @return BelongsTo<Bar, Cocktail>
* @return BelongsTo<Bar, $this>
*/
public function bar(): BelongsTo
{
return $this->belongsTo(Bar::class);
}

/**
* @return HasMany<CocktailIngredient>
* @return HasMany<CocktailIngredient, $this>
*/
public function ingredients(): HasMany
{
return $this->hasMany(CocktailIngredient::class)->orderBy('sort');
}

/**
* @return BelongsToMany<Tag>
* @return BelongsToMany<Tag, $this>
*/
public function tags(): BelongsToMany
{
return $this->belongsToMany(Tag::class);
}

/**
* @return BelongsToMany<Utensil>
* @return BelongsToMany<Utensil, $this>
*/
public function utensils(): BelongsToMany
{
return $this->belongsToMany(Utensil::class);
}

/**
* @return BelongsTo<CocktailMethod, Cocktail>
* @return BelongsTo<CocktailMethod, $this>
*/
public function method(): BelongsTo
{
return $this->belongsTo(CocktailMethod::class, 'cocktail_method_id');
}

/**
* @return BelongsToMany<CocktailCollection>
* @return BelongsToMany<CocktailCollection, $this>
*/
public function collections(): BelongsToMany
{
Expand Down
4 changes: 2 additions & 2 deletions app/Models/CocktailFavorite.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ class CocktailFavorite extends Model
use HasFactory;

/**
* @return BelongsTo<Cocktail, CocktailFavorite>
* @return BelongsTo<Cocktail, $this>
*/
public function cocktail(): BelongsTo
{
return $this->belongsTo(Cocktail::class);
}

/**
* @return BelongsTo<BarMembership, CocktailFavorite>
* @return BelongsTo<BarMembership, $this>
*/
public function barMembership(): BelongsTo
{
Expand Down
6 changes: 3 additions & 3 deletions app/Models/CocktailIngredient.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,23 @@ class CocktailIngredient extends Model
];

/**
* @return BelongsTo<Ingredient, CocktailIngredient>
* @return BelongsTo<Ingredient, $this>
*/
public function ingredient(): BelongsTo
{
return $this->belongsTo(Ingredient::class);
}

/**
* @return BelongsTo<Cocktail, CocktailIngredient>
* @return BelongsTo<Cocktail, $this>
*/
public function cocktail(): BelongsTo
{
return $this->belongsTo(Cocktail::class);
}

/**
* @return HasMany<CocktailIngredientSubstitute>
* @return HasMany<CocktailIngredientSubstitute, $this>
*/
public function substitutes(): HasMany
{
Expand Down
4 changes: 2 additions & 2 deletions app/Models/CocktailIngredientSubstitute.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ class CocktailIngredientSubstitute extends Model
use HasFactory;

/**
* @return BelongsTo<CocktailIngredient, CocktailIngredientSubstitute>
* @return BelongsTo<CocktailIngredient, $this>
*/
public function cocktailIngredient(): BelongsTo
{
return $this->belongsTo(CocktailIngredient::class);
}

/**
* @return BelongsTo<Ingredient, CocktailIngredientSubstitute>
* @return BelongsTo<Ingredient, $this>
*/
public function ingredient(): BelongsTo
{
Expand Down
4 changes: 2 additions & 2 deletions app/Models/CocktailMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ class CocktailMethod extends Model
use HasAuthors;

/**
* @return HasMany<Cocktail>
* @return HasMany<Cocktail, $this>
*/
public function cocktails(): HasMany
{
return $this->hasMany(Cocktail::class);
}

/**
* @return BelongsTo<Bar, CocktailMethod>
* @return BelongsTo<Bar, $this>
*/
public function bar(): BelongsTo
{
Expand Down
4 changes: 2 additions & 2 deletions app/Models/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ class Collection extends Model
];

/**
* @return BelongsToMany<Cocktail>
* @return BelongsToMany<Cocktail, $this>
*/
public function cocktails(): BelongsToMany
{
return $this->belongsToMany(Cocktail::class, 'collections_cocktails')->orderBy('name');
}

/**
* @return BelongsTo<BarMembership, Collection>
* @return BelongsTo<BarMembership, $this>
*/
public function barMembership(): BelongsTo
{
Expand Down
4 changes: 2 additions & 2 deletions app/Models/ComplexIngredient.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ class ComplexIngredient extends Model
public $timestamps = false;

/**
* @return BelongsTo<Ingredient, ComplexIngredient>
* @return BelongsTo<Ingredient, $this>
*/
public function mainIngredient(): BelongsTo
{
return $this->belongsTo(Ingredient::class, 'main_ingredient_id');
}

/**
* @return BelongsTo<Ingredient, ComplexIngredient>
* @return BelongsTo<Ingredient, $this>
*/
public function ingredient(): BelongsTo
{
Expand Down
4 changes: 2 additions & 2 deletions app/Models/Concerns/HasAuthors.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
trait HasAuthors
{
/**
* @return BelongsTo<User, self>
* @return BelongsTo<User, $this>
*/
public function createdUser(): BelongsTo
{
return $this->belongsTo(User::class, 'created_user_id');
}

/**
* @return BelongsTo<User, self>
* @return BelongsTo<User, $this>
*/
public function updatedUser(): BelongsTo
{
Expand Down
2 changes: 1 addition & 1 deletion app/Models/Concerns/HasImages.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
trait HasImages
{
/**
* @return MorphMany<Image>
* @return MorphMany<Image, $this>
*/
public function images(): MorphMany
{
Expand Down
2 changes: 1 addition & 1 deletion app/Models/Concerns/HasNotes.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
trait HasNotes
{
/**
* @return MorphMany<Note>
* @return MorphMany<Note, $this>
*/
public function notes(): MorphMany
{
Expand Down
2 changes: 1 addition & 1 deletion app/Models/Concerns/HasRating.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
trait HasRating
{
/**
* @return MorphMany<Rating>
* @return MorphMany<Rating, $this>
*/
public function ratings(): MorphMany
{
Expand Down
2 changes: 1 addition & 1 deletion app/Models/Export.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class Export extends Model
use HasBarAwareScope;

/**
* @return BelongsTo<Bar, Export>
* @return BelongsTo<Bar, $this>
*/
public function bar(): BelongsTo
{
Expand Down
4 changes: 2 additions & 2 deletions app/Models/Glass.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@ protected function volume(): Attribute
}

/**
* @return HasMany<Cocktail>
* @return HasMany<Cocktail, $this>
*/
public function cocktails(): HasMany
{
return $this->hasMany(Cocktail::class);
}

/**
* @return BelongsTo<Bar, Glass>
* @return BelongsTo<Bar, $this>
*/
public function bar(): BelongsTo
{
Expand Down
3 changes: 2 additions & 1 deletion app/Models/Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,11 @@ public function getFileName(): ?string
}

/**
* @return MorphTo<Ingredient|Cocktail|Model, Image>
* @return MorphTo<Ingredient|Cocktail, $this>
*/
public function imageable(): MorphTo
{
/** @phpstan-ignore-next-line */
return $this->morphTo();
}

Expand Down
Loading

0 comments on commit 5a0e940

Please sign in to comment.