Description
ExtendedWebServicesManager::__construct() has two issues that make it unusable with the current webfiori/http package.
1. Incorrect parent constructor call
// ExtendedWebServicesManager.php line 38
public function __construct(string $version = '1.0.0') {
parent::__construct($version); // BUG: passes string as first arg
}
WebServicesManager::__construct() signature is:
public function __construct(?Request $request = null, string $version = '1.0.0')
The version string is passed as the $request parameter, causing:
WebServicesManager::__construct(): Argument #1 ($request) must be of type ?WebFiori\Http\Request, string given
Fix: Change to parent::__construct(null, $version);
2. Static call to non-static Request::getMethod()
In setTranslationHelper() (line ~215):
$reqMeth = Request::getMethod();
Request::getMethod() is not static in the current webfiori/http package, causing:
Non-static method WebFiori\Http\Request::getMethod() cannot be called statically
Fix: Use $this->getRequest()->getMethod() instead.
Steps to Reproduce
- Create a class extending
ExtendedWebServicesManager
- Register it as an API route
- Send any request to the route
Environment
webfiori/framework: v3.0.0-RC0
webfiori/http: latest
- PHP 8.4
Description
ExtendedWebServicesManager::__construct()has two issues that make it unusable with the currentwebfiori/httppackage.1. Incorrect parent constructor call
WebServicesManager::__construct()signature is:The version string is passed as the $request parameter, causing:
Fix: Change to
parent::__construct(null, $version);2. Static call to non-static
Request::getMethod()In
setTranslationHelper()(line ~215):Request::getMethod()is not static in the currentwebfiori/httppackage, causing:Fix: Use
$this->getRequest()->getMethod()instead.Steps to Reproduce
ExtendedWebServicesManagerEnvironment
webfiori/framework: v3.0.0-RC0webfiori/http: latest