Skip to content

Monthly Shift: April 2026#2291

Open
lancepioch wants to merge 2 commits intomainfrom
shift-2026-04
Open

Monthly Shift: April 2026#2291
lancepioch wants to merge 2 commits intomainfrom
shift-2026-04

Conversation

@lancepioch
Copy link
Copy Markdown
Member

This is an automated pull request included with your Shifty Plan. It contains curated refactors to keep your Laravel application aligned with the latest conventions and features.

This month focuses on adopting Laravel's fluent Rule builder such as Rule::date(), Rule::in(), Rule::exist(), and more. These streamline otherwise dense configuration strings.

Before merging, you should:

  • Checkout the shift-2026-04 branch
  • Review all pull request comments for additional changes
  • Test your application (no tests?, no CI?)

If you do not wish to adopt these refactors, you may simply close this pull request and delete its branch.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 4, 2026

📝 Walkthrough

Walkthrough

Validation rules in two Laravel request classes were refactored to use object-based Rule definitions instead of string-based syntax. The ReportBackupCompleteRequest class converted conditional requirements using Rule::requiredIf() callback, and the SftpAuthenticationFormRequest class replaced an inline in: rule with Rule::in() array format.

Changes

Cohort / File(s) Summary
Validation Rule Refactoring
app/Http/Requests/Api/Remote/ReportBackupCompleteRequest.php
Converted string-based validation rules to array-based definitions. Replaced required_if:successful,true with Rule::requiredIf() callback for conditional field requirements (checksum, checksum_type, size). Updated validation for nested parts.* subfields while maintaining nullable and type constraints.
Validation Rule Refactoring
app/Http/Requests/Api/Remote/SftpAuthenticationFormRequest.php
Replaced inline in:password,public_key string rule with Rule::in(['password', 'public_key']) object-based format. Added Rule import from Illuminate\Validation to support the new syntax.
🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title "Monthly Shift: April 2026" is vague and generic. It does not convey any meaningful information about the specific changes in the changeset, such as the adoption of Laravel's fluent Rule builder or validation refactors. Consider a more descriptive title that indicates the core change, such as "Adopt Laravel's fluent Rule builder for validation" or "Refactor validation rules to use Rule builder pattern".
✅ Passed checks (2 passed)
Check name Status Explanation
Description check ✅ Passed The description clearly relates to the changeset by explaining the adoption of Laravel's fluent Rule builder for validation refactors, which matches the file changes converting string-based rules to Rule::in() and Rule::requiredIf() patterns.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (2)
app/Http/Requests/Api/Remote/SftpAuthenticationFormRequest.php (1)

20-29: PHPDoc return type is now inaccurate.

The @return array<string, string[]> annotation no longer matches the actual return type. The type rule array now contains a Rule::in() object (Illuminate\Validation\Rules\In), not just strings.

📝 Suggested fix
     /**
      * Rules to apply to the request.
      *
-     * `@return` array<string, string[]>
+     * `@return` array<string, array<int, mixed>>
      */
     public function rules(): array
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@app/Http/Requests/Api/Remote/SftpAuthenticationFormRequest.php` around lines
20 - 29, The PHPDoc on the rules() method in SftpAuthenticationFormRequest is
incorrect because the 'type' rule now includes a Rule::in() object
(Illuminate\Validation\Rules\In); update the docblock for public function
rules(): array to a more accurate return type such as array<string, array<int,
mixed>> or array<string, array> (or explicitly mention
string|Illuminate\Validation\Rules\In) so the `@return` matches the actual values
returned by rules().
app/Http/Requests/Api/Remote/ReportBackupCompleteRequest.php (1)

10-10: PHPDoc return type is now inaccurate.

The @return array<array-key, string|string[]> annotation no longer matches the actual return type. The arrays now contain Rule::requiredIf() objects (Illuminate\Validation\Rules\RequiredIf), not just strings.

📝 Suggested fix
-    /** `@return` array<array-key, string|string[]> */
+    /** `@return` array<string, array<int, mixed>> */
     public function rules(): array
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@app/Http/Requests/Api/Remote/ReportBackupCompleteRequest.php` at line 10,
Update the PHPDoc on ReportBackupCompleteRequest (the rules() return annotation)
to include the RequiredIf rule objects returned by Rule::requiredIf();
specifically change the return type from array<array-key, string|string[]> to
include Illuminate\Validation\Rules\RequiredIf (e.g. array<array-key,
string|string[]|\Illuminate\Validation\Rules\RequiredIf>) so the docblock
accurately reflects that arrays may contain RequiredIf instances as well as
strings/arrays.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@app/Http/Requests/Api/Remote/ReportBackupCompleteRequest.php`:
- Line 10: Update the PHPDoc on ReportBackupCompleteRequest (the rules() return
annotation) to include the RequiredIf rule objects returned by
Rule::requiredIf(); specifically change the return type from array<array-key,
string|string[]> to include Illuminate\Validation\Rules\RequiredIf (e.g.
array<array-key, string|string[]|\Illuminate\Validation\Rules\RequiredIf>) so
the docblock accurately reflects that arrays may contain RequiredIf instances as
well as strings/arrays.

In `@app/Http/Requests/Api/Remote/SftpAuthenticationFormRequest.php`:
- Around line 20-29: The PHPDoc on the rules() method in
SftpAuthenticationFormRequest is incorrect because the 'type' rule now includes
a Rule::in() object (Illuminate\Validation\Rules\In); update the docblock for
public function rules(): array to a more accurate return type such as
array<string, array<int, mixed>> or array<string, array> (or explicitly mention
string|Illuminate\Validation\Rules\In) so the `@return` matches the actual values
returned by rules().

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 3f16a493-15e2-460c-8d4e-17b7303e0412

📥 Commits

Reviewing files that changed from the base of the PR and between b693d0e and 57ab49f.

📒 Files selected for processing (2)
  • app/Http/Requests/Api/Remote/ReportBackupCompleteRequest.php
  • app/Http/Requests/Api/Remote/SftpAuthenticationFormRequest.php

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants