Skip to content

Conversation

ghost
Copy link

@ghost ghost commented Sep 20, 2025

Summary

  • Fixes 2 PHPStan type errors in anonymous classes
  • Replaces deprecated LazyProp with OptionalProp (5 instances + import)
  • Updates testing patterns to use Laravel testbench conventions
  • Fixes parameter documentation in helpers.php

Changes Made

PHPStan Type Fixes

  • Fixed return type annotations from `Collection<string, string>` to `array<string, mixed>`
  • Updated implementations to return arrays instead of Collections

Deprecated API Replacement

  • Replaced LazyProp with OptionalProp following deprecation guidance
  • Updated import statement accordingly

Testing Pattern Consistency

  • Migrated from `Mockery::mock()` to Laravel testbench `$this->mock()`
  • Added proper closure variable binding with `use` clause

Documentation Fix

  • Fixed missing `$` in parameter documentation for `inertia_location()`

Verification

  • PHPStan: [OK] No errors (was 2 errors)
  • Tests: 160 tests, 664 assertions - all passing
  • Code Style: Laravel Pint compliance maintained
  • No breaking changes: All modifications are internal

Impact

Eliminates static analysis errors and removes deprecated API usage while maintaining full backward
compatibility."

  - Fix PHPStan type errors in anonymous classes implementing ProvidesInertiaProperties
  - Replace deprecated LazyProp with OptionalProp (5 instances)
  - Update Mockery usage to follow Laravel testbench conventions
  - Fix missing parameter documentation in helpers.php

  Resolves 2 PHPStan errors and removes deprecated API usage while maintaining 100% backward compatibility.
@pascalbaljet
Copy link
Member

Thanks for this. The PHPStan issues were already fixed in #774, and I prefer to keep testing LazyProp (as it's still used a lot), so I'll close this PR.

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.

1 participant