Deprecated nullable type causes a warning on PHP 8.4
Describe the bug
This is a mostly self-explaining problem whose fix is, fortunately, very simple - literally one extra letter.
Deprecated: Microsoft\Graph\Core\Requests\BaseBatchRequestBuilder::__construct(): Implicitly marking parameter $errorMappings as nullable is deprecated, the explicit nullable type must be used instead in /var/www/html/vendor/microsoft/microsoft-graph-core/src/Requests/BaseBatchRequestBuilder.php on line 49
Looking at the signature of the constructor
public function __construct(RequestAdapter $requestAdapter, array $errorMappings = null)
should be
public function __construct(RequestAdapter $requestAdapter, ?array $errorMappings = null)
Maybe the whole codebase should be scanned for this deprecation... these will become errors in PHP 9.
Expected behavior
No deprecation warning.
How to reproduce
Run anything with this class under PHP 8.4
SDK Version
2.25.0
Latest version known to work for scenario above?
No response
Known Workarounds
No response
Debug output
Click to expand log
```</details>
### Configuration
_No response_
### Other information
_No response_
So, here is more of them:
Deprecated: Microsoft\Graph\GraphRequestAdapter::__construct(): Implicitly marking parameter $httpClient as nullable is deprecated, the explicit nullable type must be used instead in /var/www/html/vendor/microsoft/microsoft-graph/src/GraphRequestAdapter.php on line 32
Deprecated: Microsoft\Graph\Core\GraphClientFactory::getDefaultHandlerStack(): Implicitly marking parameter $handler as nullable is deprecated, the explicit nullable type must be used instead in /var/www/html/vendor/microsoft/microsoft-graph-core/src/GraphClientFactory.php on line 146
Deprecated: Microsoft\Graph\Core\Requests\BaseBatchRequestBuilder::__construct(): Implicitly marking parameter $errorMappings as nullable is deprecated, the explicit nullable type must be used instead in /var/www/html/vendor/microsoft/microsoft-graph-core/src/Requests/BaseBatchRequestBuilder.php on line 49
Deprecated: Http\Promise\FulfilledPromise::then(): Implicitly marking parameter $onFulfilled as nullable is deprecated, the explicit nullable type must be used instead in /var/www/html/vendor/php-http/promise/src/FulfilledPromise.php on line 32
Deprecated: Http\Promise\FulfilledPromise::then(): Implicitly marking parameter $onRejected as nullable is deprecated, the explicit nullable type must be used instead in /var/www/html/vendor/php-http/promise/src/FulfilledPromise.php on line 32
Deprecated: Http\Promise\Promise::then(): Implicitly marking parameter $onFulfilled as nullable is deprecated, the explicit nullable type must be used instead in /var/www/html/vendor/php-http/promise/src/Promise.php on line 48
Deprecated: Http\Promise\Promise::then(): Implicitly marking parameter $onRejected as nullable is deprecated, the explicit nullable type must be used instead in /var/www/html/vendor/php-http/promise/src/Promise.php on line 48
This will require updates in the various core libraries,
This will require updates in the various core libraries,
Is it something in the pipeline?
This will require updates in the various core libraries,
Is it something in the pipeline?
Not at the moment. We've moved the core libraries into a Mono repo so we can discuss internally and prioritize. Alternatively, if you put up a pr for this, we shall definitely have a look and merge it in.
The code's been updated in GitHub. Any chance of tagging a release and getting it into Packagist?
@mralston this release is currently blocked by https://github.com/microsoft/kiota-php/pull/53
Ah, gotcha. Thanks for the info.