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: YoastSEO_Vendor\Symfony\Component\DependencyInjection\Container::__construct(): Implicitly marking parameter $parameterBag as nullable is deprecated in PHP 8.4 #21859

Open
2 of 11 tasks
bobbingwide opened this issue Nov 23, 2024 · 2 comments

Comments

@bobbingwide
Copy link
Contributor

bobbingwide commented Nov 23, 2024

  • I've read and understood the contribution guidelines.
  • I've searched for any related issues and avoided creating a duplicate issue.

Please give us a description of what happened

This message is produced with PHP 8.4.1

Deprecated: YoastSEO_Vendor\Symfony\Component\DependencyInjection\Container::__construct(): Implicitly marking parameter $parameterBag as nullable is deprecated, the explicit nullable type must be used instead in C:\apache\htdocs\wordpress\wp-content\plugins\wordpress-seo\vendor_prefixed\symfony\dependency-injection\Container.php on line 60

To Reproduce

Step-by-step reproduction instructions

  1. Switch to PHP 8.4.1
  2. Ensure wordpress-seo is activated
  3. run a WP-CLI command such as wp plugin status wordpress-seo
  4. Notice several Deprecated messages... one of which is produced for WordPress SEO; the other 3 are from WP-CLI

Expected results

Plugin wordpress-seo details:
Name: Yoast SEO
Status: Active
Version: 23.9
Author: Team Yoast
Description: The first true all-in-one SEO solution for WordPress, including on-page content analysis, XML sitemaps and much more.

Actual results

C:\apache\htdocs\wordpress\wp-content\plugins\oik>wp plugin status wordpress-seo

Deprecated: WP_CLI\Runner::get_subcommand_suggestion(): Implicitly marking parameter $root_command as nullable is deprecated, the explicit nullable type must be used instead in phar://C:/d_drive/dos/wp-cli.phar/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php on line 1958
Deprecated: YoastSEO_Vendor\Symfony\Component\DependencyInjection\Container::__construct(): Implicitly marking parameter $parameterBag as nullable is deprecated, the explicit nullable type must be used instead in C:\apache\htdocs\wordpress\wp-content\plugins\wordpress-seo\vendor_prefixed\symfony\dependency-injection\Container.php on line 60
Deprecated: Mustache_Engine::loadSource(): Implicitly marking parameter $cache as nullable is deprecated, the explicit nullable type must be used instead in phar://C:/d_drive/dos/wp-cli.phar/vendor/mustache/mustache/src/Mustache/Engine.php on line 727
Deprecated: Mustache_Parser::buildTree(): Implicitly marking parameter $parent as nullable is deprecated, the explicit nullable type must be used instead in phar://C:/d_drive/dos/wp-cli.phar/vendor/mustache/mustache/src/Mustache/Parser.php on line 73
Plugin wordpress-seo details:
Name: Yoast SEO
Status: Active
Version: 23.9
Author: Team Yoast
Description: The first true all-in-one SEO solution for WordPress, including on-page content analysis, XML sitemaps and much more.

Screenshots, screen recording, code snippet

See output above.

Technical info

  • If relevant, which editor is affected (or editors):
  • Block Editor
  • Gutenberg Editor
  • Elementor Editor
  • Classic Editor
  • Other:
  • Which browser is affected (or browsers):
  • Chrome
  • Firefox
  • Safari
  • Other:

Used versions

  • Device you are using: Dell laptop
  • Operating system: Windows
  • PHP version: 8.4.1
  • WordPress version: 6.7.1
  • WordPress Theme: n/a
  • Yoast SEO version: 23.9
  • Gutenberg plugin version:
  • Elementor plugin version:
  • Classic Editor plugin version:
  • Relevant plugins in case of a bug:

For my environment the fix is easy.
Add a ? to line 60 of the file mentioned.

public function __construct(?\YoastSEO_Vendor\Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface $parameterBag = null)
@bobbingwide
Copy link
Contributor Author

I've received several other Deprecated messages that should also be addressed.

[23-Nov-2024 17:25:52 UTC] PHP Deprecated: YoastSEO_Vendor\League\OAuth2\Client\Provider\AbstractProvider::authorize(): Implicitly marking parameter $redirectHandler as nullable is deprecated, the explicit nullable type must be used instead in C:\apache\htdocs\wordpress\wp-content\plugins\wordpress-seo\vendor_prefixed\league\oauth2-client\src\Provider\AbstractProvider.php on line 416
[23-Nov-2024 17:25:52 UTC] PHP Deprecated: YoastSEO_Vendor\GuzzleHttp\Client::getConfig(): Implicitly marking parameter $option as nullable is deprecated, the explicit nullable type must be used instead in C:\apache\htdocs\wordpress\wp-content\plugins\wordpress-seo\vendor_prefixed\guzzlehttp\guzzle\src\Client.php on line 181
[23-Nov-2024 17:25:52 UTC] PHP Deprecated: YoastSEO_Vendor\GuzzleHttp\ClientInterface::getConfig(): Implicitly marking parameter $option as nullable is deprecated, the explicit nullable type must be used instead in C:\apache\htdocs\wordpress\wp-content\plugins\wordpress-seo\vendor_prefixed\guzzlehttp\guzzle\src\ClientInterface.php on line 77

@josevarghese
Copy link
Contributor

josevarghese commented Nov 24, 2024

Hi @bobbingwide

Thanks for creating the issue.

As WP had added “beta support” for PHP 8.3 in version 6.4 and there are no mentions of 8.4 till now, the deprecation message for PHP 8.4 is expected. Our team will fix deprecated messages for PHP 8.4 when WP is fully compatible. As there are no mentions of PHP 8.4 within the WP document shared above, it may take some time.

If the issue occurs with PHP 8.3, please let us know.

@josevarghese josevarghese changed the title Deprecated: YoastSEO_Vendor\Symfony\Component\DependencyInjection\Container::__construct(): Implicitly marking parameter $parameterBag as nullable is deprecated Deprecated: YoastSEO_Vendor\Symfony\Component\DependencyInjection\Container::__construct(): Implicitly marking parameter $parameterBag as nullable is deprecated in PHP 8.4 Nov 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants