Skip to content

Conversation

@rmartinoscar
Copy link
Member

No description provided.

@coderabbitai
Copy link

coderabbitai bot commented Oct 11, 2025

📝 Walkthrough

Walkthrough

Updated OAuth action iteration in UserResource to use $user->oauth ?? [] instead of $user->oauth, preventing errors when oauth is null by defaulting to an empty array and skipping the loop.

Changes

Cohort / File(s) Summary
Null-safe OAuth iteration
app/Filament/Admin/Resources/Users/UserResource.php
Loop over OAuth actions now uses $user->oauth ?? [] to avoid iterating a null value; no other logic changed.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor Admin as Admin User
  participant UI as Filament UI
  participant UR as UserResource
  participant UM as User Model

  Admin->>UI: Open User view
  UI->>UR: Build actions
  UR->>UM: Access oauth
  alt oauth is non-null
    UR->>UR: for each provider in oauth
    UR-->>UI: Add OAuth action(s)
  else oauth is null
    Note over UR,UI: Use [] (empty) and skip loop
  end
  UI-->>Admin: Render actions
Loading

Pre-merge checks

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The pull request has no description, so there is no information related to the changeset, making the description completely unrelated to the content of the PR. Please add a brief description of the changes made, such as summarizing the update to default to an empty array when oauth is null to prevent a 500 error.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (1 passed)
Check name Status Explanation
Title Check ✅ Passed The pull request title succinctly and accurately summarizes the main change by stating that it fixes a 500 error when oauth is null, directly reflecting the code update without extraneous detail.

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4652680 and 3011b5f.

📒 Files selected for processing (1)
  • app/Filament/Admin/Resources/Users/UserResource.php (1 hunks)
🧰 Additional context used
🪛 PHPMD (2.15.0)
app/Filament/Admin/Resources/Users/UserResource.php

289-289: Avoid unused local variables such as '$_'. (undefined)

(UnusedLocalVariable)

🔇 Additional comments (1)
app/Filament/Admin/Resources/Users/UserResource.php (1)

289-289: LGTM! Correctly prevents 500 error when oauth is null.

The null coalescing operator ensures that when $user->oauth is null, an empty array is used instead, preventing a TypeError and gracefully skipping the loop. This directly addresses the PR objective.

Note: The static analysis warning about unused variable $_ is a false positive—this is a standard PHP convention for intentionally ignoring values when only keys are needed.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@rmartinoscar rmartinoscar merged commit 266e377 into main Oct 11, 2025
25 checks passed
@rmartinoscar rmartinoscar deleted the fix/adminUserResource branch October 11, 2025 20:06
@github-actions github-actions bot locked and limited conversation to collaborators Oct 11, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants