Skip to content

Add exception for missing doc block sniff#2869

Merged
Crabcyborg merged 1 commit into
masterfrom
add_exception_for_missing_doc_block_sniff
Jan 23, 2026
Merged

Add exception for missing doc block sniff#2869
Crabcyborg merged 1 commit into
masterfrom
add_exception_for_missing_doc_block_sniff

Conversation

@Crabcyborg

@Crabcyborg Crabcyborg commented Jan 23, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Bug Fixes
    • Improved accuracy of return type detection in functions with multiple return paths, enhancing code analysis reliability for better validation results.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai

coderabbitai Bot commented Jan 23, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

The detectCertainReturnType function in the AddMissingDocblockSniff was updated to treat 'bool' return types identically to 'int' return types when mixed with uncertain returns. The function now returns null for both types when uncertain returns are present, broadening the detection of uncertain return type scenarios.

Changes

Cohort / File(s) Summary
Return Type Uncertainty Detection
phpcs-sniffs/Formidable/Sniffs/Commenting/AddMissingDocblockSniff.php
Modified detectCertainReturnType to treat 'bool' as an uncertain type alongside 'int' when mixed with other uncertain returns; returns null instead of concrete type in such scenarios

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 A bool and int now hand in paw,
When uncertainty rings the bell,
Both return null without a flaw,
Type detection working well! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Title check ⚠️ Warning The title mentions adding an exception for missing doc block sniff, but the actual change modifies how uncertain return types are handled in the detectCertainReturnType function, treating 'bool' similarly to 'int'. The title does not accurately reflect the core technical change. Consider a more descriptive title like 'Treat bool as uncertain return type in mixed-return scenarios' or 'Handle bool type uncertainty in detectCertainReturnType' to accurately reflect the functional change.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
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.

✨ Finishing touches
  • 📝 Generate docstrings

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.

@Crabcyborg
Crabcyborg merged commit bc26b21 into master Jan 23, 2026
37 of 38 checks passed
@Crabcyborg
Crabcyborg deleted the add_exception_for_missing_doc_block_sniff branch January 23, 2026 12:38
stephywells pushed a commit that referenced this pull request Apr 4, 2026
…c_block_sniff

Add exception for missing doc block sniff
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant