Skip to content

fix: phpstan usage, rector and modules - #90

Merged
gvieira18 merged 7 commits into
3.xfrom
fix/phpstan-filament-modules
Nov 6, 2025
Merged

gvieira18 merged 7 commits into
3.xfrom
fix/phpstan-filament-modules

Conversation

@gvieira18

Copy link
Copy Markdown
Member

This pull request introduces several improvements focused on code quality, static analysis configuration, and type safety across multiple modules. The most significant changes include adding PHPStan configuration and error ignore files to several modules, refactoring the Event model to EventModel in the events module, and enhancing Eloquent model factories and relationships with proper type annotations. Additionally, new Makefile and Taskfile command aliases have been added for developer convenience.

Static Analysis Configuration:

  • Added phpstan.neon and phpstan.ignore.neon files to the authentication, badge, character, and events modules, enabling PHPStan static analysis and specifying ignored errors for known issues.
  • Updated PHPStan configuration to include the src/ path and reference the ignore files in each module.

Model Refactoring and Type Safety (Events Module):

  • Renamed the Event model to EventModel throughout the events module, updating all relevant imports and relationships for consistency and clarity.
  • Enhanced Eloquent relationships in EventModel and Talk models with precise return type annotations, improving IDE support and static analysis.

Type Annotations in Factories (Badge, Character, Events Modules):

  • Added generic type annotations to factory classes such as BadgeFactory, PastSeasonFactory, EventFactory, and TalkFactory to clarify the model each factory targets.

Model Relationship Type Annotations (Character Module):

  • Added generic return type annotations to Eloquent relationships in Character and Wallet models for improved type safety and static analysis.

Developer Experience Improvements:

  • Added convenient command aliases (p, f, t) for PHPStan, format, and test commands in the Makefile and Taskfile.yml to streamline common development workflows.
  • Updated the route-list Makefile command to use colored output with the --ansi flag for better readability.

- add phpstan.ignore.neon for error handling
- include phpstan.modules.php for dynamic module loading
- update paths in phpstan.neon to include database and routes
- update dependency phpstan/extension-installer to ^1.4.3
- update filament/filament to ^4.2.0
- update filament/spatie-laravel-media-library-plugin to ^4.2.0
- update he4rt/badge to >=1
- update he4rt/message to >=1
- update he4rt/season to >=1
- update spatie/laravel-medialibrary to ^11.17.3
@gvieira18 gvieira18 self-assigned this Nov 6, 2025
@gvieira18
gvieira18 merged commit 346e68c into 3.x Nov 6, 2025
5 checks passed
@gvieira18
gvieira18 deleted the fix/phpstan-filament-modules branch November 6, 2025 00:09
RichardGL11 pushed a commit that referenced this pull request Nov 6, 2025
This pull request introduces several improvements focused on code
quality, static analysis configuration, and type safety across multiple
modules. The most significant changes include adding PHPStan
configuration and error ignore files to several modules, refactoring the
`Event` model to `EventModel` in the events module, and enhancing
Eloquent model factories and relationships with proper type annotations.
Additionally, new Makefile and Taskfile command aliases have been added
for developer convenience.

**Static Analysis Configuration:**

* Added `phpstan.neon` and `phpstan.ignore.neon` files to the
`authentication`, `badge`, `character`, and `events` modules, enabling
PHPStan static analysis and specifying ignored errors for known issues.
* Updated PHPStan configuration to include the `src/` path and reference
the ignore files in each module.

**Model Refactoring and Type Safety (Events Module):**

* Renamed the `Event` model to `EventModel` throughout the events
module, updating all relevant imports and relationships for consistency
and clarity.
* Enhanced Eloquent relationships in `EventModel` and `Talk` models with
precise return type annotations, improving IDE support and static
analysis.

**Type Annotations in Factories (Badge, Character, Events Modules):**

* Added generic type annotations to factory classes such as
`BadgeFactory`, `PastSeasonFactory`, `EventFactory`, and `TalkFactory`
to clarify the model each factory targets.

**Model Relationship Type Annotations (Character Module):**

* Added generic return type annotations to Eloquent relationships in
`Character` and `Wallet` models for improved type safety and static
analysis.

**Developer Experience Improvements:**

* Added convenient command aliases (`p`, `f`, `t`) for PHPStan, format,
and test commands in the `Makefile` and `Taskfile.yml` to streamline
common development workflows.
* Updated the `route-list` Makefile command to use colored output with
the `--ansi` flag for better readability.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants