phpvms/tests
Nabeel S. 849ab9ac7f
chore: remove prettus/l5-repository (Phase 8 cleanup) (#2202)
* chore: remove prettus/l5-repository (Phase 8 cleanup)

Phase 8 of the Prettus repository removal. Phases 1-7 deleted all 25 concrete
repositories and rewired callers; this drops the package itself plus the
remaining scaffolding.

- Migrate Sluggable observer registration from ObserverServiceProviders boot
  to #[ObservedBy(Sluggable::class)] attributes on FlightField, FlightFieldValue,
  Page, PirepField, PirepFieldValue.
- Delete app/Providers/ObserverServiceProviders.php, app/Contracts/Repository.php,
  app/Repositories/ (incl. Criteria/WhereCriteria.php), config/repository.php.
- Drop RepositoryServiceProvider and ObserverServiceProviders from config/app.php.
- Sweep dead 'use Prettus\Validator\Exceptions\ValidatorException' imports from
  10 files plus the 12 orphaned '@throws ValidatorException' docblock lines that
  PHPStan would otherwise flag as throws.notThrowable.
- Move pagination default from deleted config/repository.php to config/phpvms.php
  ('pagination.limit' => 20, matches historical value). Update 8 prod callers +
  2 test sites to read 'phpvms.pagination.limit'.
- Drop App\Contracts\Repository exception from tests/Arch/GlobalTest.php
  http-helpers rule.
- composer remove prettus/l5-repository (drops prettus/laravel-validation
  transitively).

No public API, JSON shape, or behavior change. Pint, PHPStan level 5, Pest, and
Rector --dry-run all pass; the 7 pre-existing CSRF/ProfileUpdated test failures
on main remain unchanged.

* fix(pagination): default 50, max cap 100, central paginate_limit() helper

Address PR #2202 review feedback (CodeRabbit + Copilot):

- config/phpvms.php: pagination.limit = 50 (default page size),
  pagination.max = 100 (hard cap on ?limit= query input).
- Add paginate_limit() helper in app/helpers.php that resolves the raw
  ?limit= value, falls back to pagination.limit, and clamps to
  [1, pagination.max]. Single source of truth for per-page sanitization.
- Replace ad-hoc `$request->query('limit') ?: config(...)` patterns in
  8 controllers with paginate_limit():
  - Api: AirportController, FleetController, FlightController,
    NewsController, UserController (fleet + pireps)
  - Frontend: FlightController, PirepController, UserController
  Frontend/UserController previously used 20 as fallback default; now
  consistent with the rest of the app at 50.
- SearchAirportsRequest validator now bounds ?limit= against
  pagination.max (100) instead of pagination.limit (50), so callers can
  request the full clamp range. Add boundary test asserting limit=100
  passes and limit=101 fails.

Net effect: API endpoints can no longer be coerced into oversized result
sets via ?limit=. Default page size moves from 20 to 50 to match the
review consensus.
2026-05-02 14:39:06 -05:00
..
Arch chore: remove prettus/l5-repository (Phase 8 cleanup) (#2202) 2026-05-02 14:39:06 -05:00
data add oxlint and oxfmt 2026-03-18 23:17:18 +01:00
Feature Refactor/phase-7-journal (#2200) 2026-04-29 14:13:45 -05:00
Helpers Phase 5 of prettus repository removal. (#2195) 2026-04-27 15:21:27 -05:00
Unit chore: remove prettus/l5-repository (Phase 8 cleanup) (#2202) 2026-05-02 14:39:06 -05:00
ArchTest.php [8.x] feat: improve tests suite (#2166) 2026-03-18 16:35:19 -05:00
Pest.php revert(testing): restore Laravel-standard bootstrap 2026-04-26 11:54:25 -05:00
TestCase.php revert(testing): restore Laravel-standard bootstrap 2026-04-26 11:54:25 -05:00