Skip to content

Fatal error: ArgumentCountError in AuthenticationRestEndpoint (v3.4.0) with WC 10.5.1 #4079

@janice51244

Description

@janice51244

GitHub Issue Bug Report
Describe the Bug
A fatal ArgumentCountError occurs within the woocommerce-paypal-payments plugin. The constructor for AuthenticationRestEndpoint expects exactly 3 arguments, but only 2 are being passed in services.php on line 168. This issue persists after updating WooCommerce to version 10.5.1.

To Reproduce
Use a WordPress environment with PHP 8.3.30.

Install/Update WooCommerce PayPal Payments v3.4.0.

Attempt to update plugins or navigate the WordPress Admin dashboard.

The site triggers a fatal error and enters WordPress Recovery Mode.

Expected Behavior
The plugin should initialize its services without argument mismatch errors in the dependency injection container.

Actual Behavior
The following fatal error is thrown: Uncaught ArgumentCountError: Too few arguments to function WooCommerce\PayPalCommerce\Settings\Endpoint\AuthenticationRestEndpoint::__construct(), 2 passed in .../modules/ppcp-settings/services.php on line 168 and exactly 3 expected in .../modules/ppcp-settings/src/Endpoint/AuthenticationRestEndpoint.php:55

Environment
WordPress Version: 6.9.1

WooCommerce Version: 10.5.1 (Problem persisted after updating from 10.5.0)

Plugin Version: 3.4.0

PHP Version: 8.3.30

Theme: Kadence 1.4.3

Active Plugins: Google Site Kit, WooCommerce, WooCommerce PayPal Payments.

Additional Details
Full Stack Trace:

PHP
#0 .../modules/ppcp-settings/services.php(168): WooCommerce\PayPalCommerce\Settings\Endpoint\AuthenticationRestEndpoint->__construct()
#1 .../lib/packages/Inpsyde/Modularity/Container/ReadOnlyContainer.php(46): WooCommerce\PayPalCommerce\Settings\SettingsModule::WooCommerce\PayPalCommerce\Settings{closure}()
#2 .../modules/ppcp-settings/src/SettingsModule.php(238): WooCommerce\PayPalCommerce\Vendor\Inpsyde\Modularity\Container\ReadOnlyContainer->get()
#3 .../wp-includes/class-wp-hook.php(341): WooCommerce\PayPalCommerce\Settings\SettingsModule::WooCommerce\PayPalCommerce\Settings{closure}()
#4 .../wp-includes/class-wp-hook.php(365): WP_Hook->apply_filters()
#5 .../wp-includes/plugin.php(522): WP_Hook->do_action()
#6 .../wp-includes/rest-api.php(636): do_action()
The error appears to be a regression in how the AuthenticationRestEndpoint is instantiated within the ppcp-settings module's service definitions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions