Skip to content

Conversation

@SoftHeroes
Copy link
Contributor

Description

This PR fixes incorrect PHPDoc method signatures in the Response facade that don't match the actual implementation in the Response class.

Issues Fixed:

  1. ok() method - Missing parameters (mixed $data = null, array $headers = [], int $options = 0)
  2. created() method - Missing parameters (mixed $data = null, array $headers = [], int $options = 0)
  3. noContent() method - Missing parameters (array $headers = [], int $options = 0)
  4. respond() method - Removed non-existent method that doesn't exist in the actual Response class

Root Cause:

The facade PHPDoc was incomplete and didn't reflect the actual method signatures in Apiato\Http\Response, causing PHPStan and other static analysis tools to report incorrect parameter counts.

Impact:

• Fixes static analysis errors when using Response facade methods with parameters
• Improves IDE autocompletion and type checking
• Ensures facade documentation matches implementation

Testing:

• No functional changes - only documentation updates
• Existing tests should continue to pass
• Static analysis tools will now correctly validate method calls

Type of change

[✓] Bug fix (non-breaking change which fixes an issue)
[ ] Refactor (refactoring a current feature, method, etc...)
[ ] Code Coverage (adding/removing/updating/refactoring tests)
[ ] New feature (non-breaking change which adds functionality)
[ ] Remove feature (non-breaking change which removes functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)

This is a bug fix because the facade documentation was incorrect, causing static analysis tools to report false errors when developers correctly used the Response methods with their proper parameters.

@SoftHeroes SoftHeroes changed the title fixing DocBlock Fix incorrect PHPDoc signatures in Response facade Oct 12, 2025
@SoftHeroes SoftHeroes marked this pull request as draft October 12, 2025 15:30
@SoftHeroes SoftHeroes marked this pull request as ready for review October 12, 2025 15:31
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR corrects PHPDoc method signatures in the Response facade to align with the actual implementation in the Response class, resolving static analysis errors and improving IDE support.

Key Changes:

  • Updated parameter signatures for ok(), created(), and noContent() methods to match their actual implementations
  • Added accepted() method signature with proper parameters

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov
Copy link

codecov bot commented Oct 25, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.53%. Comparing base (f4d410f) to head (6dc24f3).
⚠️ Report is 2 commits behind head on 13.x.

Additional details and impacted files
@@             Coverage Diff              @@
##               13.x     #228      +/-   ##
============================================
+ Coverage     89.35%   89.53%   +0.18%     
  Complexity      342      342              
============================================
  Files            43       43              
  Lines           996      975      -21     
============================================
- Hits            890      873      -17     
+ Misses          106      102       -4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Mohammad-Alavi Mohammad-Alavi merged commit e0f66c5 into apiato:13.x Oct 25, 2025
7 checks passed
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