Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecated nullable type causes a warning on PHP 8.4 #1643

Open
Marian-Kechlibar opened this issue Feb 5, 2025 · 2 comments
Open

Deprecated nullable type causes a warning on PHP 8.4 #1643

Marian-Kechlibar opened this issue Feb 5, 2025 · 2 comments
Labels
status:waiting-for-triage An issue that is yet to be reviewed or assigned type:bug A broken experience

Comments

@Marian-Kechlibar
Copy link

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_
@Marian-Kechlibar Marian-Kechlibar added status:waiting-for-triage An issue that is yet to be reviewed or assigned type:bug A broken experience labels Feb 5, 2025
@Marian-Kechlibar
Copy link
Author

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

@musale
Copy link

musale commented Feb 20, 2025

This will require updates in the various core libraries,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:waiting-for-triage An issue that is yet to be reviewed or assigned type:bug A broken experience
Projects
None yet
Development

No branches or pull requests

2 participants