Commit Graph

53 Commits (57e7eef08296acf97d9c7a7b25d8a6d268ab52c3)

Author SHA1 Message Date
Your Name 8b4a7d4e3c fix: correct SiteController view return types, drop ViewContract alias
An automated return-type pass aliased the view contract as ViewContract
to avoid clashing with the imported View facade, but left four methods
(curatedOnboarding, language, redirectUrl, followIntent) typed against
the facade instead of the contract. That threw a TypeError on
/auth/sign_up.

Convert the four View::make() calls to the view() helper, drop the
facade import, and use a single Illuminate\Contracts\View\View import
for all return types.
2 weeks ago
Shlee 3673cf30e4
Update SiteController.php 2 weeks ago
Shlee 99a013accc
Update SiteController.php 2 weeks ago
Your Name f0e951dcce fix: stop caching raw Eloquent models to prevent incomplete-object 500s
Caching an Eloquent model in a Cache::remember closure could deserialize
into a __PHP_Incomplete_Class on read, throwing 'attempt to access a
property on an incomplete object' and returning a 500. This surfaced on
guest profile pages (ProfileController::buildProfile reading
$user->user->settings) and affected several other latent call sites.

Changes:
- ProfileController: cache a plain settings array instead of the
  UserSetting model; fall back to defaults when the settings row is missing
- StoryService::getById: fetch a live model instead of caching it
- InstanceService::getByDomain, CustomEmoji::scan: cache arrays
- Site/MobileController: cache Page data as an array via a shared
  ManagesCachedPages trait; update blade views to array access
- Add public-route smoke/regression tests covering the cache-read path
4 weeks ago
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 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
Daniel Supernault 207bb36c89
Increase username length limit from 15 to 30 2 years ago
Daniel Supernault 6e0d1ef41b
Update cache 2 years ago
Daniel Supernault 95199843e3
Update SiteController, add curatedOnboarding method that gracefully falls back to open registration when applicable 3 years ago
Daniel Supernault 0b7d0a9627
Add customizable Legal Notice page 4 years ago
Daniel Supernault 75fbd373c8
Remove quilljs from admin page editor, fixes #3616 4 years ago
Daniel Supernault 5ff4730ff1
Update home timeline, redirect to /i/web unless force_old_ui is present 4 years ago
Daniel Supernault 93c7af7464
Update routes, add legacy webfinger profile redirect 5 years ago
Daniel Supernault 92dc7af69b
Update landing and about page 5 years ago
Daniel Supernault 7d376c64ec
Update SiteController, only allow redirects for logged in users 6 years ago
Daniel Supernault 10b178c8ee
Update SiteController, use url validator in redirect endpoint 6 years ago
Daniel Supernault b74e14c4e5
Update SiteController 6 years ago
Daniel Supernault cfaa248c72
Update SiteController, add legacy profile/webfinger redirect 6 years ago
Daniel Supernault 84e203a925
Add new landing page 7 years ago
Daniel Supernault b793f9c4bb
Update SiteController 7 years ago
Daniel Supernault 8e9b544f50
Update SiteController, return 404 for users attempting to view their own Follow Intent 7 years ago
Daniel Supernault d9ff794932
Update SiteController 7 years ago
Daniel Supernault d2c53dc56a
Update SiteController 7 years ago
Daniel Supernault fe522da8db
Update SiteController 7 years ago
Daniel Supernault 18bc9c3024
Store user preferred language in database 7 years ago
Daniel Supernault aa7c6632c2
Update SiteController 7 years ago
Daniel Supernault ab0e5a36de
Update SiteController, increase cache ttl 7 years ago
Daniel Supernault 4539afabdb
Update SiteController 7 years ago
Daniel Supernault aca5114fcb
Update SiteController 7 years ago
Daniel Supernault 13ceef0f9e
Update SiteController 7 years ago
Daniel Supernault 9cf719f74f
Update about page 8 years ago
Daniel Supernault 5f73a4a37b
Update SiteController 8 years ago
Daniel Supernault ca1814091a
Update SiteController 8 years ago
Daniel Supernault 4739c25fe0
Update Cache, prepare for laravel 5.8 8 years ago
Daniel Supernault 326a1b353a
Update SiteController 8 years ago
Daniel Supernault 582c4913d5
Update timeline controllers and routes 8 years ago
Daniel Supernault 794cf80c15
Update about page with stats and instance admin 8 years ago
Daniel Supernault c41e6a761d
Update SiteController 8 years ago
Daniel Supernault 226d810159
Update SiteController 8 years ago
Daniel Supernault 197829224e
Update timeline logic to sort by date instead of id 8 years ago
Daniel Supernault 84ba7f4a9c
Update timeline logic to filter non public posts 8 years ago
Daniel Supernault 2810b952dd
Update SiteController, add mutes and blocks to personal timeline 8 years ago
daniel b8abbdd90f Apply fixes from StyleCI 8 years ago
Daniel Supernault 34bdb35f57
Update landing page 8 years ago
Daniel Supernault 6288bd0abf
Update SiteController 8 years ago
Daniel Supernault 451a65cc5b
Update SiteController 8 years ago