Commit Graph

71 Commits (e4e12fad7cffee99ef017c30d03037fafb9bfae3)

Author SHA1 Message Date
Your Name e4e12fad7c Extract duplicated blocked-id and duplicate-shortcode query patterns
Two query patterns were copy-pasted across several call sites:

- The 'users who blocked me, plus myself' list used to filter profile
  search (UserFilter::whereFilterableId($pid)->pluck('user_id')->push($pid))
  appeared in ComposeController (x2) and DirectMessageController. Extracted
  to UserFilterService::searchExcludedProfileIds(). Note this is the
  inverse of blocks() (who I blocked), so it is a distinct method.

- CustomEmoji duplicate detection (groupBy('shortcode')->havingRaw(
  'count(*) > 1')) appeared three times in AdminController. Extracted to a
  CustomEmoji::duplicateShortcodes() query scope.

Adds tests for both. No behaviour change.
3 weeks ago
Your Name b52c3d7659 perf: fix N+1 queries; fix ComposeController lint and test namespace
Performance:
- TrendingHashtagService: batch-load hashtags with whereIn/keyBy instead
  of Hashtag::find() per trending row.
- DirectMessageController: eager-load status.media and read the in-memory
  collection instead of firstMedia() issuing a query per DM message.
- GroupsSearchController: batch Profile/Follower/GroupInvitation lookups
  with whereIn instead of per-invitee queries.

Lint/tests:
- ComposeController: whitespace formatting (Pint).
- ComposeControllerTest: correct App\User to App\Models\User, fixing the
  larastan class.notFound error and import ordering.

Full suite: 547 passed. Pint and PHPStan clean.
4 weeks ago
Shlee d9817840c1
Merge pull request #6955 from hohoho1886/location-country-search
Add country filtering to location search
4 weeks ago
Nguyen Ninh Dao 129778ef2e implement search by country 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
Your Name 1a1dc5e096 fix typo 8 months ago
Shlee 133e497879
Larastan: Update ComposeController.php 11 months ago
Daniel Supernault e56bcf3853
Update ComposeController, fix postgres operator 1 year ago
Daniel Supernault 2a9c28b81e
Update ComposeController, fix user tagging endpoint 1 year ago
Daniel Supernault 10eb1a8acb
Update ComposeController, prioritize followed users and follower_count first 1 year ago
Daniel Supernault 56f909a61b
Update ComposeController, add addl compose settings data 1 year ago
Daniel Supernault 1cb01545bc
Update ComposeController, add addl compose settings data 1 year ago
Daniel Supernault 9048ab52c2
Update ComposeController, add addl compose settings data 1 year ago
Daniel Supernault ece23d751b
Update Places, improve cache invalidation/ttl 1 year ago
Daniel Supernault ae47ba73d6
Update ComposeController, fix cache invalidation order 1 year ago
Daniel Supernault 4e938a8ffa
Fix heic, avif, webp support and add libvips driver 1 year ago
Mackenzie Morgan 9966260a91 use case insensitive search when tagging accounts 1 year ago
Daniel Supernault 5f5ed1e62d
Update ComposeController, fix tag mention bug. Closes #5885 1 year ago
Daniel Supernault c36cc07b2c
Update avif support, and fix reply permalinks 2 years ago
Daniel Supernault 17918cbef4
Update ComposeController, add max_media_attachments attribute 2 years ago
Daniel Supernault 85124aa642
Fix rendered caption 2 years ago
Daniel Supernault 1d2f76c8e5
Postgres fixes 2 years ago
Daniel Supernault 9eeb7b6741
Update Status caption logic, stop storing duplicate html caption in db and defer to cached StatusService rendering 2 years ago
Daniel Supernault 424f0271c3
Update ApiV1Controller, fix null caption on media bug 2 years ago
Daniel Supernault a2524910dd
Add migration 2 years ago
Daniel Supernault 665581d80c
Update cloud storage, use config_cache 3 years ago
Daniel Supernault 5e4d4eff9d
Update config cache 3 years ago
Daniel Supernault 62b9eef805
Fix api endpoints 3 years ago
Daniel Supernault 2dcfc81495
Update ComposeController, add parental controls support 3 years ago
Daniel Supernault 75b0f2dda0
Update ComposeController, add permissions check 3 years ago
David Gabriel 2e5c141724 Fix similar SQL error which triggers when mentioning people in new posts 3 years ago
Daniel Supernault 1cc6274ac0
Update rate limits, fixes #4537 3 years ago
Daniel Supernault a91a5e4872
Update StatusEntityLexer, stop saving entities 3 years ago
Daniel Supernault d563901622
Update ApiV1Controller 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 64a4a0060a
Update ComposeController, fix postgres location search. Closes #4242 and #4239 4 years ago
Daniel Supernault 5a67e9f93b
Update image pipeline, dispatch jobs to mmo queue and add "replace_id" param to v2/media endpoint to dispatch delayed MediaDeletePipeline job for original media id to improve media gc on supported clients 4 years ago
Daniel Supernault 9f8957b939
Update ComposeController, fix add to collection logic 4 years ago
Daniel Supernault 80e6a5a98f
Update ComposeController, fix validation issue 4 years ago
Daniel Supernault 101676758e
Update api routes 4 years ago
Daniel Supernault bb1cccbe03
Update MediaDeletePipeline, fix async media deletion 4 years ago
Daniel Supernault d48642132b
Add custom content warnings/spoiler text 4 years ago
Daniel Supernault ec2cfaf54e
Update ComposeController, add collection support to compose endpoint 5 years ago
Daniel Supernault 29c4bd251a
Update ComposeController, improve location search results ordering by use frequency 5 years ago