Commit Graph

72 Commits (f018004b56d8965b46d5febb0380636ad5530ef2)

Author SHA1 Message Date
Your Name c0cde2f682 refactor: move 52 legacy models from App\ to App\Models\
Move all Eloquent models from the app/ root directory to app/Models/
for consistency with modern Laravel conventions. The project already had
54 models in App\Models; this migrates the remaining 52 legacy models.

Changes:
- Move 52 model files from app/ to app/Models/
- Update namespace declarations in each model
- Update all ~1000 import references across the codebase
- Add Relation::morphMap() in AppServiceProvider for backward
  compatibility with existing polymorphic database records
- Add missing HasSnowflakePrimary imports for models that relied
  on same-namespace resolution
4 weeks ago
Your Name 54cfdf3c2b refactor: add return type declarations to controller methods
Adds explicit return type declarations to 498 controller methods
across 88 files. Types inferred from return statements:

- JsonResponse for response()->json() returns
- RedirectResponse for redirect()/back() returns
- View (contract) for view() returns
- Response for response() returns
- void for methods with no return value
- array for array returns
- string/int/bool for scalar returns

Also fixes 3 methods with incorrect bare returns:
- AvatarController::deleteAvatar - bare return → json response
- ImportPostController::checkPermissions - bare return → true
- RemoteAuthController::accountToId - bare return → empty array
4 weeks ago
Your Name ffcef3eb2d fix: replace Auth facade with $request->user() in request-scoped classes
Replace Auth::user() with $request->user() and Auth::check() with
$request->user() !== null (or ! $request->user()) across all
controllers and middleware that have access to the request object.

This resolves 99 larastan.noAuthFacadeInRequestScope errors and
improves Octane compatibility.

For protected helper methods without $request in scope, uses the
request() helper instead.

Methods that previously lacked a Request parameter but used Auth
facade now accept Request $request via Laravel's auto-injection.
4 weeks ago
Your Name 1617734907 Revert "Merge pull request #6851 from pixelfed/fix/phpstan-auth-request-scope-2"
This reverts commit ce4baf6995, reversing
changes made to 9235cb979a.
4 weeks ago
Your Name 0939f495bb fix: replace Auth facade with $request->user() in request-scoped classes
Replace Auth::user() with $request->user() and Auth::check() with
$request->user() !== null (or ! $request->user()) across all
controllers and middleware that have access to the request object.

This resolves 99 larastan.noAuthFacadeInRequestScope errors and
improves Octane compatibility.

For protected helper methods without $request in scope, uses the
request() helper instead.

Methods that previously lacked a Request parameter but used Auth
facade now accept Request $request via Laravel's auto-injection.
4 weeks ago
Your Name 7c964f3b4f fix: replace backslash-prefixed facade calls with imported references
Replace \Cache::, \Log::, \DB:: calls with their imported facade
equivalents. The backslash-prefix relies on global aliases which
PHPStan cannot resolve, causing class.notFound errors.
4 weeks ago
Your Name c807a8524c refactor: replace short facade aliases with fully-qualified imports
Convert all 273 short facade alias imports (e.g. 'use Cache;') to their
fully-qualified class names (e.g. 'use Illuminate\Support\Facades\Cache;')
across 193 files.

This resolves 643 PHPStan 'class.notFound' errors caused by the static
analyzer being unable to resolve global aliases, and aligns with modern
Laravel conventions. It also unblocks removing the aliases array from
config/app.php in a future change.

All 107 tests pass.
4 weeks ago
Shlee 1b21f83132
Update BaseApiController.php 7 months ago
Shlee 8d197107e8
Update BaseApiController.php 11 months ago
Daniel Supernault 0f1819125c
Update post pinning, and dispatch Notification cache warming to a job, and fix reblogged state on some endpoints 1 year ago
Daniel Supernault e354750808
Fix api endpoints 3 years ago
Emelia Smith 0f8e45fe75
Implement proper OAuth authorization on API endpoints 3 years ago
Daniel Supernault 22da2647c7
Update filesystems, store all files as public by default and add default permissions. Fixes #4273, #4275. Closes #3825 4 years ago
Daniel Supernault da38b33a24
Remove deprecated routes/methods 4 years ago
Daniel Supernault 04e8c96a7e
Update status deletion, fix database lock issues and side effects 4 years ago
Daniel Supernault 7fa9d4dc1b
Update AvatarController, fix store bug 5 years ago
Daniel Supernault bae6126db3
Update compiled assets 5 years ago
Daniel Supernault 3d86d21be6
Update BaseApiController, improve favourites endpoint 5 years ago
Daniel Supernault f063cb0185
Update BaseApiController, improve favourites endpoint 5 years ago
Daniel Supernault 83b48b5681
Update StatusService, improve cache invalidation 5 years ago
Daniel Supernault 7df3540b08
Update verify_credentials api endpoint to improve performance 5 years ago
Daniel Supernault 3f8acb1266
Update AccountService, add syncPostCount method 5 years ago
Daniel Supernault e9ef0c887a
Add Archive Posts 5 years ago
Daniel Supernault f9516ac316
Update ApiControllers, use NotificationService 5 years ago
Daniel Supernault 889c3d8758
Update AvatarController, remove deprecated thumb_path 6 years ago
Daniel Supernault 4415af1bf0
Update api controllers, deprecate old endpoints 6 years ago
Daniel Supernault cc3053ed5d
Update api controllers 6 years ago
Daniel Supernault b9b84e6fa4
Update Follower model, increase hourly limit from 30 to 150 6 years ago
Daniel Supernault 0fbde91e87
Update StatusService, cast response to array 6 years ago
Daniel Supernault 76353ca997
Update BaseApiController, add favourites method 6 years ago
Daniel Supernault 597378bfb4
Update upload endpoints with MediaBlocklist checks 6 years ago
Daniel Supernault 588642123e
Update Api controllers, use MediaPathService 6 years ago
Daniel Supernault 826978ce08
Update BaseApiController, invalidate session after account deletion 7 years ago
Daniel Supernault 28bc9c1923
Update status edit view 7 years ago
Daniel Supernault 67a90ee18d
Fixes #1852 7 years ago
Daniel Supernault 3fa9ac8bd9
Update BaseApiController, uncache verify_credentials method 7 years ago
Daniel Supernault bad2ecde56
Update BaseApiController, add drafts method for Camera Roll 7 years ago
Daniel Supernault 73c0898703
Update BaseApiController, add timestamp to signed media previews for client side cache invalidation 7 years ago
Daniel Supernault f4039ce218
Update BaseApiController 7 years ago
Daniel Supernault 043b3b51dd
Update BaseApiController, add source to verify_credentials endpoint 7 years ago
Daniel Supernault 6fbbe3202e
Update BaseApiController 7 years ago
Daniel Supernault a24b4a40e0
Update BaseApiController 7 years ago
Daniel Supernault 9886ec5954
Update BaseApiController 7 years ago
Daniel Supernault aff20f62cd
Update BaseApiController 7 years ago
Daniel Supernault 2a42a1c02e
Update BaseApiController 7 years ago
Daniel Supernault 295ee0d8f7
Update BaseApiController 7 years ago
Daniel Supernault 5ef7936b48
Update BaseApiController 7 years ago
Daniel Supernault 7869ee9a92
Update BaseApiController 7 years ago
Daniel Supernault 76f6514293
Update BaseApiController 7 years ago
Daniel Supernault 60ead2bab3
Update BaseApiController 8 years ago