Skip to content

fix: correct parent constructor call and static method in ExtendedWebServicesManager#309

Merged
usernane merged 2 commits intomainfrom
dev
Apr 29, 2026
Merged

fix: correct parent constructor call and static method in ExtendedWebServicesManager#309
usernane merged 2 commits intomainfrom
dev

Conversation

@usernane
Copy link
Copy Markdown
Member

Summary

Fix two issues in ExtendedWebServicesManager that made the class unusable with the current webfiori/http package.

Motivation

ExtendedWebServicesManager crashes on instantiation due to passing the version string as the $request parameter to the parent constructor, and calling Request::getMethod() statically when it is an instance method. Fixes #296.

Changes

  • Changed parent::__construct($version) to parent::__construct(null, $version) to match WebServicesManager::__construct(?Request $request, string $version) signature
  • Changed Request::getMethod() to $this->getRequest()->getMethod() since getMethod() is not static

How to Test / Verify

  • Create a class extending ExtendedWebServicesManager, register it as an API route, and send a request
  • Existing test suite passes (672 tests, only pre-existing MSSQL and language test ordering failures)

Breaking Changes and Migration Steps

None

Checklist

  • I reviewed my own diff before requesting review
  • My commits follow Conventional Commits
  • The title of the pull request follows Conventional Commits
  • I added/updated tests (or explained why not)
  • I updated docs (if needed)
  • I ran lint/cs-fixer (if applicable)
  • I considered backward compatibility
  • I considered security

Related issues

Closes #296

Ibrahim BinAlshikh and others added 2 commits April 30, 2026 00:36
…dedWebServicesManager

- Pass null as first argument to parent::__construct() since
  WebServicesManager expects ?Request as first parameter, not string.

- Use $this->getRequest()->getMethod() instead of static
  Request::getMethod() which is not a static method.

Fixes #296
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 29, 2026

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.89%. Comparing base (007c799) to head (3bb8970).
⚠️ Report is 12 commits behind head on main.

Files with missing lines Patch % Lines
WebFiori/Framework/ExtendedWebServicesManager.php 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##               main     #309   +/-   ##
=========================================
  Coverage     74.89%   74.89%           
  Complexity     2976     2976           
=========================================
  Files            97       97           
  Lines          9511     9511           
=========================================
  Hits           7123     7123           
  Misses         2388     2388           
Flag Coverage Δ
php-8.1 76.21% <0.00%> (ø)
php-8.2 76.16% <0.00%> (ø)
php-8.3 74.96% <0.00%> (ø)
php-8.4 74.96% <0.00%> (ø)
php-8.5 74.86% <0.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@usernane usernane merged commit 8aeb44b into main Apr 29, 2026
9 checks passed
@sonarqubecloud
Copy link
Copy Markdown

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.

ExtendedWebServicesManager: incorrect parent constructor call and static method usage

1 participant