Skip to content

Commit

Permalink
chore: add property annotations to models
Browse files Browse the repository at this point in the history
Signed-off-by: Sam Poyigi <[email protected]>
  • Loading branch information
sampoyigi committed Jan 3, 2025
1 parent b213a8b commit dfd837d
Show file tree
Hide file tree
Showing 7 changed files with 92 additions and 216 deletions.
234 changes: 22 additions & 212 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ parameters:
count: 1
path: src/Classes/Location.php

-
message: "#^Access to an undefined property Illuminate\\\\Contracts\\\\Auth\\\\Authenticatable\\:\\:\\$locations\\.$#"
count: 1
path: src/Classes/Location.php

-
message: "#^Call to an undefined method DateTime\\:\\:between\\(\\)\\.$#"
count: 1
Expand Down Expand Up @@ -100,21 +105,6 @@ parameters:
count: 1
path: src/Classes/Location.php

-
message: "#^Call to an undefined static method Igniter\\\\User\\\\Facades\\\\AdminAuth\\:\\:getUser\\(\\)\\.$#"
count: 1
path: src/Classes/Location.php

-
message: "#^Call to an undefined static method Igniter\\\\User\\\\Facades\\\\AdminAuth\\:\\:isSuperUser\\(\\)\\.$#"
count: 1
path: src/Classes/Location.php

-
message: "#^Call to an undefined static method Igniter\\\\User\\\\Facades\\\\AdminAuth\\:\\:user\\(\\)\\.$#"
count: 1
path: src/Classes/Location.php

-
message: "#^Call to an undefined method Illuminate\\\\Database\\\\Eloquent\\\\Model\\:\\:getWeekDaysOptions\\(\\)\\.$#"
count: 1
Expand Down Expand Up @@ -181,7 +171,12 @@ parameters:
path: src/Extension.php

-
message: "#^Call to an undefined static method Igniter\\\\User\\\\Facades\\\\Auth\\:\\:customer\\(\\)\\.$#"
message: "#^Cannot access property \\$last_location_area on null\\.$#"
count: 1
path: src/Extension.php

-
message: "#^Result of static method Igniter\\\\User\\\\Facades\\\\Auth\\:\\:customer\\(\\) \\(void\\) is used\\.$#"
count: 2
path: src/Extension.php

Expand Down Expand Up @@ -236,17 +231,12 @@ parameters:
path: src/Http/Controllers/Reviews.php

-
message: "#^Call to an undefined static method Igniter\\\\User\\\\Facades\\\\AdminAuth\\:\\:check\\(\\)\\.$#"
message: "#^Call to an undefined method Illuminate\\\\Contracts\\\\Auth\\\\Authenticatable\\:\\:hasPermission\\(\\)\\.$#"
count: 1
path: src/Http/Middleware/CheckLocation.php

-
message: "#^Call to an undefined static method Igniter\\\\User\\\\Facades\\\\AdminAuth\\:\\:getUser\\(\\)\\.$#"
count: 1
path: src/Http/Middleware/CheckLocation.php

-
message: "#^Call to an undefined static method Igniter\\\\User\\\\Facades\\\\AdminAuth\\:\\:user\\(\\)\\.$#"
message: "#^Call to an undefined method Illuminate\\\\Contracts\\\\Auth\\\\Authenticatable\\:\\:isAssignedLocation\\(\\)\\.$#"
count: 1
path: src/Http/Middleware/CheckLocation.php

Expand Down Expand Up @@ -296,18 +286,23 @@ parameters:
path: src/MainMenuWidgets/LocationPicker.php

-
message: "#^Call to an undefined static method Igniter\\\\Flame\\\\Geolite\\\\Facades\\\\Geocoder\\:\\:getLogs\\(\\)\\.$#"
message: "#^Call to an undefined method Illuminate\\\\Contracts\\\\Auth\\\\Authenticatable\\:\\:hasPermission\\(\\)\\.$#"
count: 2
path: src/MainMenuWidgets/LocationPicker.php

-
message: "#^Call to an undefined method Illuminate\\\\Contracts\\\\Auth\\\\Authenticatable\\:\\:isAssignedLocation\\(\\)\\.$#"
count: 1
path: src/MainMenuWidgets/LocationPicker.php

-
message: "#^Call to an undefined static method Igniter\\\\Local\\\\Models\\\\Location\\:\\:find\\(\\)\\.$#"
message: "#^Call to an undefined static method Igniter\\\\Flame\\\\Geolite\\\\Facades\\\\Geocoder\\:\\:getLogs\\(\\)\\.$#"
count: 1
path: src/MainMenuWidgets/LocationPicker.php

-
message: "#^Call to an undefined static method Igniter\\\\User\\\\Facades\\\\AdminAuth\\:\\:user\\(\\)\\.$#"
count: 3
message: "#^Call to an undefined static method Igniter\\\\Local\\\\Models\\\\Location\\:\\:find\\(\\)\\.$#"
count: 1
path: src/MainMenuWidgets/LocationPicker.php

-
Expand All @@ -325,81 +320,6 @@ parameters:
count: 4
path: src/Models/Location.php

-
message: "#^Access to an undefined property Igniter\\\\Local\\\\Models\\\\Location\\:\\:\\$description\\.$#"
count: 1
path: src/Models/Location.php

-
message: "#^Access to an undefined property Igniter\\\\Local\\\\Models\\\\Location\\:\\:\\$grouped_settings\\.$#"
count: 1
path: src/Models/Location.php

-
message: "#^Access to an undefined property Igniter\\\\Local\\\\Models\\\\Location\\:\\:\\$is_auto_lat_lng\\.$#"
count: 1
path: src/Models/Location.php

-
message: "#^Access to an undefined property Igniter\\\\Local\\\\Models\\\\Location\\:\\:\\$location_address_1\\.$#"
count: 1
path: src/Models/Location.php

-
message: "#^Access to an undefined property Igniter\\\\Local\\\\Models\\\\Location\\:\\:\\$location_address_2\\.$#"
count: 1
path: src/Models/Location.php

-
message: "#^Access to an undefined property Igniter\\\\Local\\\\Models\\\\Location\\:\\:\\$location_city\\.$#"
count: 1
path: src/Models/Location.php

-
message: "#^Access to an undefined property Igniter\\\\Local\\\\Models\\\\Location\\:\\:\\$location_country_id\\.$#"
count: 1
path: src/Models/Location.php

-
message: "#^Access to an undefined property Igniter\\\\Local\\\\Models\\\\Location\\:\\:\\$location_email\\.$#"
count: 1
path: src/Models/Location.php

-
message: "#^Access to an undefined property Igniter\\\\Local\\\\Models\\\\Location\\:\\:\\$location_lat\\.$#"
count: 4
path: src/Models/Location.php

-
message: "#^Access to an undefined property Igniter\\\\Local\\\\Models\\\\Location\\:\\:\\$location_lng\\.$#"
count: 4
path: src/Models/Location.php

-
message: "#^Access to an undefined property Igniter\\\\Local\\\\Models\\\\Location\\:\\:\\$location_name\\.$#"
count: 2
path: src/Models/Location.php

-
message: "#^Access to an undefined property Igniter\\\\Local\\\\Models\\\\Location\\:\\:\\$location_postcode\\.$#"
count: 1
path: src/Models/Location.php

-
message: "#^Access to an undefined property Igniter\\\\Local\\\\Models\\\\Location\\:\\:\\$location_state\\.$#"
count: 1
path: src/Models/Location.php

-
message: "#^Access to an undefined property Igniter\\\\Local\\\\Models\\\\Location\\:\\:\\$location_telephone\\.$#"
count: 1
path: src/Models/Location.php

-
message: "#^Access to an undefined property Igniter\\\\Local\\\\Models\\\\Location\\:\\:\\$permalink_slug\\.$#"
count: 1
path: src/Models/Location.php

-
message: "#^Access to an undefined property Igniter\\\\Local\\\\Models\\\\Location\\:\\:\\$settings\\.$#"
count: 1
Expand Down Expand Up @@ -460,31 +380,6 @@ parameters:
count: 1
path: src/Models/Location.php

-
message: "#^Access to an undefined property Igniter\\\\Local\\\\Models\\\\LocationArea\\:\\:\\$boundaries\\.$#"
count: 1
path: src/Models/LocationArea.php

-
message: "#^Access to an undefined property Igniter\\\\Local\\\\Models\\\\LocationArea\\:\\:\\$circle\\.$#"
count: 4
path: src/Models/LocationArea.php

-
message: "#^Access to an undefined property Igniter\\\\Local\\\\Models\\\\LocationArea\\:\\:\\$location_id\\.$#"
count: 2
path: src/Models/LocationArea.php

-
message: "#^Access to an undefined property Igniter\\\\Local\\\\Models\\\\LocationArea\\:\\:\\$type\\.$#"
count: 2
path: src/Models/LocationArea.php

-
message: "#^Access to an undefined property Igniter\\\\Local\\\\Models\\\\LocationArea\\:\\:\\$vertices\\.$#"
count: 2
path: src/Models/LocationArea.php

-
message: "#^Access to an undefined property Igniter\\\\Local\\\\Models\\\\LocationSettings\\:\\:\\$data\\.$#"
count: 2
Expand All @@ -510,56 +405,6 @@ parameters:
count: 1
path: src/Models/Review.php

-
message: "#^Access to an undefined property Igniter\\\\Local\\\\Models\\\\Review\\:\\:\\$author\\.$#"
count: 1
path: src/Models/Review.php

-
message: "#^Access to an undefined property Igniter\\\\Local\\\\Models\\\\Review\\:\\:\\$customer_id\\.$#"
count: 1
path: src/Models/Review.php

-
message: "#^Access to an undefined property Igniter\\\\Local\\\\Models\\\\Review\\:\\:\\$delivery\\.$#"
count: 1
path: src/Models/Review.php

-
message: "#^Access to an undefined property Igniter\\\\Local\\\\Models\\\\Review\\:\\:\\$location_id\\.$#"
count: 1
path: src/Models/Review.php

-
message: "#^Access to an undefined property Igniter\\\\Local\\\\Models\\\\Review\\:\\:\\$quality\\.$#"
count: 1
path: src/Models/Review.php

-
message: "#^Access to an undefined property Igniter\\\\Local\\\\Models\\\\Review\\:\\:\\$review_status\\.$#"
count: 1
path: src/Models/Review.php

-
message: "#^Access to an undefined property Igniter\\\\Local\\\\Models\\\\Review\\:\\:\\$review_text\\.$#"
count: 1
path: src/Models/Review.php

-
message: "#^Access to an undefined property Igniter\\\\Local\\\\Models\\\\Review\\:\\:\\$reviewable_id\\.$#"
count: 1
path: src/Models/Review.php

-
message: "#^Access to an undefined property Igniter\\\\Local\\\\Models\\\\Review\\:\\:\\$reviewable_type\\.$#"
count: 1
path: src/Models/Review.php

-
message: "#^Access to an undefined property Igniter\\\\Local\\\\Models\\\\Review\\:\\:\\$service\\.$#"
count: 1
path: src/Models/Review.php

-
message: "#^Call to an undefined method Igniter\\\\Flame\\\\Database\\\\Model\\:\\:isCompleted\\(\\)\\.$#"
count: 1
Expand All @@ -575,11 +420,6 @@ parameters:
count: 1
path: src/Models/Review.php

-
message: "#^Call to an undefined static method Igniter\\\\User\\\\Facades\\\\AdminAuth\\:\\:isSuperUser\\(\\)\\.$#"
count: 1
path: src/Models/Review.php

-
message: "#^Unsafe usage of new static\\(\\)\\.$#"
count: 2
Expand Down Expand Up @@ -620,36 +460,6 @@ parameters:
count: 2
path: src/Models/Scopes/LocationableScope.php

-
message: "#^Access to an undefined property Igniter\\\\Local\\\\Models\\\\WorkingHour\\:\\:\\$close\\.$#"
count: 2
path: src/Models/WorkingHour.php

-
message: "#^Access to an undefined property Igniter\\\\Local\\\\Models\\\\WorkingHour\\:\\:\\$closing_time\\.$#"
count: 2
path: src/Models/WorkingHour.php

-
message: "#^Access to an undefined property Igniter\\\\Local\\\\Models\\\\WorkingHour\\:\\:\\$day\\.$#"
count: 2
path: src/Models/WorkingHour.php

-
message: "#^Access to an undefined property Igniter\\\\Local\\\\Models\\\\WorkingHour\\:\\:\\$open\\.$#"
count: 2
path: src/Models/WorkingHour.php

-
message: "#^Access to an undefined property Igniter\\\\Local\\\\Models\\\\WorkingHour\\:\\:\\$opening_time\\.$#"
count: 2
path: src/Models/WorkingHour.php

-
message: "#^Access to an undefined property Igniter\\\\Local\\\\Models\\\\WorkingHour\\:\\:\\$weekday\\.$#"
count: 1
path: src/Models/WorkingHour.php

-
message: "#^Method Carbon\\\\Carbon\\:\\:addDay\\(\\) invoked with 1 parameter, 0 required\\.$#"
count: 1
Expand Down
2 changes: 1 addition & 1 deletion src/Facades/Location.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* @method static string|null resolveLocationSlug()
* @method static void locationSlugResolver(\Closure $resolver)
* @method static bool check()
* @method static \Igniter\Local\Contracts\LocationInterface|null current()
* @method static \Igniter\Local\Models\Location|\Igniter\Local\Contracts\LocationInterface|null current()
* @method static \Igniter\Local\Contracts\LocationInterface|null currentOrDefault()
* @method static array currentOrAssigned()
* @method static void setCurrent(\Igniter\Local\Contracts\LocationInterface $locationModel)
Expand Down
26 changes: 26 additions & 0 deletions src/Models/Location.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,32 @@

/**
* Location Model Class
*
* @property int $location_id
* @property string $location_name
* @property string $location_email
* @property string|null $description
* @property string|null $location_address_1
* @property string|null $location_address_2
* @property string|null $location_city
* @property string|null $location_state
* @property string|null $location_postcode
* @property int|null $location_country_id
* @property string|null $location_telephone
* @property float|null $location_lat
* @property float|null $location_lng
* @property int|null $location_radius
* @property bool|null $location_status
* @property string|null $permalink_slug
* @property bool $is_default
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property int $is_auto_lat_lng
* @property-read mixed|null $grouped_settings
* @property-read mixed $location_thumb
* @property-read \Illuminate\Database\Eloquent\Collection<int, \Igniter\Flame\Database\Attach\Media> $media
* @property-read int|null $media_count
* @mixin \Igniter\Flame\Database\Model
*/
class Location extends Model implements LocationInterface
{
Expand Down
13 changes: 13 additions & 0 deletions src/Models/LocationArea.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,19 @@

/**
* LocationArea Model Class
*
* @property int $area_id
* @property int $location_id
* @property string $name
* @property string $type
* @property array $boundaries
* @property array $conditions
* @property string|null $color
* @property bool $is_default
* @property int $priority
* @property-read mixed $circle
* @property-read mixed $vertices
* @mixin \Igniter\Flame\Database\Model
*/
class LocationArea extends Model implements AreaInterface
{
Expand Down
2 changes: 1 addition & 1 deletion src/Models/LocationSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,4 +154,4 @@ public static function registerCallback(callable $callback)
{
self::$callbacks[] = $callback;
}
}
}
Loading

0 comments on commit dfd837d

Please sign in to comment.