Commit Graph

96 Commits (0435d08568baf6c502c623e8fc8075375d6ae151)

Author SHA1 Message Date
Your Name 0435d08568 RemoveAlwaysElseRector 5 days ago
Your Name a2e38e5ffe CompactToVariablesRector 5 days ago
Your Name 5949dc21c1 UseIdenticalOverEqualWithSameTypeRector 5 days ago
Your Name 042ab0a6e4 Convert optional() to nullsafe operator
Applies patch 2/21 from pixelfed-staging PR #9: replaces optional($x)->y
with $x?->y across 16 files. Pint-clean.
3 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
Shift 19880c2ffb
Convert string references to `::class`
PHP 5.5.9 adds the new static `class` property which provides the fully qualified class name. This is preferred over using strings for class names since the `class` property references are checked by PHP.
4 weeks ago
Shlee 8394b8ac4b
Update ProfileController.php 8 months ago
Daniel Supernault 374344754e
Lint 9 months ago
Your Name 45a9a3b472 RemoveUnreachableStatementRector 11 months ago
Daniel Supernault 207bb36c89
Increase username length limit from 15 to 30 2 years ago
Daniel Supernault 8af77a3f78
Add Profile Carousels 2 years ago
Daniel Supernault c5e7e91777
Add disable_embeds setting, and fix cache invalidation in other settings 2 years ago
Daniel Supernault 921e29659f
Update ProfileController, fix atom feed cache ttl. Fixes #5093 2 years ago
Daniel Supernault 8b8b1ffc5c
Update ProfileController, refactor profile embeds 2 years ago
Daniel Supernault 2d113de536
Update config_cache, fix type casting 3 years ago
Daniel Supernault 75081e609a
Update ProfileController, handle permalink redirect bug 3 years ago
Daniel Supernault bf46f6f5f4
Update config_cache 3 years ago
Daniel Supernault 853a729f76
Update ProfileController, preserve deleted actor objects for federated account deletion and use more efficient account cache lookup 3 years ago
Daniel Supernault 1c105a6ce3
Update ProfileController, allow albums in atom feed. Closes #4561. Fixes #4526 3 years ago
Daniel Supernault 3662d3defe
Update Settings, allow users to disable atom feeds 3 years ago
Daniel Supernault dd2f5bb96a
Update ProfileController, require login to view spam accounts, and disable profile embeds for spam accounts 3 years ago
Daniel Supernault 467c9d754e
Update atom feed, improve cache expiry and fix double encoding bug. Fixes #4121 4 years ago
a e6e16d2cdd Fix: Use correct response type and remove Accept from http signature 4 years ago
a e380868b44 fix typo: http -> https 4 years ago
a 6bf1bea325 Fix: Use correct Content-Type over ActivityPub
This was causing federation issues
4 years ago
Daniel Supernault 8665eab190
Update ProfileController, cache actor object and atom feed 4 years ago
Daniel Supernault 7734dc033b
Add instance post/profile embed config setting 4 years ago
Daniel Supernault c18dcde38f
Set Last-Modified header for atom feeds, fixes #2988 4 years ago
Daniel Supernault f6f2c27874
Update horizon config, add default timeout limit 5 years ago
Daniel Supernault 7f8129a75c
Update ProfileController, redirect profile view for authed users to Metro 2.0 UI 5 years ago
Daniel Supernault 5d9b6863b6
Update atom feeds, include media alt text. Fixes #3184 5 years ago
Daniel Supernault 940209018a
Update ProfileController 5 years ago
Daniel Supernault 3bd211d7f5
Update profile embeds, fix NaN bug and improve performance 5 years ago
Daniel Supernault 1c59933c0a
Update ProfileController 5 years ago
Daniel Supernault 9017f7c4e1
Update Profile, fix unauthenticated private profiles 5 years ago
Daniel Supernault 1c2baa8f2c
Update config() to config_cache() 5 years ago
Daniel Supernault 53134208fe
Update config() to config_cache() 5 years ago
Daniel Supernault 1b2fd665bf
Update compiled assets 6 years ago
Daniel Supernault 6e8e9a2d5e
Update ProfileController, remove actor object caching 6 years ago
Daniel Supernault 7680e771a7
Update ProfileController, reduce actor object ttl from 6 hours to 15 minutes 6 years ago
Daniel Supernault db46f7ddbb
Update ProfileController, revert pgsql change 7 years ago
Daniel Supernault 14ba350ba3
Fix postgres bugs 7 years ago
Daniel Supernault 7654205408
Update ProfileController 7 years ago
Daniel Supernault 2f44cafbf0
Update ProfileController, fixes #1912 7 years ago