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 2, 2025
1 parent a4b882a commit 5d1c7bc
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 65 deletions.
65 changes: 0 additions & 65 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@ parameters:
count: 1
path: src/Classes/MenuManager.php

-
message: "#^Call to an undefined static method Igniter\\\\Main\\\\Models\\\\Theme\\:\\:whereIsEnabled\\(\\)\\.$#"
count: 1
path: src/Classes/MenuManager.php

-
message: "#^Call to an undefined static method Igniter\\\\Pages\\\\Models\\\\Page\\:\\:whereIsEnabled\\(\\)\\.$#"
count: 1
Expand All @@ -35,16 +30,6 @@ parameters:
count: 1
path: src/Extension.php

-
message: "#^Call to an undefined static method Igniter\\\\Flame\\\\Support\\\\Facades\\\\Igniter\\:\\:hasDatabase\\(\\)\\.$#"
count: 1
path: src/Extension.php

-
message: "#^Call to an undefined static method Igniter\\\\Flame\\\\Support\\\\Facades\\\\Igniter\\:\\:uri\\(\\)\\.$#"
count: 1
path: src/Extension.php

-
message: "#^Call to an undefined method Igniter\\\\Admin\\\\Classes\\\\BaseWidget\\:\\:getField\\(\\)\\.$#"
count: 1
Expand All @@ -55,36 +40,11 @@ parameters:
count: 1
path: src/Http/Controllers/Menus.php

-
message: "#^Call to an undefined static method Igniter\\\\Admin\\\\Facades\\\\AdminMenu\\:\\:setContext\\(\\)\\.$#"
count: 1
path: src/Http/Controllers/Menus.php

-
message: "#^Call to an undefined static method Igniter\\\\Admin\\\\Facades\\\\AdminMenu\\:\\:setContext\\(\\)\\.$#"
count: 1
path: src/Http/Controllers/Pages.php

-
message: "#^Access to an undefined property Igniter\\\\Pages\\\\Models\\\\Menu\\:\\:\\$code\\.$#"
count: 1
path: src/Models/Menu.php

-
message: "#^Access to an undefined property Igniter\\\\Pages\\\\Models\\\\Menu\\:\\:\\$name\\.$#"
count: 1
path: src/Models/Menu.php

-
message: "#^Access to an undefined property Igniter\\\\Pages\\\\Models\\\\Menu\\:\\:\\$theme\\.$#"
count: 1
path: src/Models/Menu.php

-
message: "#^Access to an undefined property Igniter\\\\Pages\\\\Models\\\\Menu\\:\\:\\$theme_code\\.$#"
count: 1
path: src/Models/Menu.php

-
message: "#^Access to an undefined property Illuminate\\\\Support\\\\Optional\\:\\:\\$name\\.$#"
count: 1
Expand All @@ -110,36 +70,11 @@ parameters:
count: 1
path: src/Models/Menu.php

-
message: "#^Access to an undefined property Igniter\\\\Pages\\\\Models\\\\MenuItem\\:\\:\\$id\\.$#"
count: 1
path: src/Models/MenuItem.php

-
message: "#^Access to an undefined property Igniter\\\\Pages\\\\Models\\\\MenuItem\\:\\:\\$parent\\.$#"
count: 1
path: src/Models/MenuItem.php

-
message: "#^Access to an undefined property Igniter\\\\Pages\\\\Models\\\\MenuItem\\:\\:\\$type\\.$#"
count: 1
path: src/Models/MenuItem.php

-
message: "#^Call to an undefined static method Igniter\\\\Pages\\\\Models\\\\MenuItem\\:\\:select\\(\\)\\.$#"
count: 1
path: src/Models/MenuItem.php

-
message: "#^Access to an undefined property Igniter\\\\Pages\\\\Models\\\\Page\\:\\:\\$language_id\\.$#"
count: 1
path: src/Models/Observers/PageObserver.php

-
message: "#^Access to an undefined property Igniter\\\\Pages\\\\Models\\\\Page\\:\\:\\$layout\\.$#"
count: 1
path: src/Models/Page.php

-
message: "#^Access to an undefined property Igniter\\\\Pages\\\\Models\\\\Page\\:\\:\\$theme\\.$#"
count: 1
Expand Down
1 change: 1 addition & 0 deletions src/Classes/MenuManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public function getMenusConfig()
$menus = [];
$themes = Theme::whereIsEnabled()->get();
foreach ($themes as $theme) {
/** @var Theme $theme */
if (!$themeObj = $theme->getTheme()) {
continue;
}
Expand Down
9 changes: 9 additions & 0 deletions src/Models/Menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@

/**
* Menu Model
*
* @property int $id
* @property string $theme_code
* @property string $name
* @property string $code
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property-read mixed $theme_name
* @mixin \Igniter\Flame\Database\Model
*/
class Menu extends Model
{
Expand Down
21 changes: 21 additions & 0 deletions src/Models/MenuItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,27 @@

/**
* MenuItem Model
*
* @property int $id
* @property int $menu_id
* @property int|null $parent_id
* @property string $title
* @property string $code
* @property string|null $description
* @property string $type
* @property string|null $url
* @property string|null $reference
* @property array|null $config
* @property int|null $nest_left
* @property int|null $nest_right
* @property int $priority
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property-read \Kalnoy\Nestedset\Collection<int, MenuItem> $children
* @property-read int|null $children_count
* @property-read mixed $summary
* @property-read MenuItem|null $parent
* @mixin \Igniter\Flame\Database\Model
*/
class MenuItem extends Model
{
Expand Down
15 changes: 15 additions & 0 deletions src/Models/Page.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,21 @@

/**
* Pages Model Class
*
* @property int $page_id
* @property int $language_id
* @property string $title
* @property string $content
* @property string|null $meta_description
* @property string|null $meta_keywords
* @property \Illuminate\Support\Carbon $created_at
* @property \Illuminate\Support\Carbon $updated_at
* @property bool $status
* @property string|null $permalink_slug
* @property string|null $layout
* @property array|null $metadata
* @property int|null $priority
* @mixin \Igniter\Flame\Database\Model
*/
class Page extends Model
{
Expand Down

0 comments on commit 5d1c7bc

Please sign in to comment.