Commit d5c53efc7b for woocommerce

commit d5c53efc7ba616ccdd0c4a956ceb98ede07736d5
Author: Néstor Soriano <konamiman@konamiman.com>
Date:   Wed May 21 10:21:34 2025 +0200

    Remove the old dependency injection container and all the related infrastructure (#57966)

    Co-authored-by: Adrian Moldovan <3854374+adimoldovan@users.noreply.github.com>

diff --git a/plugins/woocommerce/changelog/pr-57966 b/plugins/woocommerce/changelog/pr-57966
new file mode 100644
index 0000000000..212e51fb22
--- /dev/null
+++ b/plugins/woocommerce/changelog/pr-57966
@@ -0,0 +1,4 @@
+Significance: minor
+Type: update
+
+Remove the old dependency injection container and all the related infrastructure
diff --git a/plugins/woocommerce/lib/README.md b/plugins/woocommerce/lib/README.md
index 7119d5574b..3950079fb6 100644
--- a/plugins/woocommerce/lib/README.md
+++ b/plugins/woocommerce/lib/README.md
@@ -1,4 +1,4 @@
-## WooCommerce Lib Directory
+# WooCommerce Lib Directory

 This directory contains a dummy package responsible for managing WooCommerce dependencies that require conflict avoidance.
 The contents of the `packages` and `classes` directories get automatically generated by `composer install` and `composer update`.
@@ -8,7 +8,7 @@ All namespaces are prefixed with `Automattic\WooCommerce\Vendor` and classmap cl

 **_Do not_ make direct changes in the files contained in `packages` or `classes`! Any changes will be lost!**

-### Adding Packages
+## Adding Packages

 In order to avoid including the original dependencies in the root autoloader we must utilize `require-dev` for them.
 Composer treats `require` dependencies as transitive while `require-dev` dependencies get ignored by consumers.
@@ -17,15 +17,27 @@ Composer treats `require` dependencies as transitive while `require-dev` depende
 2. Add package slug to `extra/mozart/packages` section of `composer.json`
 3. Run `composer run-script build-lib` from the root directory (You should now see the package in `packages/VendorName/PackageName` or `classes`)

-### Updating Packages
+## Updating Packages

 Updating a package is as easy as changing the version in `composer.json` and then running `composer run-script build-lib` from the root directory.

-### Ignoring Packages
+## Ignoring Packages

 If you would like to add a package which does not undergo conflict avoidance you must take steps to ensure it appears in
 the root autoloader.

 1. Add package to the `require` section of both the `lib/composer.json` and root `composer.json` file instead of `require-dev`
 2. Add package slug to `extra/mozart/excluded-packages` section of `composer.json`
-3. Run `composer run-script build-lib` from the root directory (You **should not** see the package in `packages/VendorName/PackageName` or `classes`)
+3. Run `composer run-script build-lib` from the root directory (You **should not** see the package in `packages/VendorName/PackageName` or `classes`) - see the note about MobileDetect below.
+
+## A note about the MobileDetect library
+
+The `lib/packages/Detection/MobileDetect.php` file
+[got manual changes to prevent deprecation warnings in PHP 8](https://github.com/woocommerce/woocommerce/pull/53526).
+These fixes are already present in newer versions of the package, but we can't update to any of these versions
+because they all require PHP 8. The package version currently in use is the newest one supporting PHP 7.4.
+
+Therefore, as long as WooCommerce runs in PHP 7.4 and no alternative solution is found for this,
+the changes in `lib/packages/Detection/MobileDetect.php` must be manually reverted after running
+`composer run-script build-lib`. This can be accomplished from the command line by running
+`git restore ./plugins/woocommerce/lib/packages/Detection/MobileDetect.php` from the root of the repository.
diff --git a/plugins/woocommerce/lib/composer.json b/plugins/woocommerce/lib/composer.json
index 3cfa214a23..851e9490ee 100644
--- a/plugins/woocommerce/lib/composer.json
+++ b/plugins/woocommerce/lib/composer.json
@@ -7,7 +7,6 @@
 		"php": ">=7.4"
 	},
 	"require-dev": {
-		"league/container": "3.3.5",
 		"mobiledetect/mobiledetectlib": "^3.74",
 		"psr/container": "^1.1"
 	},
@@ -29,9 +28,8 @@
 			"dep_namespace": "Automattic\\WooCommerce\\Vendor\\",
 			"dep_directory": "/packages/",
 			"packages": [
-				"league/container",
-				"mobiledetect/mobiledetectlib",
-				"psr/container"
+				"psr/container",
+				"mobiledetect/mobiledetectlib"
 			],
 			"excluded_packages": [
 			],
diff --git a/plugins/woocommerce/lib/composer.lock b/plugins/woocommerce/lib/composer.lock
index a11e31de4c..197a0b71da 100644
--- a/plugins/woocommerce/lib/composer.lock
+++ b/plugins/woocommerce/lib/composer.lock
@@ -4,88 +4,9 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
         "This file is @generated automatically"
     ],
-    "content-hash": "e7bcc779909e9742f85e0f7e8cec2a2b",
+    "content-hash": "134394570ae077628e472ed3288ad575",
     "packages": [],
     "packages-dev": [
-        {
-            "name": "league/container",
-            "version": "3.3.5",
-            "source": {
-                "type": "git",
-                "url": "https://github.com/thephpleague/container.git",
-                "reference": "048ab87810f508dbedbcb7ae941b606eb8ee353b"
-            },
-            "dist": {
-                "type": "zip",
-                "url": "https://api.github.com/repos/thephpleague/container/zipball/048ab87810f508dbedbcb7ae941b606eb8ee353b",
-                "reference": "048ab87810f508dbedbcb7ae941b606eb8ee353b",
-                "shasum": ""
-            },
-            "require": {
-                "php": "^7.0 || ^8.0",
-                "psr/container": "^1.0.0 || ^2.0.0"
-            },
-            "provide": {
-                "psr/container-implementation": "^1.0"
-            },
-            "replace": {
-                "orno/di": "~2.0"
-            },
-            "require-dev": {
-                "phpunit/phpunit": "^6.0",
-                "roave/security-advisories": "dev-master",
-                "scrutinizer/ocular": "^1.8",
-                "squizlabs/php_codesniffer": "^3.5"
-            },
-            "type": "library",
-            "extra": {
-                "branch-alias": {
-                    "dev-master": "3.x-dev",
-                    "dev-3.x": "3.x-dev",
-                    "dev-2.x": "2.x-dev",
-                    "dev-1.x": "1.x-dev"
-                }
-            },
-            "autoload": {
-                "psr-4": {
-                    "League\\Container\\": "src"
-                }
-            },
-            "notification-url": "https://packagist.org/downloads/",
-            "license": [
-                "MIT"
-            ],
-            "authors": [
-                {
-                    "name": "Phil Bennett",
-                    "email": "philipobenito@gmail.com",
-                    "homepage": "http://www.philipobenito.com",
-                    "role": "Developer"
-                }
-            ],
-            "description": "A fast and intuitive dependency injection container.",
-            "homepage": "https://github.com/thephpleague/container",
-            "keywords": [
-                "container",
-                "dependency",
-                "di",
-                "injection",
-                "league",
-                "provider",
-                "service"
-            ],
-            "support": {
-                "issues": "https://github.com/thephpleague/container/issues",
-                "source": "https://github.com/thephpleague/container/tree/3.3.5"
-            },
-            "funding": [
-                {
-                    "url": "https://github.com/philipobenito",
-                    "type": "github"
-                }
-            ],
-            "time": "2021-03-16T09:42:56+00:00"
-        },
         {
             "name": "mobiledetect/mobiledetectlib",
             "version": "3.74.3",
@@ -201,13 +122,13 @@
     ],
     "aliases": [],
     "minimum-stability": "dev",
-    "stability-flags": [],
+    "stability-flags": {},
     "prefer-stable": true,
     "prefer-lowest": false,
     "platform": {
         "php": ">=7.4"
     },
-    "platform-dev": [],
+    "platform-dev": {},
     "platform-overrides": {
         "php": "7.4"
     },
diff --git a/plugins/woocommerce/lib/packages/League/Container/Argument/ArgumentResolverInterface.php b/plugins/woocommerce/lib/packages/League/Container/Argument/ArgumentResolverInterface.php
deleted file mode 100644
index 9c7393f657..0000000000
--- a/plugins/woocommerce/lib/packages/League/Container/Argument/ArgumentResolverInterface.php
+++ /dev/null
@@ -1,28 +0,0 @@
-<?php declare(strict_types=1);
-
-namespace Automattic\WooCommerce\Vendor\League\Container\Argument;
-
-use Automattic\WooCommerce\Vendor\League\Container\ContainerAwareInterface;
-use ReflectionFunctionAbstract;
-
-interface ArgumentResolverInterface extends ContainerAwareInterface
-{
-    /**
-     * Resolve an array of arguments to their concrete implementations.
-     *
-     * @param array $arguments
-     *
-     * @return array
-     */
-    public function resolveArguments(array $arguments) : array;
-
-    /**
-     * Resolves the correct arguments to be passed to a method.
-     *
-     * @param ReflectionFunctionAbstract $method
-     * @param array                      $args
-     *
-     * @return array
-     */
-    public function reflectArguments(ReflectionFunctionAbstract $method, array $args = []) : array;
-}
diff --git a/plugins/woocommerce/lib/packages/League/Container/Argument/ArgumentResolverTrait.php b/plugins/woocommerce/lib/packages/League/Container/Argument/ArgumentResolverTrait.php
deleted file mode 100644
index c43919ba77..0000000000
--- a/plugins/woocommerce/lib/packages/League/Container/Argument/ArgumentResolverTrait.php
+++ /dev/null
@@ -1,120 +0,0 @@
-<?php declare(strict_types=1);
-
-namespace Automattic\WooCommerce\Vendor\League\Container\Argument;
-
-use Automattic\WooCommerce\Vendor\League\Container\Container;
-use Automattic\WooCommerce\Vendor\League\Container\Exception\{ContainerException, NotFoundException};
-use Automattic\WooCommerce\Vendor\League\Container\ReflectionContainer;
-use Automattic\WooCommerce\Vendor\Psr\Container\ContainerInterface;
-use ReflectionFunctionAbstract;
-use ReflectionParameter;
-
-trait ArgumentResolverTrait
-{
-    /**
-     * {@inheritdoc}
-     */
-    public function resolveArguments(array $arguments) : array
-    {
-        return array_map(function ($argument) {
-            $justStringValue = false;
-
-            if ($argument instanceof RawArgumentInterface) {
-                return $argument->getValue();
-            } elseif ($argument instanceof ClassNameInterface) {
-                $id = $argument->getClassName();
-            } elseif (!is_string($argument)) {
-                return $argument;
-            } else {
-                $justStringValue = true;
-                $id = $argument;
-            }
-
-            $container = null;
-
-            try {
-                $container = $this->getLeagueContainer();
-            } catch (ContainerException $e) {
-                if ($this instanceof ReflectionContainer) {
-                    $container = $this;
-                }
-            }
-
-            if ($container !== null) {
-                try {
-                    return $container->get($id);
-                } catch (NotFoundException $exception) {
-                    if ($argument instanceof ClassNameWithOptionalValue) {
-                        return $argument->getOptionalValue();
-                    }
-
-                    if ($justStringValue) {
-                        return $id;
-                    }
-
-                    throw $exception;
-                }
-            }
-
-            if ($argument instanceof ClassNameWithOptionalValue) {
-                return $argument->getOptionalValue();
-            }
-
-            // Just a string value.
-            return $id;
-        }, $arguments);
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function reflectArguments(ReflectionFunctionAbstract $method, array $args = []) : array
-    {
-        $arguments = array_map(function (ReflectionParameter $param) use ($method, $args) {
-            $name = $param->getName();
-            $type = $param->getType();
-
-            if (array_key_exists($name, $args)) {
-                return new RawArgument($args[$name]);
-            }
-
-            if ($type) {
-                if (PHP_VERSION_ID >= 70100) {
-                    $typeName = $type->getName();
-                } else {
-                    $typeName = (string) $type;
-                }
-
-                $typeName = ltrim($typeName, '?');
-
-                if ($param->isDefaultValueAvailable()) {
-                    return new ClassNameWithOptionalValue($typeName, $param->getDefaultValue());
-                }
-
-                return new ClassName($typeName);
-            }
-
-            if ($param->isDefaultValueAvailable()) {
-                return new RawArgument($param->getDefaultValue());
-            }
-
-            throw new NotFoundException(sprintf(
-                'Unable to resolve a value for parameter (%s) in the function/method (%s)',
-                $name,
-                $method->getName()
-            ));
-        }, $method->getParameters());
-
-        return $this->resolveArguments($arguments);
-    }
-
-    /**
-     * @return ContainerInterface
-     */
-    abstract public function getContainer() : ContainerInterface;
-
-    /**
-     * @return Container
-     */
-    abstract public function getLeagueContainer() : Container;
-}
diff --git a/plugins/woocommerce/lib/packages/League/Container/Argument/ClassName.php b/plugins/woocommerce/lib/packages/League/Container/Argument/ClassName.php
deleted file mode 100644
index bab358fce3..0000000000
--- a/plugins/woocommerce/lib/packages/League/Container/Argument/ClassName.php
+++ /dev/null
@@ -1,29 +0,0 @@
-<?php declare(strict_types=1);
-
-namespace Automattic\WooCommerce\Vendor\League\Container\Argument;
-
-class ClassName implements ClassNameInterface
-{
-    /**
-     * @var string
-     */
-    protected $value;
-
-    /**
-     * Construct.
-     *
-     * @param string $value
-     */
-    public function __construct(string $value)
-    {
-        $this->value = $value;
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function getClassName() : string
-    {
-        return $this->value;
-    }
-}
diff --git a/plugins/woocommerce/lib/packages/League/Container/Argument/ClassNameInterface.php b/plugins/woocommerce/lib/packages/League/Container/Argument/ClassNameInterface.php
deleted file mode 100644
index ab2708eaee..0000000000
--- a/plugins/woocommerce/lib/packages/League/Container/Argument/ClassNameInterface.php
+++ /dev/null
@@ -1,13 +0,0 @@
-<?php declare(strict_types=1);
-
-namespace Automattic\WooCommerce\Vendor\League\Container\Argument;
-
-interface ClassNameInterface
-{
-    /**
-     * Return the class name.
-     *
-     * @return string
-     */
-    public function getClassName() : string;
-}
diff --git a/plugins/woocommerce/lib/packages/League/Container/Argument/ClassNameWithOptionalValue.php b/plugins/woocommerce/lib/packages/League/Container/Argument/ClassNameWithOptionalValue.php
deleted file mode 100644
index 078fc381c5..0000000000
--- a/plugins/woocommerce/lib/packages/League/Container/Argument/ClassNameWithOptionalValue.php
+++ /dev/null
@@ -1,39 +0,0 @@
-<?php
-
-namespace Automattic\WooCommerce\Vendor\League\Container\Argument;
-
-class ClassNameWithOptionalValue implements ClassNameInterface
-{
-    /**
-     * @var string
-     */
-    private $className;
-
-    /**
-     * @var mixed
-     */
-    private $optionalValue;
-
-    /**
-     * @param string $className
-     * @param mixed $optionalValue
-     */
-    public function __construct(string $className, $optionalValue)
-    {
-        $this->className = $className;
-        $this->optionalValue = $optionalValue;
-    }
-
-    /**
-     * @inheritDoc
-     */
-    public function getClassName(): string
-    {
-        return $this->className;
-    }
-
-    public function getOptionalValue()
-    {
-        return $this->optionalValue;
-    }
-}
diff --git a/plugins/woocommerce/lib/packages/League/Container/Argument/RawArgument.php b/plugins/woocommerce/lib/packages/League/Container/Argument/RawArgument.php
deleted file mode 100644
index fe0ddd06d1..0000000000
--- a/plugins/woocommerce/lib/packages/League/Container/Argument/RawArgument.php
+++ /dev/null
@@ -1,29 +0,0 @@
-<?php declare(strict_types=1);
-
-namespace Automattic\WooCommerce\Vendor\League\Container\Argument;
-
-class RawArgument implements RawArgumentInterface
-{
-    /**
-     * @var mixed
-     */
-    protected $value;
-
-    /**
-     * Construct.
-     *
-     * @param mixed $value
-     */
-    public function __construct($value)
-    {
-        $this->value = $value;
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function getValue()
-    {
-        return $this->value;
-    }
-}
diff --git a/plugins/woocommerce/lib/packages/League/Container/Argument/RawArgumentInterface.php b/plugins/woocommerce/lib/packages/League/Container/Argument/RawArgumentInterface.php
deleted file mode 100644
index 8730cac859..0000000000
--- a/plugins/woocommerce/lib/packages/League/Container/Argument/RawArgumentInterface.php
+++ /dev/null
@@ -1,13 +0,0 @@
-<?php declare(strict_types=1);
-
-namespace Automattic\WooCommerce\Vendor\League\Container\Argument;
-
-interface RawArgumentInterface
-{
-    /**
-     * Return the value of the raw argument.
-     *
-     * @return mixed
-     */
-    public function getValue();
-}
diff --git a/plugins/woocommerce/lib/packages/League/Container/Container.php b/plugins/woocommerce/lib/packages/League/Container/Container.php
deleted file mode 100644
index 20ed50c286..0000000000
--- a/plugins/woocommerce/lib/packages/League/Container/Container.php
+++ /dev/null
@@ -1,248 +0,0 @@
-<?php declare(strict_types=1);
-
-namespace Automattic\WooCommerce\Vendor\League\Container;
-
-use Automattic\WooCommerce\Vendor\League\Container\Definition\{DefinitionAggregate, DefinitionInterface, DefinitionAggregateInterface};
-use Automattic\WooCommerce\Vendor\League\Container\Exception\{NotFoundException, ContainerException};
-use Automattic\WooCommerce\Vendor\League\Container\Inflector\{InflectorAggregate, InflectorInterface, InflectorAggregateInterface};
-use Automattic\WooCommerce\Vendor\League\Container\ServiceProvider\{
-    ServiceProviderAggregate,
-    ServiceProviderAggregateInterface,
-    ServiceProviderInterface
-};
-use Automattic\WooCommerce\Vendor\Psr\Container\ContainerInterface;
-
-class Container implements ContainerInterface
-{
-    /**
-     * @var boolean
-     */
-    protected $defaultToShared = false;
-
-    /**
-     * @var DefinitionAggregateInterface
-     */
-    protected $definitions;
-
-    /**
-     * @var ServiceProviderAggregateInterface
-     */
-    protected $providers;
-
-    /**
-     * @var InflectorAggregateInterface
-     */
-    protected $inflectors;
-
-    /**
-     * @var ContainerInterface[]
-     */
-    protected $delegates = [];
-
-    /**
-     * Construct.
-     *
-     * @param DefinitionAggregateInterface|null      $definitions
-     * @param ServiceProviderAggregateInterface|null $providers
-     * @param InflectorAggregateInterface|null       $inflectors
-     */
-    public function __construct(
-        ?DefinitionAggregateInterface      $definitions = null,
-        ?ServiceProviderAggregateInterface $providers = null,
-        ?InflectorAggregateInterface       $inflectors = null
-    ) {
-        $this->definitions = $definitions ?? new DefinitionAggregate;
-        $this->providers   = $providers   ?? new ServiceProviderAggregate;
-        $this->inflectors  = $inflectors  ?? new InflectorAggregate;
-
-        if ($this->definitions instanceof ContainerAwareInterface) {
-            $this->definitions->setLeagueContainer($this);
-        }
-
-        if ($this->providers instanceof ContainerAwareInterface) {
-            $this->providers->setLeagueContainer($this);
-        }
-
-        if ($this->inflectors instanceof ContainerAwareInterface) {
-            $this->inflectors->setLeagueContainer($this);
-        }
-    }
-
-    /**
-     * Add an item to the container.
-     *
-     * @param string  $id
-     * @param mixed   $concrete
-     * @param boolean $shared
-     *
-     * @return DefinitionInterface
-     */
-    public function add(string $id, $concrete = null, ?bool $shared = null) : DefinitionInterface
-    {
-        $concrete = $concrete ?? $id;
-        $shared = $shared ?? $this->defaultToShared;
-
-        return $this->definitions->add($id, $concrete, $shared);
-    }
-
-    /**
-     * Proxy to add with shared as true.
-     *
-     * @param string $id
-     * @param mixed  $concrete
-     *
-     * @return DefinitionInterface
-     */
-    public function share(string $id, $concrete = null) : DefinitionInterface
-    {
-        return $this->add($id, $concrete, true);
-    }
-
-    /**
-     * Whether the container should default to defining shared definitions.
-     *
-     * @param boolean $shared
-     *
-     * @return self
-     */
-    public function defaultToShared(bool $shared = true) : ContainerInterface
-    {
-        $this->defaultToShared = $shared;
-
-        return $this;
-    }
-
-    /**
-     * Get a definition to extend.
-     *
-     * @param string $id [description]
-     *
-     * @return DefinitionInterface
-     */
-    public function extend(string $id) : DefinitionInterface
-    {
-        if ($this->providers->provides($id)) {
-            $this->providers->register($id);
-        }
-
-        if ($this->definitions->has($id)) {
-            return $this->definitions->getDefinition($id);
-        }
-
-        throw new NotFoundException(
-            sprintf('Unable to extend alias (%s) as it is not being managed as a definition', $id)
-        );
-    }
-
-    /**
-     * Add a service provider.
-     *
-     * @param ServiceProviderInterface|string $provider
-     *
-     * @return self
-     */
-    public function addServiceProvider($provider) : self
-    {
-        $this->providers->add($provider);
-
-        return $this;
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function get($id, bool $new = false)
-    {
-        if ($this->definitions->has($id)) {
-            $resolved = $this->definitions->resolve($id, $new);
-            return $this->inflectors->inflect($resolved);
-        }
-
-        if ($this->definitions->hasTag($id)) {
-            $arrayOf = $this->definitions->resolveTagged($id, $new);
-
-            array_walk($arrayOf, function (&$resolved) {
-                $resolved = $this->inflectors->inflect($resolved);
-            });
-
-            return $arrayOf;
-        }
-
-        if ($this->providers->provides($id)) {
-            $this->providers->register($id);
-
-            if (!$this->definitions->has($id) && !$this->definitions->hasTag($id)) {
-                throw new ContainerException(sprintf('Service provider lied about providing (%s) service', $id));
-            }
-
-            return $this->get($id, $new);
-        }
-
-        foreach ($this->delegates as $delegate) {
-            if ($delegate->has($id)) {
-                $resolved = $delegate->get($id);
-                return $this->inflectors->inflect($resolved);
-            }
-        }
-
-        throw new NotFoundException(sprintf('Alias (%s) is not being managed by the container or delegates', $id));
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function has($id) : bool
-    {
-        if ($this->definitions->has($id)) {
-            return true;
-        }
-
-        if ($this->definitions->hasTag($id)) {
-            return true;
-        }
-
-        if ($this->providers->provides($id)) {
-            return true;
-        }
-
-        foreach ($this->delegates as $delegate) {
-            if ($delegate->has($id)) {
-                return true;
-            }
-        }
-
-        return false;
-    }
-
-    /**
-     * Allows for manipulation of specific types on resolution.
-     *
-     * @param string        $type
-     * @param callable|null $callback
-     *
-     * @return InflectorInterface
-     */
-    public function inflector(string $type, ?callable $callback = null) : InflectorInterface
-    {
-        return $this->inflectors->add($type, $callback);
-    }
-
-    /**
-     * Delegate a backup container to be checked for services if it
-     * cannot be resolved via this container.
-     *
-     * @param ContainerInterface $container
-     *
-     * @return self
-     */
-    public function delegate(ContainerInterface $container) : self
-    {
-        $this->delegates[] = $container;
-
-        if ($container instanceof ContainerAwareInterface) {
-            $container->setLeagueContainer($this);
-        }
-
-        return $this;
-    }
-}
diff --git a/plugins/woocommerce/lib/packages/League/Container/ContainerAwareInterface.php b/plugins/woocommerce/lib/packages/League/Container/ContainerAwareInterface.php
deleted file mode 100644
index 8314ba5a35..0000000000
--- a/plugins/woocommerce/lib/packages/League/Container/ContainerAwareInterface.php
+++ /dev/null
@@ -1,40 +0,0 @@
-<?php declare(strict_types=1);
-
-namespace Automattic\WooCommerce\Vendor\League\Container;
-
-use Automattic\WooCommerce\Vendor\Psr\Container\ContainerInterface;
-
-interface ContainerAwareInterface
-{
-    /**
-     * Set a container
-     *
-     * @param ContainerInterface $container
-     *
-     * @return self
-     */
-    public function setContainer(ContainerInterface $container) : ContainerAwareInterface;
-
-    /**
-     * Get the container
-     *
-     * @return ContainerInterface
-     */
-    public function getContainer() : ContainerInterface;
-
-    /**
-     * Set a container. This will be removed in favour of setContainer receiving Container in next major release.
-     *
-     * @param Container $container
-     *
-     * @return self
-     */
-    public function setLeagueContainer(Container $container) : self;
-
-    /**
-     * Get the container. This will be removed in favour of getContainer returning Container in next major release.
-     *
-     * @return Container
-     */
-    public function getLeagueContainer() : Container;
-}
diff --git a/plugins/woocommerce/lib/packages/League/Container/ContainerAwareTrait.php b/plugins/woocommerce/lib/packages/League/Container/ContainerAwareTrait.php
deleted file mode 100644
index 4f8d1be527..0000000000
--- a/plugins/woocommerce/lib/packages/League/Container/ContainerAwareTrait.php
+++ /dev/null
@@ -1,76 +0,0 @@
-<?php declare(strict_types=1);
-
-namespace Automattic\WooCommerce\Vendor\League\Container;
-
-use Automattic\WooCommerce\Vendor\League\Container\Exception\ContainerException;
-use Automattic\WooCommerce\Vendor\Psr\Container\ContainerInterface;
-
-trait ContainerAwareTrait
-{
-    /**
-     * @var ContainerInterface
-     */
-    protected $container;
-
-    /**
-     * @var Container
-     */
-    protected $leagueContainer;
-
-    /**
-     * Set a container.
-     *
-     * @param ContainerInterface $container
-     *
-     * @return ContainerAwareInterface
-     */
-    public function setContainer(ContainerInterface $container) : ContainerAwareInterface
-    {
-        $this->container = $container;
-
-        return $this;
-    }
-
-    /**
-     * Get the container.
-     *
-     * @return ContainerInterface
-     */
-    public function getContainer() : ContainerInterface
-    {
-        if ($this->container instanceof ContainerInterface) {
-            return $this->container;
-        }
-
-        throw new ContainerException('No container implementation has been set.');
-    }
-
-    /**
-     * Set a container.
-     *
-     * @param Container $container
-     *
-     * @return self
-     */
-    public function setLeagueContainer(Container $container) : ContainerAwareInterface
-    {
-        $this->container = $container;
-        $this->leagueContainer = $container;
-
-        return $this;
-    }
-
-    /**
-     * Get the container.
-     *
-     * @return Container
-     */
-    public function getLeagueContainer() : Container
-    {
-        if ($this->leagueContainer instanceof Container) {
-            return $this->leagueContainer;
-        }
-
-        throw new ContainerException('No container implementation has been set.');
-    }
-}
diff --git a/plugins/woocommerce/lib/packages/League/Container/Definition/Definition.php b/plugins/woocommerce/lib/packages/League/Container/Definition/Definition.php
deleted file mode 100644
index 98c2ee3696..0000000000
--- a/plugins/woocommerce/lib/packages/League/Container/Definition/Definition.php
+++ /dev/null
@@ -1,278 +0,0 @@
-<?php declare(strict_types=1);
-
-namespace Automattic\WooCommerce\Vendor\League\Container\Definition;
-
-use Automattic\WooCommerce\Vendor\League\Container\Argument\{
-    ArgumentResolverInterface, ArgumentResolverTrait, ClassNameInterface, RawArgumentInterface
-};
-use Automattic\WooCommerce\Vendor\League\Container\ContainerAwareTrait;
-use ReflectionClass;
-use ReflectionException;
-
-class Definition implements ArgumentResolverInterface, DefinitionInterface
-{
-    use ArgumentResolverTrait;
-    use ContainerAwareTrait;
-
-    /**
-     * @var string
-     */
-    protected $alias;
-
-    /**
-     * @var mixed
-     */
-    protected $concrete;
-
-    /**
-     * @var boolean
-     */
-    protected $shared = false;
-
-    /**
-     * @var array
-     */
-    protected $tags = [];
-
-    /**
-     * @var array
-     */
-    protected $arguments = [];
-
-    /**
-     * @var array
-     */
-    protected $methods = [];
-
-    /**
-     * @var mixed
-     */
-    protected $resolved;
-
-    /**
-     * Constructor.
-     *
-     * @param string $id
-     * @param mixed  $concrete
-     */
-    public function __construct(string $id, $concrete = null)
-    {
-        $concrete = $concrete ?? $id;
-
-        $this->alias    = $id;
-        $this->concrete = $concrete;
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function addTag(string $tag) : DefinitionInterface
-    {
-        $this->tags[$tag] = true;
-
-        return $this;
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function hasTag(string $tag) : bool
-    {
-        return isset($this->tags[$tag]);
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function setAlias(string $id) : DefinitionInterface
-    {
-        $this->alias = $id;
-
-        return $this;
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function getAlias() : string
-    {
-        return $this->alias;
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function setShared(bool $shared = true) : DefinitionInterface
-    {
-        $this->shared = $shared;
-
-        return $this;
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function isShared() : bool
-    {
-        return $this->shared;
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function getConcrete()
-    {
-        return $this->concrete;
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function setConcrete($concrete) : DefinitionInterface
-    {
-        $this->concrete = $concrete;
-        $this->resolved = null;
-
-        return $this;
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function addArgument($arg) : DefinitionInterface
-    {
-        $this->arguments[] = $arg;
-
-        return $this;
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function addArguments(array $args) : DefinitionInterface
-    {
-        foreach ($args as $arg) {
-            $this->addArgument($arg);
-        }
-
-        return $this;
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function addMethodCall(string $method, array $args = []) : DefinitionInterface
-    {
-        $this->methods[] = [
-            'method'    => $method,
-            'arguments' => $args
-        ];
-
-        return $this;
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function addMethodCalls(array $methods = []) : DefinitionInterface
-    {
-        foreach ($methods as $method => $args) {
-            $this->addMethodCall($method, $args);
-        }
-
-        return $this;
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function resolve(bool $new = false)
-    {
-        $concrete = $this->concrete;
-
-        if ($this->isShared() && $this->resolved !== null && $new === false) {
-            return $this->resolved;
-        }
-
-        if (is_callable($concrete)) {
-            $concrete = $this->resolveCallable($concrete);
-        }
-
-        if ($concrete instanceof RawArgumentInterface) {
-            $this->resolved = $concrete->getValue();
-
-            return $concrete->getValue();
-        }
-
-        if ($concrete instanceof ClassNameInterface) {
-            $concrete = $concrete->getClassName();
-        }
-
-        if (is_string($concrete) && class_exists($concrete)) {
-            $concrete = $this->resolveClass($concrete);
-        }
-
-        if (is_object($concrete)) {
-            $concrete = $this->invokeMethods($concrete);
-        }
-
-        if (is_string($concrete) && $this->getContainer()->has($concrete)) {
-            $concrete = $this->getContainer()->get($concrete);
-        }
-
-        $this->resolved = $concrete;
-
-        return $concrete;
-    }
-
-    /**
-     * Resolve a callable.
-     *
-     * @param callable $concrete
-     *
-     * @return mixed
-     */
-    protected function resolveCallable(callable $concrete)
-    {
-        $resolved = $this->resolveArguments($this->arguments);
-
-        return call_user_func_array($concrete, $resolved);
-    }
-
-    /**
-     * Resolve a class.
-     *
-     * @param string $concrete
-     *
-     * @return object
-     *
-     * @throws ReflectionException
-     */
-    protected function resolveClass(string $concrete)
-    {
-        $resolved   = $this->resolveArguments($this->arguments);
-        $reflection = new ReflectionClass($concrete);
-
-        return $reflection->newInstanceArgs($resolved);
-    }
-
-    /**
-     * Invoke methods on resolved instance.
-     *
-     * @param object $instance
-     *
-     * @return object
-     */
-    protected function invokeMethods($instance)
-    {
-        foreach ($this->methods as $method) {
-            $args = $this->resolveArguments($method['arguments']);
-
-            /** @var callable $callable */
-            $callable = [$instance, $method['method']];
-            call_user_func_array($callable, $args);
-        }
-
-        return $instance;
-    }
-}
diff --git a/plugins/woocommerce/lib/packages/League/Container/Definition/DefinitionAggregate.php b/plugins/woocommerce/lib/packages/League/Container/Definition/DefinitionAggregate.php
deleted file mode 100644
index 3e39b2fc20..0000000000
--- a/plugins/woocommerce/lib/packages/League/Container/Definition/DefinitionAggregate.php
+++ /dev/null
@@ -1,124 +0,0 @@
-<?php declare(strict_types=1);
-
-namespace Automattic\WooCommerce\Vendor\League\Container\Definition;
-
-use Generator;
-use Automattic\WooCommerce\Vendor\League\Container\ContainerAwareTrait;
-use Automattic\WooCommerce\Vendor\League\Container\Exception\NotFoundException;
-
-class DefinitionAggregate implements DefinitionAggregateInterface
-{
-    use ContainerAwareTrait;
-
-    /**
-     * @var DefinitionInterface[]
-     */
-    protected $definitions = [];
-
-    /**
-     * Construct.
-     *
-     * @param DefinitionInterface[] $definitions
-     */
-    public function __construct(array $definitions = [])
-    {
-        $this->definitions = array_filter($definitions, function ($definition) {
-            return ($definition instanceof DefinitionInterface);
-        });
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function add(string $id, $definition, bool $shared = false) : DefinitionInterface
-    {
-        if (!$definition instanceof DefinitionInterface) {
-            $definition = new Definition($id, $definition);
-        }
-
-        $this->definitions[] = $definition
-            ->setAlias($id)
-            ->setShared($shared)
-        ;
-
-        return $definition;
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function has(string $id) : bool
-    {
-        foreach ($this->getIterator() as $definition) {
-            if ($id === $definition->getAlias()) {
-                return true;
-            }
-        }
-
-        return false;
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function hasTag(string $tag) : bool
-    {
-        foreach ($this->getIterator() as $definition) {
-            if ($definition->hasTag($tag)) {
-                return true;
-            }
-        }
-
-        return false;
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function getDefinition(string $id) : DefinitionInterface
-    {
-        foreach ($this->getIterator() as $definition) {
-            if ($id === $definition->getAlias()) {
-                return $definition->setLeagueContainer($this->getLeagueContainer());
-            }
-        }
-
-        throw new NotFoundException(sprintf('Alias (%s) is not being handled as a definition.', $id));
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function resolve(string $id, bool $new = false)
-    {
-        return $this->getDefinition($id)->resolve($new);
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function resolveTagged(string $tag, bool $new = false) : array
-    {
-        $arrayOf = [];
-
-        foreach ($this->getIterator() as $definition) {
-            if ($definition->hasTag($tag)) {
-                $arrayOf[] = $definition->setLeagueContainer($this->getLeagueContainer())->resolve($new);
-            }
-        }
-
-        return $arrayOf;
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function getIterator() : Generator
-    {
-        $count = count($this->definitions);
-
-        for ($i = 0; $i < $count; $i++) {
-            yield $this->definitions[$i];
-        }
-    }
-}
diff --git a/plugins/woocommerce/lib/packages/League/Container/Definition/DefinitionAggregateInterface.php b/plugins/woocommerce/lib/packages/League/Container/Definition/DefinitionAggregateInterface.php
deleted file mode 100644
index 2d5842fe6b..0000000000
--- a/plugins/woocommerce/lib/packages/League/Container/Definition/DefinitionAggregateInterface.php
+++ /dev/null
@@ -1,67 +0,0 @@
-<?php declare(strict_types=1);
-
-namespace Automattic\WooCommerce\Vendor\League\Container\Definition;
-
-use IteratorAggregate;
-use Automattic\WooCommerce\Vendor\League\Container\ContainerAwareInterface;
-
-interface DefinitionAggregateInterface extends ContainerAwareInterface, IteratorAggregate
-{
-    /**
-     * Add a definition to the aggregate.
-     *
-     * @param string  $id
-     * @param mixed   $definition
-     * @param boolean $shared
-     *
-     * @return DefinitionInterface
-     */
-    public function add(string $id, $definition, bool $shared = false) : DefinitionInterface;
-
-    /**
-     * Checks whether alias exists as definition.
-     *
-     * @param string $id
-     *
-     * @return boolean
-     */
-    public function has(string $id) : bool;
-
-    /**
-     * Checks whether tag exists as definition.
-     *
-     * @param string $tag
-     *
-     * @return boolean
-     */
-    public function hasTag(string $tag) : bool;
-
-    /**
-     * Get the definition to be extended.
-     *
-     * @param string $id
-     *
-     * @return DefinitionInterface
-     */
-    public function getDefinition(string $id) : DefinitionInterface;
-
-    /**
-     * Resolve and build a concrete value from an id/alias.
-     *
-     * @param string  $id
-     * @param boolean $new
-     *
-     * @return mixed
-     */
-    public function resolve(string $id, bool $new = false);
-
-    /**
-     * Resolve and build an array of concrete values from a tag.
-     *
-     * @param string  $tag
-     * @param boolean $new
-     *
-     * @return mixed
-     */
-    public function resolveTagged(string $tag, bool $new = false);
-}
diff --git a/plugins/woocommerce/lib/packages/League/Container/Definition/DefinitionInterface.php b/plugins/woocommerce/lib/packages/League/Container/Definition/DefinitionInterface.php
deleted file mode 100644
index a42bfbad87..0000000000
--- a/plugins/woocommerce/lib/packages/League/Container/Definition/DefinitionInterface.php
+++ /dev/null
@@ -1,120 +0,0 @@
-<?php declare(strict_types=1);
-
-namespace Automattic\WooCommerce\Vendor\League\Container\Definition;
-
-use Automattic\WooCommerce\Vendor\League\Container\ContainerAwareInterface;
-
-interface DefinitionInterface extends ContainerAwareInterface
-{
-    /**
-     * Add a tag to the definition.
-     *
-     * @param string $tag
-     *
-     * @return self
-     */
-    public function addTag(string $tag) : DefinitionInterface;
-
-    /**
-     * Does the definition have a tag?
-     *
-     * @param string $tag
-     *
-     * @return boolean
-     */
-    public function hasTag(string $tag) : bool;
-
-    /**
-     * Set the alias of the definition.
-     *
-     * @param string $id
-     *
-     * @return DefinitionInterface
-     */
-    public function setAlias(string $id) : DefinitionInterface;
-
-    /**
-     * Get the alias of the definition.
-     *
-     * @return string
-     */
-    public function getAlias() : string;
-
-    /**
-     * Set whether this is a shared definition.
-     *
-     * @param boolean $shared
-     *
-     * @return self
-     */
-    public function setShared(bool $shared) : DefinitionInterface;
-
-    /**
-     * Is this a shared definition?
-     *
-     * @return boolean
-     */
-    public function isShared() : bool;
-
-    /**
-     * Get the concrete of the definition.
-     *
-     * @return mixed
-     */
-    public function getConcrete();
-
-    /**
-     * Set the concrete of the definition.
-     *
-     * @param mixed $concrete
-     *
-     * @return DefinitionInterface
-     */
-    public function setConcrete($concrete) : DefinitionInterface;
-
-    /**
-     * Add an argument to be injected.
-     *
-     * @param mixed $arg
-     *
-     * @return self
-     */
-    public function addArgument($arg) : DefinitionInterface;
-
-    /**
-     * Add multiple arguments to be injected.
-     *
-     * @param array $args
-     *
-     * @return self
-     */
-    public function addArguments(array $args) : DefinitionInterface;
-
-    /**
-     * Add a method to be invoked
-     *
-     * @param string $method
-     * @param array  $args
-     *
-     * @return self
-     */
-    public function addMethodCall(string $method, array $args = []) : DefinitionInterface;
-
-    /**
-     * Add multiple methods to be invoked
-     *
-     * @param array $methods
-     *
-     * @return self
-     */
-    public function addMethodCalls(array $methods = []) : DefinitionInterface;
-
-    /**
-     * Handle instantiation and manipulation of value and return.
-     *
-     * @param boolean $new
-     *
-     * @return mixed
-     */
-    public function resolve(bool $new = false);
-}
diff --git a/plugins/woocommerce/lib/packages/League/Container/Exception/ContainerException.php b/plugins/woocommerce/lib/packages/League/Container/Exception/ContainerException.php
deleted file mode 100644
index 8b9adfa0f7..0000000000
--- a/plugins/woocommerce/lib/packages/League/Container/Exception/ContainerException.php
+++ /dev/null
@@ -1,10 +0,0 @@
-<?php
-
-namespace Automattic\WooCommerce\Vendor\League\Container\Exception;
-
-use Automattic\WooCommerce\Vendor\Psr\Container\ContainerExceptionInterface;
-use RuntimeException;
-
-class ContainerException extends RuntimeException implements ContainerExceptionInterface
-{
-}
diff --git a/plugins/woocommerce/lib/packages/League/Container/Exception/NotFoundException.php b/plugins/woocommerce/lib/packages/League/Container/Exception/NotFoundException.php
deleted file mode 100644
index 97376f11c2..0000000000
--- a/plugins/woocommerce/lib/packages/League/Container/Exception/NotFoundException.php
+++ /dev/null
@@ -1,10 +0,0 @@
-<?php
-
-namespace Automattic\WooCommerce\Vendor\League\Container\Exception;
-
-use Automattic\WooCommerce\Vendor\Psr\Container\NotFoundExceptionInterface;
-use InvalidArgumentException;
-
-class NotFoundException extends InvalidArgumentException implements NotFoundExceptionInterface
-{
-}
diff --git a/plugins/woocommerce/lib/packages/League/Container/Inflector/Inflector.php b/plugins/woocommerce/lib/packages/League/Container/Inflector/Inflector.php
deleted file mode 100644
index 90a68ec7a0..0000000000
--- a/plugins/woocommerce/lib/packages/League/Container/Inflector/Inflector.php
+++ /dev/null
@@ -1,123 +0,0 @@
-<?php declare(strict_types=1);
-
-namespace Automattic\WooCommerce\Vendor\League\Container\Inflector;
-
-use Automattic\WooCommerce\Vendor\League\Container\Argument\ArgumentResolverInterface;
-use Automattic\WooCommerce\Vendor\League\Container\Argument\ArgumentResolverTrait;
-use Automattic\WooCommerce\Vendor\League\Container\ContainerAwareTrait;
-
-class Inflector implements ArgumentResolverInterface, InflectorInterface
-{
-    use ArgumentResolverTrait;
-    use ContainerAwareTrait;
-
-    /**
-     * @var string
-     */
-    protected $type;
-
-    /**
-     * @var callable|null
-     */
-    protected $callback;
-
-    /**
-     * @var array
-     */
-    protected $methods = [];
-
-    /**
-     * @var array
-     */
-    protected $properties = [];
-
-    /**
-     * Construct.
-     *
-     * @param string        $type
-     * @param callable|null $callback
-     */
-    public function __construct(string $type, ?callable $callback = null)
-    {
-        $this->type     = $type;
-        $this->callback = $callback;
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function getType() : string
-    {
-        return $this->type;
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function invokeMethod(string $name, array $args) : InflectorInterface
-    {
-        $this->methods[$name] = $args;
-
-        return $this;
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function invokeMethods(array $methods) : InflectorInterface
-    {
-        foreach ($methods as $name => $args) {
-            $this->invokeMethod($name, $args);
-        }
-
-        return $this;
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function setProperty(string $property, $value) : InflectorInterface
-    {
-        $this->properties[$property] = $this->resolveArguments([$value])[0];
-
-        return $this;
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function setProperties(array $properties) : InflectorInterface
-    {
-        foreach ($properties as $property => $value) {
-            $this->setProperty($property, $value);
-        }
-
-        return $this;
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function inflect($object)
-    {
-        $properties = $this->resolveArguments(array_values($this->properties));
-        $properties = array_combine(array_keys($this->properties), $properties);
-
-        // array_combine() can technically return false
-        foreach ($properties ?: [] as $property => $value) {
-            $object->{$property} = $value;
-        }
-
-        foreach ($this->methods as $method => $args) {
-            $args = $this->resolveArguments($args);
-
-            /** @var callable $callable */
-            $callable = [$object, $method];
-            call_user_func_array($callable, $args);
-        }
-
-        if ($this->callback !== null) {
-            call_user_func($this->callback, $object);
-        }
-    }
-}
diff --git a/plugins/woocommerce/lib/packages/League/Container/Inflector/InflectorAggregate.php b/plugins/woocommerce/lib/packages/League/Container/Inflector/InflectorAggregate.php
deleted file mode 100644
index 70045c29cd..0000000000
--- a/plugins/woocommerce/lib/packages/League/Container/Inflector/InflectorAggregate.php
+++ /dev/null
@@ -1,58 +0,0 @@
-<?php declare(strict_types=1);
-
-namespace Automattic\WooCommerce\Vendor\League\Container\Inflector;
-
-use Generator;
-use Automattic\WooCommerce\Vendor\League\Container\ContainerAwareTrait;
-
-class InflectorAggregate implements InflectorAggregateInterface
-{
-    use ContainerAwareTrait;
-
-    /**
-     * @var Inflector[]
-     */
-    protected $inflectors = [];
-
-    /**
-     * {@inheritdoc}
-     */
-    public function add(string $type, ?callable $callback = null) : Inflector
-    {
-        $inflector          = new Inflector($type, $callback);
-        $this->inflectors[] = $inflector;
-
-        return $inflector;
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function getIterator() : Generator
-    {
-        $count = count($this->inflectors);
-
-        for ($i = 0; $i < $count; $i++) {
-            yield $this->inflectors[$i];
-        }
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function inflect($object)
-    {
-        foreach ($this->getIterator() as $inflector) {
-            $type = $inflector->getType();
-
-            if (! $object instanceof $type) {
-                continue;
-            }
-
-            $inflector->setLeagueContainer($this->getLeagueContainer());
-            $inflector->inflect($object);
-        }
-
-        return $object;
-    }
-}
diff --git a/plugins/woocommerce/lib/packages/League/Container/Inflector/InflectorAggregateInterface.php b/plugins/woocommerce/lib/packages/League/Container/Inflector/InflectorAggregateInterface.php
deleted file mode 100644
index 78e2b6e6bd..0000000000
--- a/plugins/woocommerce/lib/packages/League/Container/Inflector/InflectorAggregateInterface.php
+++ /dev/null
@@ -1,27 +0,0 @@
-<?php declare(strict_types=1);
-
-namespace Automattic\WooCommerce\Vendor\League\Container\Inflector;
-
-use IteratorAggregate;
-use Automattic\WooCommerce\Vendor\League\Container\ContainerAwareInterface;
-
-interface InflectorAggregateInterface extends ContainerAwareInterface, IteratorAggregate
-{
-    /**
-     * Add an inflector to the aggregate.
-     *
-     * @param string   $type
-     * @param callable $callback
-     *
-     * @return Inflector
-     */
-    public function add(string $type, ?callable $callback = null) : Inflector;
-
-    /**
-     * Applies all inflectors to an object.
-     *
-     * @param  object $object
-     * @return object
-     */
-    public function inflect($object);
-}
diff --git a/plugins/woocommerce/lib/packages/League/Container/Inflector/InflectorInterface.php b/plugins/woocommerce/lib/packages/League/Container/Inflector/InflectorInterface.php
deleted file mode 100644
index 80b8b2d0c5..0000000000
--- a/plugins/woocommerce/lib/packages/League/Container/Inflector/InflectorInterface.php
+++ /dev/null
@@ -1,60 +0,0 @@
-<?php declare(strict_types=1);
-
-namespace Automattic\WooCommerce\Vendor\League\Container\Inflector;
-
-interface InflectorInterface
-{
-    /**
-     * Get the type.
-     *
-     * @return string
-     */
-    public function getType() : string;
-
-    /**
-     * Defines a method to be invoked on the subject object.
-     *
-     * @param string $name
-     * @param array  $args
-     *
-     * @return self
-     */
-    public function invokeMethod(string $name, array $args) : InflectorInterface;
-
-    /**
-     * Defines multiple methods to be invoked on the subject object.
-     *
-     * @param array $methods
-     *
-     * @return self
-     */
-    public function invokeMethods(array $methods) : InflectorInterface;
-
-    /**
-     * Defines a property to be set on the subject object.
-     *
-     * @param string $property
-     * @param mixed  $value
-     *
-     * @return self
-     */
-    public function setProperty(string $property, $value) : InflectorInterface;
-
-    /**
-     * Defines multiple properties to be set on the subject object.
-     *
-     * @param array $properties
-     *
-     * @return self
-     */
-    public function setProperties(array $properties) : InflectorInterface;
-
-    /**
-     * Apply inflections to an object.
-     *
-     * @param object $object
-     *
-     * @return void
-     */
-    public function inflect($object);
-}
diff --git a/plugins/woocommerce/lib/packages/League/Container/ReflectionContainer.php b/plugins/woocommerce/lib/packages/League/Container/ReflectionContainer.php
deleted file mode 100644
index 65997f2f84..0000000000
--- a/plugins/woocommerce/lib/packages/League/Container/ReflectionContainer.php
+++ /dev/null
@@ -1,125 +0,0 @@
-<?php declare(strict_types=1);
-
-namespace Automattic\WooCommerce\Vendor\League\Container;
-
-use Automattic\WooCommerce\Vendor\League\Container\Argument\{ArgumentResolverInterface, ArgumentResolverTrait};
-use Automattic\WooCommerce\Vendor\League\Container\Exception\NotFoundException;
-use Automattic\WooCommerce\Vendor\Psr\Container\ContainerInterface;
-use ReflectionClass;
-use ReflectionException;
-use ReflectionFunction;
-use ReflectionMethod;
-
-class ReflectionContainer implements ArgumentResolverInterface, ContainerInterface
-{
-    use ArgumentResolverTrait;
-    use ContainerAwareTrait;
-
-    /**
-     * @var boolean
-     */
-    protected $cacheResolutions = false;
-
-    /**
-     * Cache of resolutions.
-     *
-     * @var array
-     */
-    protected $cache = [];
-
-    /**
-     * {@inheritdoc}
-     *
-     * @throws ReflectionException
-     */
-    public function get($id, array $args = [])
-    {
-        if ($this->cacheResolutions === true && array_key_exists($id, $this->cache)) {
-            return $this->cache[$id];
-        }
-
-        if (! $this->has($id)) {
-            throw new NotFoundException(
-                sprintf('Alias (%s) is not an existing class and therefore cannot be resolved', $id)
-            );
-        }
-
-        $reflector = new ReflectionClass($id);
-        $construct = $reflector->getConstructor();
-
-        $resolution = $construct === null
-            ? new $id
-            : $resolution = $reflector->newInstanceArgs($this->reflectArguments($construct, $args))
-        ;
-
-        if ($this->cacheResolutions === true) {
-            $this->cache[$id] = $resolution;
-        }
-
-        return $resolution;
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function has($id) : bool
-    {
-        return class_exists($id);
-    }
-
-    /**
-     * Invoke a callable via the container.
-     *
-     * @param callable $callable
-     * @param array    $args
-     *
-     * @return mixed
-     *
-     * @throws ReflectionException
-     */
-    public function call(callable $callable, array $args = [])
-    {
-        if (is_string($callable) && strpos($callable, '::') !== false) {
-            $callable = explode('::', $callable);
-        }
-
-        if (is_array($callable)) {
-            if (is_string($callable[0])) {
-                $callable[0] = $this->getContainer()->get($callable[0]);
-            }
-
-            $reflection = new ReflectionMethod($callable[0], $callable[1]);
-
-            if ($reflection->isStatic()) {
-                $callable[0] = null;
-            }
-
-            return $reflection->invokeArgs($callable[0], $this->reflectArguments($reflection, $args));
-        }
-
-        if (is_object($callable)) {
-            $reflection = new ReflectionMethod($callable, '__invoke');
-
-            return $reflection->invokeArgs($callable, $this->reflectArguments($reflection, $args));
-        }
-
-        $reflection = new ReflectionFunction(\Closure::fromCallable($callable));
-
-        return $reflection->invokeArgs($this->reflectArguments($reflection, $args));
-    }
-
-    /**
-     * Whether the container should default to caching resolutions and returning
-     * the cache on following calls.
-     *
-     * @param boolean $option
-     *
-     * @return self
-     */
-    public function cacheResolutions(bool $option = true) : ContainerInterface
-    {
-        $this->cacheResolutions = $option;
-
-        return $this;
-    }
-}
diff --git a/plugins/woocommerce/lib/packages/League/Container/ServiceProvider/AbstractServiceProvider.php b/plugins/woocommerce/lib/packages/League/Container/ServiceProvider/AbstractServiceProvider.php
deleted file mode 100644
index ed6af441f8..0000000000
--- a/plugins/woocommerce/lib/packages/League/Container/ServiceProvider/AbstractServiceProvider.php
+++ /dev/null
@@ -1,46 +0,0 @@
-<?php declare(strict_types=1);
-
-namespace Automattic\WooCommerce\Vendor\League\Container\ServiceProvider;
-
-use Automattic\WooCommerce\Vendor\League\Container\ContainerAwareTrait;
-
-abstract class AbstractServiceProvider implements ServiceProviderInterface
-{
-    use ContainerAwareTrait;
-
-    /**
-     * @var array
-     */
-    protected $provides = [];
-
-    /**
-     * @var string
-     */
-    protected $identifier;
-
-    /**
-     * {@inheritdoc}
-     */
-    public function provides(string $alias) : bool
-    {
-        return in_array($alias, $this->provides, true);
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function setIdentifier(string $id) : ServiceProviderInterface
-    {
-        $this->identifier = $id;
-
-        return $this;
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function getIdentifier() : string
-    {
-        return $this->identifier ?? get_class($this);
-    }
-}
diff --git a/plugins/woocommerce/lib/packages/League/Container/ServiceProvider/BootableServiceProviderInterface.php b/plugins/woocommerce/lib/packages/League/Container/ServiceProvider/BootableServiceProviderInterface.php
deleted file mode 100644
index 195b48a14a..0000000000
--- a/plugins/woocommerce/lib/packages/League/Container/ServiceProvider/BootableServiceProviderInterface.php
+++ /dev/null
@@ -1,14 +0,0 @@
-<?php declare(strict_types=1);
-
-namespace Automattic\WooCommerce\Vendor\League\Container\ServiceProvider;
-
-interface BootableServiceProviderInterface extends ServiceProviderInterface
-{
-    /**
-     * Method will be invoked on registration of a service provider implementing
-     * this interface. Provides ability for eager loading of Service Providers.
-     *
-     * @return void
-     */
-    public function boot();
-}
diff --git a/plugins/woocommerce/lib/packages/League/Container/ServiceProvider/ServiceProviderAggregate.php b/plugins/woocommerce/lib/packages/League/Container/ServiceProvider/ServiceProviderAggregate.php
deleted file mode 100644
index bb944976c1..0000000000
--- a/plugins/woocommerce/lib/packages/League/Container/ServiceProvider/ServiceProviderAggregate.php
+++ /dev/null
@@ -1,106 +0,0 @@
-<?php declare(strict_types=1);
-
-namespace Automattic\WooCommerce\Vendor\League\Container\ServiceProvider;
-
-use Generator;
-use Automattic\WooCommerce\Vendor\League\Container\{ContainerAwareInterface, ContainerAwareTrait};
-use Automattic\WooCommerce\Vendor\League\Container\Exception\ContainerException;
-
-class ServiceProviderAggregate implements ServiceProviderAggregateInterface
-{
-    use ContainerAwareTrait;
-
-    /**
-     * @var ServiceProviderInterface[]
-     */
-    protected $providers = [];
-
-    /**
-     * @var array
-     */
-    protected $registered = [];
-
-    /**
-     * {@inheritdoc}
-     */
-    public function add($provider) : ServiceProviderAggregateInterface
-    {
-        if (is_string($provider) && $this->getContainer()->has($provider)) {
-            $provider = $this->getContainer()->get($provider);
-        } elseif (is_string($provider) && class_exists($provider)) {
-            $provider = new $provider;
-        }
-
-        if (in_array($provider, $this->providers, true)) {
-            return $this;
-        }
-
-        if ($provider instanceof ContainerAwareInterface) {
-            $provider->setLeagueContainer($this->getLeagueContainer());
-        }
-
-        if ($provider instanceof BootableServiceProviderInterface) {
-            $provider->boot();
-        }
-
-        if ($provider instanceof ServiceProviderInterface) {
-            $this->providers[] = $provider;
-
-            return $this;
-        }
-
-        throw new ContainerException(
-            'A service provider must be a fully qualified class name or instance ' .
-            'of (\Automattic\WooCommerce\Vendor\League\Container\ServiceProvider\ServiceProviderInterface)'
-        );
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function provides(string $service) : bool
-    {
-        foreach ($this->getIterator() as $provider) {
-            if ($provider->provides($service)) {
-                return true;
-            }
-        }
-
-        return false;
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function getIterator() : Generator
-    {
-        $count = count($this->providers);
-
-        for ($i = 0; $i < $count; $i++) {
-            yield $this->providers[$i];
-        }
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function register(string $service)
-    {
-        if (false === $this->provides($service)) {
-            throw new ContainerException(
-                sprintf('(%s) is not provided by a service provider', $service)
-            );
-        }
-
-        foreach ($this->getIterator() as $provider) {
-            if (in_array($provider->getIdentifier(), $this->registered, true)) {
-                continue;
-            }
-
-            if ($provider->provides($service)) {
-                $this->registered[] = $provider->getIdentifier();
-                $provider->register();
-            }
-        }
-    }
-}
diff --git a/plugins/woocommerce/lib/packages/League/Container/ServiceProvider/ServiceProviderAggregateInterface.php b/plugins/woocommerce/lib/packages/League/Container/ServiceProvider/ServiceProviderAggregateInterface.php
deleted file mode 100644
index c2f61d6d87..0000000000
--- a/plugins/woocommerce/lib/packages/League/Container/ServiceProvider/ServiceProviderAggregateInterface.php
+++ /dev/null
@@ -1,36 +0,0 @@
-<?php declare(strict_types=1);
-
-namespace Automattic\WooCommerce\Vendor\League\Container\ServiceProvider;
-
-use IteratorAggregate;
-use Automattic\WooCommerce\Vendor\League\Container\ContainerAwareInterface;
-
-interface ServiceProviderAggregateInterface extends ContainerAwareInterface, IteratorAggregate
-{
-    /**
-     * Add a service provider to the aggregate.
-     *
-     * @param string|ServiceProviderInterface $provider
-     *
-     * @return self
-     */
-    public function add($provider) : ServiceProviderAggregateInterface;
-
-    /**
-     * Determines whether a service is provided by the aggregate.
-     *
-     * @param string $service
-     *
-     * @return boolean
-     */
-    public function provides(string $service) : bool;
-
-    /**
-     * Invokes the register method of a provider that provides a specific service.
-     *
-     * @param string $service
-     *
-     * @return void
-     */
-    public function register(string $service);
-}
diff --git a/plugins/woocommerce/lib/packages/League/Container/ServiceProvider/ServiceProviderInterface.php b/plugins/woocommerce/lib/packages/League/Container/ServiceProvider/ServiceProviderInterface.php
deleted file mode 100644
index 72f13a1e8c..0000000000
--- a/plugins/woocommerce/lib/packages/League/Container/ServiceProvider/ServiceProviderInterface.php
+++ /dev/null
@@ -1,46 +0,0 @@
-<?php declare(strict_types=1);
-
-namespace Automattic\WooCommerce\Vendor\League\Container\ServiceProvider;
-
-use Automattic\WooCommerce\Vendor\League\Container\ContainerAwareInterface;
-
-interface ServiceProviderInterface extends ContainerAwareInterface
-{
-    /**
-     * Returns a boolean if checking whether this provider provides a specific
-     * service or returns an array of provided services if no argument passed.
-     *
-     * @param string $service
-     *
-     * @return boolean
-     */
-    public function provides(string $service) : bool;
-
-    /**
-     * Use the register method to register items with the container via the
-     * protected $this->leagueContainer property or the `getLeagueContainer` method
-     * from the ContainerAwareTrait.
-     *
-     * @return void
-     */
-    public function register();
-
-    /**
-     * Set a custom id for the service provider. This enables
-     * registering the same service provider multiple times.
-     *
-     * @param string $id
-     *
-     * @return self
-     */
-    public function setIdentifier(string $id) : ServiceProviderInterface;
-
-    /**
-     * The id of the service provider uniquely identifies it, so
-     * that we can quickly determine if it has already been registered.
-     * Defaults to get_class($provider).
-     *
-     * @return string
-     */
-    public function getIdentifier() : string;
-}
diff --git a/plugins/woocommerce/src/Container.php b/plugins/woocommerce/src/Container.php
index d603f0fc31..9ccefdb106 100644
--- a/plugins/woocommerce/src/Container.php
+++ b/plugins/woocommerce/src/Container.php
@@ -7,44 +7,8 @@ declare( strict_types=1 );

 namespace Automattic\WooCommerce;

-use Automattic\WooCommerce\Admin\Features\Features;
 use Automattic\WooCommerce\Internal\DependencyManagement\ContainerException;
-use Automattic\WooCommerce\Internal\DependencyManagement\ExtendedContainer;
 use Automattic\WooCommerce\Internal\DependencyManagement\RuntimeContainer;
-use Automattic\WooCommerce\Internal\DependencyManagement\ServiceProviders\AddressProviderServiceProvider;
-use Automattic\WooCommerce\Internal\DependencyManagement\ServiceProviders\AdminSettingsServiceProvider;
-use Automattic\WooCommerce\Internal\DependencyManagement\ServiceProviders\CostOfGoodsSoldServiceProvider;
-use Automattic\WooCommerce\Internal\DependencyManagement\ServiceProviders\COTMigrationServiceProvider;
-use Automattic\WooCommerce\Internal\DependencyManagement\ServiceProviders\DownloadPermissionsAdjusterServiceProvider;
-use Automattic\WooCommerce\Internal\DependencyManagement\ServiceProviders\AssignDefaultCategoryServiceProvider;
-use Automattic\WooCommerce\Internal\DependencyManagement\ServiceProviders\EmailPreviewServiceProvider;
-use Automattic\WooCommerce\Internal\DependencyManagement\ServiceProviders\EnginesServiceProvider;
-use Automattic\WooCommerce\Internal\DependencyManagement\ServiceProviders\FeaturesServiceProvider;
-use Automattic\WooCommerce\Internal\DependencyManagement\ServiceProviders\LoggingServiceProvider;
-use Automattic\WooCommerce\Internal\DependencyManagement\ServiceProviders\MarketingServiceProvider;
-use Automattic\WooCommerce\Internal\DependencyManagement\ServiceProviders\MarketplaceServiceProvider;
-use Automattic\WooCommerce\Internal\DependencyManagement\ServiceProviders\OrdersControllersServiceProvider;
-use Automattic\WooCommerce\Internal\DependencyManagement\ServiceProviders\OrderAdminServiceProvider;
-use Automattic\WooCommerce\Internal\DependencyManagement\ServiceProviders\OrderMetaBoxServiceProvider;
-use Automattic\WooCommerce\Internal\DependencyManagement\ServiceProviders\ObjectCacheServiceProvider;
-use Automattic\WooCommerce\Internal\DependencyManagement\ServiceProviders\OrdersDataStoreServiceProvider;
-use Automattic\WooCommerce\Internal\DependencyManagement\ServiceProviders\OptionSanitizerServiceProvider;
-use Automattic\WooCommerce\Internal\DependencyManagement\ServiceProviders\OrderAttributionServiceProvider;
-use Automattic\WooCommerce\Internal\DependencyManagement\ServiceProviders\ProductAttributesLookupServiceProvider;
-use Automattic\WooCommerce\Internal\DependencyManagement\ServiceProviders\ProductDownloadsServiceProvider;
-use Automattic\WooCommerce\Internal\DependencyManagement\ServiceProviders\ProductImageBySKUServiceProvider;
-use Automattic\WooCommerce\Internal\DependencyManagement\ServiceProviders\ProductReviewsServiceProvider;
-use Automattic\WooCommerce\Internal\DependencyManagement\ServiceProviders\ProxiesServiceProvider;
-use Automattic\WooCommerce\Internal\DependencyManagement\ServiceProviders\RestockRefundedItemsAdjusterServiceProvider;
-use Automattic\WooCommerce\Internal\DependencyManagement\ServiceProviders\AdminSuggestionsServiceProvider;
-use Automattic\WooCommerce\Internal\DependencyManagement\ServiceProviders\UtilsClassesServiceProvider;
-use Automattic\WooCommerce\Internal\DependencyManagement\ServiceProviders\BatchProcessingServiceProvider;
-use Automattic\WooCommerce\Internal\DependencyManagement\ServiceProviders\LayoutTemplatesServiceProvider;
-use Automattic\WooCommerce\Internal\DependencyManagement\ServiceProviders\ComingSoonServiceProvider;
-use Automattic\WooCommerce\Internal\DependencyManagement\ServiceProviders\StatsServiceProvider;
-use Automattic\WooCommerce\Internal\DependencyManagement\ServiceProviders\ImportExportServiceProvider;
-use Automattic\WooCommerce\Internal\DependencyManagement\ServiceProviders\EmailEditorServiceProvider;
-use Automattic\WooCommerce\Internal\DependencyManagement\ServiceProviders\ProductFiltersServiceProvider;

 /**
  * PSR11 compliant dependency injection container for WooCommerce.
@@ -59,14 +23,10 @@ use Automattic\WooCommerce\Internal\DependencyManagement\ServiceProviders\Produc
  * Classes in the `includes` directory should use the `wc_get_container` function to get the instance of the container when
  * they need to get an instance of a class from the `src` directory.
  *
- * Class registration should be done via service providers that inherit from Automattic\WooCommerce\Internal\DependencyManagement
- * and those should go in the `src\Internal\DependencyManagement\ServiceProviders` folder unless there's a good reason
- * to put them elsewhere. All the service provider class names must be in the `SERVICE_PROVIDERS` constant.
- *
- * IMPORTANT NOTE: By default an instance of RuntimeContainer will be used as the underlying container,
- * but it's possible to use the old ExtendedContainer (backed by the PHP League's container package) instead,
- * see RuntimeContainer::should_use() for configuration instructions.
- * The League's container, the ExtendedContainer class and the related support code will be removed in WooCommerce 10.0.
+ * Internally, an instance of RuntimeContainer will be used for the actual class resolution. This class uses reflection
+ * to instantiate classes and figure out dependencies, so there's no need for explicit class registration.
+ * When running the unit tests suite this will be replaced with an instance of TestingContainer,
+ * which provides additional functionality.
  */
 final class Container {
 	/**
@@ -80,43 +40,26 @@ final class Container {
 	 * Class constructor.
 	 */
 	public function __construct() {
-		if ( RuntimeContainer::should_use() ) {
-			// When the League container was in use we allowed to retrieve the container itself
-			// by using 'Psr\Container\ContainerInterface' as the class identifier,
-			// we continue allowing that for compatibility.
-			$this->container = new RuntimeContainer(
-				array(
-					__CLASS__                          => $this,
-					'Psr\Container\ContainerInterface' => $this,
-				)
-			);
-			return;
-		}
-
-		$this->container = new ExtendedContainer();
-
-		// Add ourselves as the shared instance of ContainerInterface,
-		// register everything else using service providers.
-
-		$this->container->share( __CLASS__, $this );
-
-		foreach ( $this->get_service_providers() as $service_provider_class ) {
-			$this->container->addServiceProvider( $service_provider_class );
-		}
+		// When the League container was in use we allowed to retrieve the container itself
+		// by using 'Psr\Container\ContainerInterface' as the class identifier,
+		// we continue allowing that for compatibility.
+		$this->container = new RuntimeContainer(
+			array(
+				__CLASS__                          => $this,
+				'Psr\Container\ContainerInterface' => $this,
+			)
+		);
 	}

 	/**
-	 * Finds an entry of the container by its identifier and returns it.
+	 * Returns an instance of the specified class.
 	 * See the comment about ContainerException in RuntimeContainer::get.
 	 *
-	 * @template T
-	 * @param string|class-string<T> $id Identifier of the entry to look for.
+	 * @param string $id Class name.
 	 *
-	 * @return T Resolved entry.
+	 * @return object Object instance.
 	 *
-	 * @throws NotFoundExceptionInterface No entry was found for the supplied identifier (only when using ExtendedContainer).
-	 * @throws Psr\Container\ContainerExceptionInterface Error while retrieving the entry.
-	 * @throws ContainerException Error when resolving the class to an object instance, or (when using RuntimeContainer) class not found.
+	 * @throws ContainerException Error when resolving the class to an object instance, or class not found.
 	 * @throws \Exception Exception thrown in the constructor or in the 'init' method of one of the resolved classes.
 	 */
 	public function get( string $id ) {
@@ -124,61 +67,14 @@ final class Container {
 	}

 	/**
-	 * Returns true if the container can return an entry for the given identifier.
-	 * Returns false otherwise.
-	 *
-	 * `has($id)` returning true does not mean that `get($id)` will not throw an exception.
-	 * It does however mean that `get($id)` will not throw a `NotFoundExceptionInterface`.
+	 * Returns true if the container can return an instance of the given class or false otherwise.
+	 * See the comment in RuntimeContainer::has.
 	 *
-	 * @param class-string $id Identifier of the entry to look for.
+	 * @param class-string $id Class name.
 	 *
 	 * @return bool
 	 */
 	public function has( string $id ): bool {
 		return $this->container->has( $id );
 	}
-
-	/**
-	 * The list of service provider classes to register.
-	 *
-	 * @return array<int,class-string>
-	 */
-	private function get_service_providers(): array {
-		return array(
-			AssignDefaultCategoryServiceProvider::class,
-			DownloadPermissionsAdjusterServiceProvider::class,
-			EmailPreviewServiceProvider::class,
-			OptionSanitizerServiceProvider::class,
-			OrdersDataStoreServiceProvider::class,
-			ProductAttributesLookupServiceProvider::class,
-			ProductDownloadsServiceProvider::class,
-			ProductImageBySKUServiceProvider::class,
-			ProductReviewsServiceProvider::class,
-			ProxiesServiceProvider::class,
-			RestockRefundedItemsAdjusterServiceProvider::class,
-			UtilsClassesServiceProvider::class,
-			COTMigrationServiceProvider::class,
-			OrdersControllersServiceProvider::class,
-			OrderAttributionServiceProvider::class,
-			ObjectCacheServiceProvider::class,
-			BatchProcessingServiceProvider::class,
-			OrderMetaBoxServiceProvider::class,
-			OrderAdminServiceProvider::class,
-			FeaturesServiceProvider::class,
-			MarketingServiceProvider::class,
-			MarketplaceServiceProvider::class,
-			LayoutTemplatesServiceProvider::class,
-			LoggingServiceProvider::class,
-			EnginesServiceProvider::class,
-			ComingSoonServiceProvider::class,
-			StatsServiceProvider::class,
-			ImportExportServiceProvider::class,
-			CostOfGoodsSoldServiceProvider::class,
-			AdminSettingsServiceProvider::class,
-			AdminSuggestionsServiceProvider::class,
-			EmailEditorServiceProvider::class,
-			ProductFiltersServiceProvider::class,
-			AddressProviderServiceProvider::class,
-		);
-	}
 }
diff --git a/plugins/woocommerce/src/Internal/DependencyManagement/AbstractServiceProvider.php b/plugins/woocommerce/src/Internal/DependencyManagement/AbstractServiceProvider.php
deleted file mode 100644
index a89f23a23a..0000000000
--- a/plugins/woocommerce/src/Internal/DependencyManagement/AbstractServiceProvider.php
+++ /dev/null
@@ -1,168 +0,0 @@
-<?php
-/**
- * AbstractServiceProvider class file.
- */
-
-namespace Automattic\WooCommerce\Internal\DependencyManagement;
-
-use Automattic\WooCommerce\Vendor\League\Container\Argument\RawArgument;
-use Automattic\WooCommerce\Vendor\League\Container\Definition\DefinitionInterface;
-use Automattic\WooCommerce\Vendor\League\Container\ServiceProvider\AbstractServiceProvider as BaseServiceProvider;
-
-/**
- * Base class for the service providers used to register classes in the container.
- *
- * See the documentation of the original class this one is based on (https://container.thephpleague.com/3.x/service-providers)
- * for basic usage details. What this class adds is:
- *
- * - The `add_with_auto_arguments` method that allows to register classes without having to specify the injection method arguments.
- * - The `share_with_auto_arguments` method, sibling of the above.
- * - Convenience `add` and `share` methods that are just proxies for the same methods in `$this->getContainer()`.
- *
- * Note that `AbstractInterfaceServiceProvider` likely serves as a better base class for service providers
- * tasked with registering classes that implement interfaces.
- */
-abstract class AbstractServiceProvider extends BaseServiceProvider {
-
-	/**
-	 * Register a class in the container and use reflection to guess the injection method arguments.
-	 *
-	 * WARNING: this method uses reflection, so please have performance in mind when using it.
-	 *
-	 * @param string $class_name Class name to register.
-	 * @param mixed  $concrete   The concrete to register. Can be a shared instance, a factory callback, or a class name.
-	 * @param bool   $shared Whether to register the class as shared (`get` always returns the same instance) or not.
-	 *
-	 * @return DefinitionInterface The generated container definition.
-	 *
-	 * @throws ContainerException Error when reflecting the class, or class injection method is not public, or an argument has no valid type hint.
-	 */
-	protected function add_with_auto_arguments( string $class_name, $concrete = null, bool $shared = false ) : DefinitionInterface {
-		$definition = new Definition( $class_name, $concrete );
-
-		$function = $this->reflect_class_or_callable( $class_name, $concrete );
-
-		if ( ! is_null( $function ) ) {
-			$arguments = $function->getParameters();
-			foreach ( $arguments as $argument ) {
-				if ( $argument->isDefaultValueAvailable() ) {
-					$default_value = $argument->getDefaultValue();
-					$definition->addArgument( new RawArgument( $default_value ) );
-				} else {
-					$argument_class = $this->get_class( $argument );
-					if ( is_null( $argument_class ) ) {
-						throw new ContainerException( "Argument '{$argument->getName()}' of class '$class_name' doesn't have a type hint or has one that doesn't specify a class." );
-					}
-
-					$definition->addArgument( $argument_class->name );
-				}
-			}
-		}
-
-		// Register the definition only after being sure that no exception will be thrown.
-		$this->getContainer()->add( $definition->getAlias(), $definition, $shared );
-
-		return $definition;
-	}
-
-	/**
-	 * Gets the class of a parameter.
-	 *
-	 * This method is a replacement for ReflectionParameter::getClass,
-	 * which is deprecated as of PHP 8.
-	 *
-	 * @param \ReflectionParameter $parameter The parameter to get the class for.
-	 *
-	 * @return \ReflectionClass|null The class of the parameter, or null if it hasn't any.
-	 */
-	private function get_class( \ReflectionParameter $parameter ) {
-		return $parameter->getType() && ! $parameter->getType()->isBuiltin()
-			? new \ReflectionClass( $parameter->getType()->getName() )
-			: null;
-	}
-
-	/**
-	 * Check if a combination of class name and concrete is valid for registration.
-	 * Also return the class injection method if the concrete is either a class name or null (then use the supplied class name).
-	 *
-	 * @param string $class_name The class name to check.
-	 * @param mixed  $concrete   The concrete to check.
-	 *
-	 * @return \ReflectionFunctionAbstract|null A reflection instance for the $class_name injection method or $concrete injection method or callable; null otherwise.
-	 * @throws ContainerException Class has a private injection method, can't reflect class, or the concrete is invalid.
-	 */
-	private function reflect_class_or_callable( string $class_name, $concrete ) {
-		if ( ! isset( $concrete ) || is_string( $concrete ) && class_exists( $concrete ) ) {
-			$class = $concrete ?? $class_name;
-
-			if ( ! method_exists( $class, Definition::INJECTION_METHOD ) ) {
-				return null;
-			}
-
-			$method = new \ReflectionMethod( $class, Definition::INJECTION_METHOD );
-
-			$missing_modifiers = array();
-			if ( ! $method->isFinal() ) {
-				$missing_modifiers[] = 'final';
-			}
-			if ( ! $method->isPublic() ) {
-				$missing_modifiers[] = 'public';
-			}
-			if ( ! empty( $missing_modifiers ) ) {
-				throw new ContainerException( "Method '" . Definition::INJECTION_METHOD . "' of class '$class' isn't '" . implode( ' ', $missing_modifiers ) . "', instances can't be created." );
-			}
-
-			return $method;
-		} elseif ( is_callable( $concrete ) ) {
-			try {
-				return new \ReflectionFunction( $concrete );
-			} catch ( \ReflectionException $ex ) {
-				throw new ContainerException( "Error when reflecting callable: {$ex->getMessage()}" );
-			}
-		}
-
-		return null;
-	}
-
-	/**
-	 * Register a class in the container and use reflection to guess the injection method arguments.
-	 * The class is registered as shared, so `get` on the container always returns the same instance.
-	 *
-	 * WARNING: this method uses reflection, so please have performance in mind when using it.
-	 *
-	 * @param string $class_name Class name to register.
-	 * @param mixed  $concrete   The concrete to register. Can be a shared instance, a factory callback, or a class name.
-	 *
-	 * @return DefinitionInterface The generated container definition.
-	 *
-	 * @throws ContainerException Error when reflecting the class, or class injection method is not public, or an argument has no valid type hint.
-	 */
-	protected function share_with_auto_arguments( string $class_name, $concrete = null ) : DefinitionInterface {
-		return $this->add_with_auto_arguments( $class_name, $concrete, true );
-	}
-
-	/**
-	 * Register an entry in the container.
-	 *
-	 * @param string     $id Entry id (typically a class or interface name).
-	 * @param mixed|null $concrete Concrete entity to register under that id, null for automatic creation.
-	 * @param bool|null  $shared Whether to register the class as shared (`get` always returns the same instance) or not.
-	 *
-	 * @return DefinitionInterface The generated container definition.
-	 */
-	protected function add( string $id, $concrete = null, ?bool $shared = null ) : DefinitionInterface {
-		return $this->getContainer()->add( $id, $concrete, $shared );
-	}
-
-	/**
-	 * Register a shared entry in the container (`get` always returns the same instance).
-	 *
-	 * @param string     $id Entry id (typically a class or interface name).
-	 * @param mixed|null $concrete Concrete entity to register under that id, null for automatic creation.
-	 *
-	 * @return DefinitionInterface The generated container definition.
-	 */
-	protected function share( string $id, $concrete = null ) : DefinitionInterface {
-		return $this->add( $id, $concrete, true );
-	}
-}
diff --git a/plugins/woocommerce/src/Internal/DependencyManagement/ContainerException.php b/plugins/woocommerce/src/Internal/DependencyManagement/ContainerException.php
index 4cf4d413b6..2236c368b6 100644
--- a/plugins/woocommerce/src/Internal/DependencyManagement/ContainerException.php
+++ b/plugins/woocommerce/src/Internal/DependencyManagement/ContainerException.php
@@ -1,6 +1,6 @@
 <?php
 /**
- * ExtendedContainer class file.
+ * ContainerException class file.
  */

 namespace Automattic\WooCommerce\Internal\DependencyManagement;
diff --git a/plugins/woocommerce/src/Internal/DependencyManagement/Definition.php b/plugins/woocommerce/src/Internal/DependencyManagement/Definition.php
deleted file mode 100644
index 3295c0a97b..0000000000
--- a/plugins/woocommerce/src/Internal/DependencyManagement/Definition.php
+++ /dev/null
@@ -1,70 +0,0 @@
-<?php
-/**
- * An extension to the Definition class to prevent constructor injection from being possible.
- */
-
-namespace Automattic\WooCommerce\Internal\DependencyManagement;
-
-use Automattic\WooCommerce\Vendor\League\Container\Definition\Definition as BaseDefinition;
-
-/**
- * An extension of the definition class that replaces constructor injection with method injection.
- */
-class Definition extends BaseDefinition {
-
-	/**
-	 * The standard method that we use for dependency injection.
-	 */
-	public const INJECTION_METHOD = 'init';
-
-	/**
-	 * Resolve a class using method injection instead of constructor injection.
-	 *
-	 * @param string $concrete The concrete to instantiate.
-	 *
-	 * @return object
-	 */
-	protected function resolveClass( string $concrete ) {
-		$instance = new $concrete();
-		$this->invokeInit( $instance );
-		return $instance;
-	}
-
-	/**
-	 * Invoke methods on resolved instance, including 'init'.
-	 *
-	 * @param object $instance The concrete to invoke methods on.
-	 *
-	 * @return object
-	 */
-	protected function invokeMethods( $instance ) {
-		$this->invokeInit( $instance );
-		parent::invokeMethods( $instance );
-		return $instance;
-	}
-
-	/**
-	 * Invoke the 'init' method on a resolved object.
-	 *
-	 * Constructor injection causes backwards compatibility problems
-	 * so we will rely on method injection via an internal method.
-	 *
-	 * @param object $instance The resolved object.
-	 * @return void
-	 */
-	private function invokeInit( $instance ) {
-		$resolved = $this->resolveArguments( $this->arguments );
-
-		if ( method_exists( $instance, static::INJECTION_METHOD ) ) {
-			call_user_func_array( array( $instance, static::INJECTION_METHOD ), $resolved );
-		}
-	}
-
-	/**
-	 * Forget the cached resolved object, so the next time it's requested
-	 * it will be resolved again.
-	 */
-	public function forgetResolved() {
-		$this->resolved = null;
-	}
-}
diff --git a/plugins/woocommerce/src/Internal/DependencyManagement/ExtendedContainer.php b/plugins/woocommerce/src/Internal/DependencyManagement/ExtendedContainer.php
deleted file mode 100644
index 74ac156ad3..0000000000
--- a/plugins/woocommerce/src/Internal/DependencyManagement/ExtendedContainer.php
+++ /dev/null
@@ -1,224 +0,0 @@
-<?php
-/**
- * ExtendedContainer class file.
- */
-
-namespace Automattic\WooCommerce\Internal\DependencyManagement;
-
-use Automattic\WooCommerce\Container;
-use Automattic\WooCommerce\Proxies\LegacyProxy;
-use Automattic\WooCommerce\Testing\Tools\DependencyManagement\MockableLegacyProxy;
-use Automattic\WooCommerce\Utilities\StringUtil;
-use Automattic\WooCommerce\Vendor\League\Container\Container as BaseContainer;
-use Automattic\WooCommerce\Vendor\League\Container\Definition\DefinitionInterface;
-
-/**
- * This class extends the original League's Container object by adding some functionality
- * that we need for WooCommerce.
- *
- * NOTE: This class will be removed in WooCommerce 10.0.
- */
-class ExtendedContainer extends BaseContainer {
-
-	/**
-	 * The root namespace of all WooCommerce classes in the `src` directory.
-	 *
-	 * @var string
-	 */
-	private $woocommerce_namespace = 'Automattic\\WooCommerce\\';
-
-	/**
-	 * Holds the original registrations so that 'reset_replacement' can work, keys are class names and values are the original concretes.
-	 *
-	 * @var array
-	 */
-	private $original_concretes = array();
-
-	/**
-	 * Whitelist of classes that we can register using the container
-	 * despite not belonging to the WooCommerce root namespace.
-	 *
-	 * In general we allow only the registration of classes in the
-	 * WooCommerce root namespace to prevent registering 3rd party code
-	 * (which doesn't really belong to this container) or old classes
-	 * (which may be eventually deprecated, also the LegacyProxy
-	 * should be used for those).
-	 *
-	 * @var string[]
-	 */
-	private $registration_whitelist = array(
-		Container::class,
-	);
-
-	/**
-	 * A list of tags that have already been fully resolved, see 'get' for details.
-	 *
-	 * @var array
-	 */
-	private array $known_tags = array();
-
-	/**
-	 * Register a class in the container.
-	 *
-	 * @param string    $class_name Class name.
-	 * @param mixed     $concrete How to resolve the class with `get`: a factory callback, a concrete instance, another class name, or null to just create an instance of the class.
-	 * @param bool|null $shared Whether the resolution should be performed only once and cached.
-	 *
-	 * @return DefinitionInterface The generated definition for the container.
-	 * @throws ContainerException Invalid parameters.
-	 */
-	public function add( string $class_name, $concrete = null, ?bool $shared = null ): DefinitionInterface {
-		if ( ! $this->is_class_allowed( $class_name ) ) {
-			throw new ContainerException( "You cannot add '$class_name', only classes in the {$this->woocommerce_namespace} namespace are allowed." );
-		}
-
-		$concrete_class = $this->get_class_from_concrete( $concrete );
-		if ( isset( $concrete_class ) && ! $this->is_class_allowed( $concrete_class ) ) {
-			throw new ContainerException( "You cannot add concrete '$concrete_class', only classes in the {$this->woocommerce_namespace} namespace are allowed." );
-		}
-
-		// We want to use a definition class that does not support constructor injection to avoid accidental usage.
-		if ( ! $concrete instanceof DefinitionInterface ) {
-			$concrete = new Definition( $class_name, $concrete );
-		}
-
-		return parent::add( $class_name, $concrete, $shared );
-	}
-
-	/**
-	 * Replace an existing registration with a different concrete. See also 'reset_replacement' and 'reset_all_replacements'.
-	 *
-	 * @param string $class_name The class name whose definition will be replaced.
-	 * @param mixed  $concrete The new concrete (same as "add").
-	 *
-	 * @return DefinitionInterface The modified definition.
-	 * @throws ContainerException Invalid parameters.
-	 */
-	public function replace( string $class_name, $concrete ): DefinitionInterface {
-		if ( ! $this->has( $class_name ) ) {
-			throw new ContainerException( "The container doesn't have '$class_name' registered, please use 'add' instead of 'replace'." );
-		}
-
-		$concrete_class = $this->get_class_from_concrete( $concrete );
-		if ( isset( $concrete_class ) && ! $this->is_class_allowed( $concrete_class ) && ! $this->is_anonymous_class( $concrete_class ) ) {
-			throw new ContainerException( "You cannot use concrete '$concrete_class', only classes in the {$this->woocommerce_namespace} namespace are allowed." );
-		}
-
-		if ( ! array_key_exists( $class_name, $this->original_concretes ) ) {
-			// LegacyProxy is a special case: we replace it with MockableLegacyProxy at unit testing bootstrap time.
-			$original_concrete                       = LegacyProxy::class === $class_name ? MockableLegacyProxy::class : $this->extend( $class_name )->getConcrete( $concrete );
-			$this->original_concretes[ $class_name ] = $original_concrete;
-		}
-
-		return $this->extend( $class_name )->setConcrete( $concrete );
-	}
-
-	/**
-	 * Reset a replaced registration back to its original concrete.
-	 *
-	 * @param string $class_name The class name whose definition had been replaced.
-	 * @return bool True if the registration has been reset, false if no replacement had been made for the specified class name.
-	 */
-	public function reset_replacement( string $class_name ): bool {
-		if ( ! array_key_exists( $class_name, $this->original_concretes ) ) {
-			return false;
-		}
-
-		$this->extend( $class_name )->setConcrete( $this->original_concretes[ $class_name ] );
-		unset( $this->original_concretes[ $class_name ] );
-
-		return true;
-	}
-
-	/**
-	 * Reset all the replaced registrations back to their original concretes.
-	 */
-	public function reset_all_replacements() {
-		foreach ( $this->original_concretes as $class_name => $concrete ) {
-			$this->extend( $class_name )->setConcrete( $concrete );
-		}
-
-		$this->original_concretes = array();
-	}
-
-	/**
-	 * Reset all the cached resolutions, so any further "get" for shared definitions will generate the instance again.
-	 */
-	public function reset_all_resolved() {
-		foreach ( $this->definitions->getIterator() as $definition ) {
-			$definition->forgetResolved();
-		}
-	}
-
-	/**
-	 * Get an instance of a registered class.
-	 *
-	 * @param string $id The class name.
-	 * @param bool   $new True to generate a new instance even if the class was registered as shared.
-	 *
-	 * @return object An instance of the requested class.
-	 * @throws ContainerException Attempt to get an instance of a non-namespaced class.
-	 */
-	public function get( $id, bool $new = false ) {
-		if ( false === strpos( $id, '\\' ) ) {
-			throw new ContainerException( "Attempt to get an instance of the non-namespaced class '$id' from the container, did you forget to add a namespace import?" );
-		}
-
-		// This is a workaround for an issue that arises when using service providers inheriting from AbstractInterfaceServiceProvider:
-		// if one of these providers registers classes both by name and by tag, and one of its registered classes is requested
-		// with 'get' by name before a list of classes is requested by tag, then that service provider gets locked as
-		// the only one providing that tag, and the others get ignored. This is due to the fact that container definitions
-		// are created "on the fly" as needed and the base 'get' method won't try to register additional providers
-		// if the requested tag is already provided by at least one of the already existing definitions.
-		if ( $this->definitions->hasTag( $id ) && ! in_array( $id, $this->known_tags, true ) && $this->providers->provides( $id ) ) {
-			$this->providers->register( $id );
-			$this->known_tags[] = $id;
-		}
-
-		return parent::get( $id, $new );
-	}
-
-	/**
-	 * Gets the class from the concrete regardless of type.
-	 *
-	 * @param mixed $concrete The concrete that we want the class from..
-	 *
-	 * @return string|null The class from the concrete if one is available, null otherwise.
-	 */
-	protected function get_class_from_concrete( $concrete ) {
-		if ( is_object( $concrete ) && ! is_callable( $concrete ) ) {
-			if ( $concrete instanceof DefinitionInterface ) {
-				return $this->get_class_from_concrete( $concrete->getConcrete() );
-			}
-
-			return get_class( $concrete );
-		}
-
-		if ( is_string( $concrete ) && class_exists( $concrete ) ) {
-			return $concrete;
-		}
-
-		return null;
-	}
-
-	/**
-	 * Checks to see whether or not a class is allowed to be registered.
-	 *
-	 * @param string $class_name The class to check.
-	 *
-	 * @return bool True if the class is allowed to be registered, false otherwise.
-	 */
-	protected function is_class_allowed( string $class_name ): bool {
-		return StringUtil::starts_with( $class_name, $this->woocommerce_namespace, false ) || in_array( $class_name, $this->registration_whitelist, true );
-	}
-
-	/**
-	 * Check if a class name corresponds to an anonymous class.
-	 *
-	 * @param string $class_name The class name to check.
-	 * @return bool True if the name corresponds to an anonymous class.
-	 */
-	protected function is_anonymous_class( string $class_name ): bool {
-		return StringUtil::starts_with( $class_name, 'class@anonymous' );
-	}
-}
diff --git a/plugins/woocommerce/src/Internal/DependencyManagement/RuntimeContainer.php b/plugins/woocommerce/src/Internal/DependencyManagement/RuntimeContainer.php
index 0abb526e9a..caf7adbdc2 100644
--- a/plugins/woocommerce/src/Internal/DependencyManagement/RuntimeContainer.php
+++ b/plugins/woocommerce/src/Internal/DependencyManagement/RuntimeContainer.php
@@ -125,6 +125,7 @@ class RuntimeContainer {
 		return $instance;
 	}

+	// phpcs:disable Squiz.Commenting.FunctionCommentThrowTag.WrongNumber
 	/**
 	 * Get an instance of a class using reflection.
 	 * This method recursively calls 'get_core' (which in turn calls this method) for each of the arguments
@@ -139,7 +140,23 @@ class RuntimeContainer {
 	 */
 	private function instantiate_class_using_reflection( string $class_name, array &$resolve_chain ): object {
 		$ref_class = new \ReflectionClass( $class_name );
-		$instance  = $ref_class->newInstance();
+
+		// phpcs:disable WordPress.Security.EscapeOutput.ExceptionNotEscaped
+
+		$constructor = $ref_class->getConstructor();
+		if ( ! is_null( $constructor ) ) {
+			if ( ! $constructor->isPublic() ) {
+				throw new ContainerException( "Error resolving '$class_name': the class doesn't have a public constructor." );
+			}
+			$constructor_arguments = $constructor->getParameters();
+			foreach ( $constructor_arguments as $argument ) {
+				if ( ! $argument->isOptional() ) {
+					throw new ContainerException( "Error resolving '$class_name': the class constructor has non-optional arguments." );
+				}
+			}
+		}
+
+		$instance = $ref_class->newInstance();
 		if ( ! $ref_class->hasMethod( 'init' ) ) {
 			return $instance;
 		}
@@ -149,8 +166,6 @@ class RuntimeContainer {
 			return $instance;
 		}

-		// phpcs:disable WordPress.Security.EscapeOutput.ExceptionNotEscaped
-
 		$init_args          = $init_method->getParameters();
 		$init_arg_instances = array_map(
 			function ( \ReflectionParameter $arg ) use ( $class_name, &$resolve_chain ) {
@@ -175,10 +190,14 @@ class RuntimeContainer {

 		return $instance;
 	}
+	// phpcs:enable Squiz.Commenting.FunctionCommentThrowTag.WrongNumber

 	/**
 	 * Tells if the 'get' method can be used to resolve a given class.
 	 *
+	 * Note that 'get' can throw an exception even if this method returns true,
+	 * for example for classes that are in the correct namespace but don't have a public constructor.
+	 *
 	 * @param string $class_name The class name.
 	 * @return bool True if the class with the supplied name can be resolved with 'get'.
 	 */
@@ -197,29 +216,4 @@ class RuntimeContainer {
 	protected function is_class_allowed( string $class_name ): bool {
 		return StringUtil::starts_with( $class_name, self::WOOCOMMERCE_NAMESPACE, false );
 	}
-
-	/**
-	 * Tells if this class should be used as the core WooCommerce dependency injection container (or if the old ExtendedContainer should be used instead).
-	 *
-	 * By default, this returns true, to have it return false you can:
-	 *
-	 * 1. Define the WOOCOMMERCE_USE_OLD_DI_CONTAINER constant with a value of true; or
-	 * 2. Hook on the 'woocommerce_use_old_di_container' filter and have it return false (it receives the value of WOOCOMMERCE_USE_OLD_DI_CONTAINER, or false if the constant doesn't exist).
-	 *
-	 * @return bool True if this class should be used as the core WooCommerce dependency injection container, false if ExtendedContainer should be used instead.
-	 */
-	public static function should_use(): bool {
-		$should_use = ! defined( 'WOOCOMMERCE_USE_OLD_DI_CONTAINER' ) || true !== WOOCOMMERCE_USE_OLD_DI_CONTAINER;
-
-		/**
-		 * Hook to decide if the old ExtendedContainer class (instead of RuntimeContainer) should be used as the underlying WooCommerce dependency injection container.
-		 *
-		 * NOTE: This hook will be removed in WooCommerce 9.5.
-		 *
-		 * @param bool $should_use Value of the WOOCOMMERCE_USE_OLD_DI_CONTAINER constant, false if the constant doesn't exist.
-		 *
-		 * @since 9.5.0
-		 */
-		return apply_filters( 'woocommerce_use_old_di_container', $should_use );
-	}
 }
diff --git a/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/AbstractInterfaceServiceProvider.php b/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/AbstractInterfaceServiceProvider.php
deleted file mode 100644
index 5ed4c5e6da..0000000000
--- a/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/AbstractInterfaceServiceProvider.php
+++ /dev/null
@@ -1,77 +0,0 @@
-<?php
-declare( strict_types=1 );
-
-namespace Automattic\WooCommerce\Internal\DependencyManagement\ServiceProviders;
-
-use Automattic\WooCommerce\Internal\DependencyManagement\AbstractServiceProvider;
-use Automattic\WooCommerce\Vendor\League\Container\Definition\DefinitionInterface;
-
-/**
- * Extends AbstractServiceProvider to register services and automatically tag them based on their implemented interfaces.
- * By using the `add_with_implements_tags` and `share_with_implements_tags` methods, it becomes possible to retrieve
- * all the services that implement a given interface with a single `get` call.
- *
- * @since 8.5.0
- */
-abstract class AbstractInterfaceServiceProvider extends AbstractServiceProvider {
-
-	/**
-	 * Determine whether this service provides the given alias.
-	 *
-	 * @param string $alias The alias to check.
-	 *
-	 * @return bool
-	 */
-	public function provides( string $alias ): bool {
-		$provides = parent::provides( $alias );
-		if ( $provides ) {
-			return true;
-		}
-
-		$implements = array();
-		foreach ( $this->provides as $class ) {
-			$implements_more = class_implements( $class );
-			if ( $implements_more ) {
-				$implements = array_merge( $implements, $implements_more );
-			}
-		}
-
-		$implements = array_unique( $implements );
-
-		return array_key_exists( $alias, $implements );
-	}
-
-	/**
-	 * Register a class in the container and add tags for all the interfaces it implements.
-	 *
-	 * This also updates the `$this->provides` property with the interfaces provided by the class, and ensures
-	 * that the property doesn't contain duplicates.
-	 *
-	 * @param string     $id       Entry ID (typically a class or interface name).
-	 * @param mixed|null $concrete Concrete entity to register under that ID, null for automatic creation.
-	 * @param bool|null  $shared   Whether to register the class as shared (`get` always returns the same instance)
-	 *                             or not.
-	 *
-	 * @return DefinitionInterface
-	 */
-	protected function add_with_implements_tags( string $id, $concrete = null, ?bool $shared = null ): DefinitionInterface {
-		$definition = $this->add( $id, $concrete, $shared );
-		foreach ( class_implements( $id ) as $interface ) {
-			$definition->addTag( $interface );
-		}
-
-		return $definition;
-	}
-
-	/**
-	 * Register a shared class in the container and add tags for all the interfaces it implements.
-	 *
-	 * @param string     $id       Entry ID (typically a class or interface name).
-	 * @param mixed|null $concrete Concrete entity to register under that ID, null for automatic creation.
-	 *
-	 * @return DefinitionInterface
-	 */
-	protected function share_with_implements_tags( string $id, $concrete = null ): DefinitionInterface {
-		return $this->add_with_implements_tags( $id, $concrete, true );
-	}
-}
diff --git a/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/AddressProviderServiceProvider.php b/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/AddressProviderServiceProvider.php
deleted file mode 100644
index 27f340658c..0000000000
--- a/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/AddressProviderServiceProvider.php
+++ /dev/null
@@ -1,26 +0,0 @@
-<?php
-declare( strict_types=1 );
-namespace Automattic\WooCommerce\Internal\DependencyManagement\ServiceProviders;
-
-use Automattic\WooCommerce\Internal\AddressProvider\AddressProviderController;
-use Automattic\WooCommerce\Internal\DependencyManagement\AbstractServiceProvider;
-
-/**
- * Service class for managing address providers.
- */
-class AddressProviderServiceProvider extends AbstractServiceProvider {
-
-	/**
-	 * The classes/interfaces that are serviced by this service provider.
-	 *
-	 * @var array
-	 */
-	protected $provides = array( AddressProviderController::class );
-
-	/**
-	 * Register the classes.
-	 */
-	public function register() {
-		$this->share( AddressProviderController::class );
-	}
-}
diff --git a/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/AdminSettingsServiceProvider.php b/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/AdminSettingsServiceProvider.php
deleted file mode 100644
index 0d46483a52..0000000000
--- a/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/AdminSettingsServiceProvider.php
+++ /dev/null
@@ -1,54 +0,0 @@
-<?php
-declare( strict_types=1 );
-
-namespace Automattic\WooCommerce\Internal\DependencyManagement\ServiceProviders;
-
-use Automattic\Jetpack\Connection\Manager as WPCOM_Connection_Manager;
-use Automattic\WooCommerce\Internal\Admin\Settings\PaymentProviders;
-use Automattic\WooCommerce\Internal\Admin\Settings\PaymentProviders\WooPayments\WooPaymentsRestController;
-use Automattic\WooCommerce\Internal\Admin\Settings\PaymentProviders\WooPayments\WooPaymentsService;
-use Automattic\WooCommerce\Internal\Admin\Settings\Payments;
-use Automattic\WooCommerce\Internal\Admin\Settings\PaymentsController;
-use Automattic\WooCommerce\Internal\Admin\Settings\PaymentsRestController;
-use Automattic\WooCommerce\Internal\Admin\Suggestions\PaymentExtensionSuggestions;
-use Automattic\WooCommerce\Proxies\LegacyProxy;
-
-/**
- * Service provider for the admin settings controller classes in the Automattic\WooCommerce\Internal\Admin\Settings namespace.
- */
-class AdminSettingsServiceProvider extends AbstractInterfaceServiceProvider {
-	/**
-	 * List services provided by this class.
-	 *
-	 * @var string[]
-	 */
-	protected $provides = array(
-		PaymentsRestController::class,
-		Payments::class,
-		PaymentsController::class,
-		PaymentProviders::class,
-		// Provider-specific.
-		WooPaymentsRestController::class,
-		WooPaymentsService::class,
-	);
-
-	/**
-	 * Registers services provided by this class.
-	 */
-	public function register() {
-		$this->share( PaymentProviders::class )
-			->addArgument( PaymentExtensionSuggestions::class );
-		$this->share( Payments::class )
-			->addArguments( array( PaymentProviders::class, PaymentExtensionSuggestions::class ) );
-		$this->share( PaymentsController::class )
-			->addArgument( Payments::class );
-		$this->share_with_implements_tags( PaymentsRestController::class )
-			->addArgument( Payments::class );
-
-		// Provider-specific.
-		$this->share( WooPaymentsService::class )
-			->addArguments( array( PaymentProviders::class, LegacyProxy::class ) );
-		$this->share_with_implements_tags( WooPaymentsRestController::class )
-			->addArguments( array( Payments::class, WooPaymentsService::class ) );
-	}
-}
diff --git a/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/AdminSuggestionsServiceProvider.php b/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/AdminSuggestionsServiceProvider.php
deleted file mode 100644
index 95a838ca90..0000000000
--- a/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/AdminSuggestionsServiceProvider.php
+++ /dev/null
@@ -1,34 +0,0 @@
-<?php
-declare( strict_types=1 );
-
-namespace Automattic\WooCommerce\Internal\DependencyManagement\ServiceProviders;
-
-use Automattic\WooCommerce\Internal\Admin\Suggestions\PaymentExtensionSuggestionIncentives;
-use Automattic\WooCommerce\Internal\Admin\Suggestions\PaymentExtensionSuggestions;
-use Automattic\WooCommerce\Internal\DependencyManagement\AbstractServiceProvider;
-
-/**
- * Service provider for the suggestions controller classes in the Automattic\WooCommerce\Internal\Admin\Suggestions namespace.
- */
-class AdminSuggestionsServiceProvider extends AbstractServiceProvider {
-	/**
-	 * List services provided by this class.
-	 *
-	 * @var string[]
-	 */
-	protected $provides = array(
-		PaymentExtensionSuggestions::class,
-		PaymentExtensionSuggestionIncentives::class,
-		// The individual incentive providers are provided by the PaymentExtensionSuggestionIncentives class.
-	);
-
-	/**
-	 * Registers services provided by this class.
-	 *
-	 * @return void
-	 */
-	public function register() {
-		$this->share( PaymentExtensionSuggestionIncentives::class );
-		$this->share( PaymentExtensionSuggestions::class )->addArgument( PaymentExtensionSuggestionIncentives::class );
-	}
-}
diff --git a/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/AssignDefaultCategoryServiceProvider.php b/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/AssignDefaultCategoryServiceProvider.php
deleted file mode 100644
index cba9e812aa..0000000000
--- a/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/AssignDefaultCategoryServiceProvider.php
+++ /dev/null
@@ -1,31 +0,0 @@
-<?php
-/**
- * AssignDefaultCategoryServiceProvider class file.
- */
-
-namespace Automattic\WooCommerce\Internal\DependencyManagement\ServiceProviders;
-
-use Automattic\WooCommerce\Internal\DependencyManagement\AbstractServiceProvider;
-use Automattic\WooCommerce\Internal\AssignDefaultCategory;
-
-/**
- * Service provider for the AssignDefaultCategory class.
- */
-class AssignDefaultCategoryServiceProvider extends AbstractServiceProvider {
-
-	/**
-	 * The classes/interfaces that are serviced by this service provider.
-	 *
-	 * @var array
-	 */
-	protected $provides = array(
-		AssignDefaultCategory::class,
-	);
-
-	/**
-	 * Register the classes.
-	 */
-	public function register() {
-		$this->share( AssignDefaultCategory::class );
-	}
-}
diff --git a/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/BatchProcessingServiceProvider.php b/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/BatchProcessingServiceProvider.php
deleted file mode 100644
index 96d449322f..0000000000
--- a/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/BatchProcessingServiceProvider.php
+++ /dev/null
@@ -1,40 +0,0 @@
-<?php
-/**
- * Service provider for the batch processing classes.
- */
-
-namespace Automattic\WooCommerce\Internal\DependencyManagement\ServiceProviders;
-
-use Automattic\WooCommerce\Internal\DependencyManagement\AbstractServiceProvider;
-use Automattic\WooCommerce\Internal\BatchProcessing\BatchProcessingController;
-use Automattic\WooCommerce\Internal\OrderCouponDataMigrator;
-
-/**
- * Class BatchProcessingServiceProvider
- *
- * @package Automattic\WooCommerce\Internal\DependencyManagement\ServiceProviders
- */
-class BatchProcessingServiceProvider extends AbstractInterfaceServiceProvider {
-
-	/**
-	 * Services provided by this provider.
-	 *
-	 * @var string[]
-	 */
-	protected $provides = array(
-		BatchProcessingController::class,
-		OrderCouponDataMigrator::class,
-	);
-
-	/**
-	 * Use the register method to register items with the container via the
-	 * protected $this->leagueContainer property or the `getLeagueContainer` method
-	 * from the ContainerAwareTrait.
-	 *
-	 * @return void
-	 */
-	public function register() {
-		$this->share( BatchProcessingController::class, new BatchProcessingController() );
-		$this->share_with_implements_tags( OrderCouponDataMigrator::class );
-	}
-}
diff --git a/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/COTMigrationServiceProvider.php b/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/COTMigrationServiceProvider.php
deleted file mode 100644
index 8e02dfd0d3..0000000000
--- a/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/COTMigrationServiceProvider.php
+++ /dev/null
@@ -1,40 +0,0 @@
-<?php
-/**
- * Service provider for COTMigration.
- */
-
-namespace Automattic\WooCommerce\Internal\DependencyManagement\ServiceProviders;
-
-use Automattic\WooCommerce\Database\Migrations\CustomOrderTable\CLIRunner;
-use Automattic\WooCommerce\Database\Migrations\CustomOrderTable\PostsToOrdersMigrationController;
-use Automattic\WooCommerce\Internal\DependencyManagement\AbstractServiceProvider;
-
-/**
- * Class COTMigrationServiceProvider
- *
- * @package Automattic\WooCommerce\Internal\DependencyManagement\ServiceProviders
- */
-class COTMigrationServiceProvider extends AbstractServiceProvider {
-
-	/**
-	 * Services provided by this provider.
-	 *
-	 * @var string[]
-	 */
-	protected $provides = array(
-		PostsToOrdersMigrationController::class,
-		CLIRunner::class,
-	);
-
-	/**
-	 * Use the register method to register items with the container via the
-	 * protected $this->leagueContainer property or the `getLeagueContainer` method
-	 * from the ContainerAwareTrait.
-	 *
-	 * @return void
-	 */
-	public function register() {
-		$this->share( PostsToOrdersMigrationController::class );
-		$this->share( CLIRunner::class );
-	}
-}
diff --git a/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/ComingSoonServiceProvider.php b/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/ComingSoonServiceProvider.php
deleted file mode 100644
index 10dc40ac8a..0000000000
--- a/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/ComingSoonServiceProvider.php
+++ /dev/null
@@ -1,37 +0,0 @@
-<?php
-
-namespace Automattic\WooCommerce\Internal\DependencyManagement\ServiceProviders;
-
-use Automattic\WooCommerce\Internal\DependencyManagement\AbstractServiceProvider;
-use Automattic\WooCommerce\Internal\ComingSoon\ComingSoonAdminBarBadge;
-use Automattic\WooCommerce\Internal\ComingSoon\ComingSoonCacheInvalidator;
-use Automattic\WooCommerce\Internal\ComingSoon\ComingSoonRequestHandler;
-use Automattic\WooCommerce\Internal\ComingSoon\ComingSoonHelper;
-
-/**
- * Service provider for the Coming Soon mode.
- */
-class ComingSoonServiceProvider extends AbstractServiceProvider {
-
-	/**
-	 * The classes/interfaces that are serviced by this service provider.
-	 *
-	 * @var array
-	 */
-	protected $provides = array(
-		ComingSoonAdminBarBadge::class,
-		ComingSoonCacheInvalidator::class,
-		ComingSoonHelper::class,
-		ComingSoonRequestHandler::class,
-	);
-
-	/**
-	 * Register the classes.
-	 */
-	public function register() {
-		$this->add( ComingSoonAdminBarBadge::class );
-		$this->add( ComingSoonCacheInvalidator::class );
-		$this->add( ComingSoonHelper::class );
-		$this->add( ComingSoonRequestHandler::class )->addArgument( ComingSoonHelper::class );
-	}
-}
diff --git a/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/CostOfGoodsSoldServiceProvider.php b/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/CostOfGoodsSoldServiceProvider.php
deleted file mode 100644
index 82bea365c4..0000000000
--- a/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/CostOfGoodsSoldServiceProvider.php
+++ /dev/null
@@ -1,29 +0,0 @@
-<?php
-declare( strict_types=1 );
-
-namespace Automattic\WooCommerce\Internal\DependencyManagement\ServiceProviders;
-
-use Automattic\WooCommerce\Internal\CostOfGoodsSold\CostOfGoodsSoldController;
-use Automattic\WooCommerce\Internal\Features\FeaturesController;
-
-/**
- * Service provider for the Cost of Goods Sold feature.
- */
-class CostOfGoodsSoldServiceProvider extends AbstractInterfaceServiceProvider {
-
-	/**
-	 * The classes/interfaces that are serviced by this service provider.
-	 *
-	 * @var array
-	 */
-	protected $provides = array(
-		CostOfGoodsSoldController::class,
-	);
-
-	/**
-	 * Register the classes.
-	 */
-	public function register() {
-		$this->share_with_implements_tags( CostOfGoodsSoldController::class )->addArgument( FeaturesController::class );
-	}
-}
diff --git a/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/DownloadPermissionsAdjusterServiceProvider.php b/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/DownloadPermissionsAdjusterServiceProvider.php
deleted file mode 100644
index 126e689f78..0000000000
--- a/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/DownloadPermissionsAdjusterServiceProvider.php
+++ /dev/null
@@ -1,31 +0,0 @@
-<?php
-/**
- * DownloadPermissionsAdjusterServiceProvider class file.
- */
-
-namespace Automattic\WooCommerce\Internal\DependencyManagement\ServiceProviders;
-
-use Automattic\WooCommerce\Internal\DependencyManagement\AbstractServiceProvider;
-use Automattic\WooCommerce\Internal\DownloadPermissionsAdjuster;
-
-/**
- * Service provider for the DownloadPermissionsAdjuster class.
- */
-class DownloadPermissionsAdjusterServiceProvider extends AbstractServiceProvider {
-
-	/**
-	 * The classes/interfaces that are serviced by this service provider.
-	 *
-	 * @var array
-	 */
-	protected $provides = array(
-		DownloadPermissionsAdjuster::class,
-	);
-
-	/**
-	 * Register the classes.
-	 */
-	public function register() {
-		$this->share( DownloadPermissionsAdjuster::class );
-	}
-}
diff --git a/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/EmailEditorServiceProvider.php b/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/EmailEditorServiceProvider.php
deleted file mode 100644
index 24c57031a5..0000000000
--- a/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/EmailEditorServiceProvider.php
+++ /dev/null
@@ -1,59 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-namespace Automattic\WooCommerce\Internal\DependencyManagement\ServiceProviders;
-
-use Automattic\WooCommerce\Internal\EmailEditor\BlockEmailRenderer;
-use Automattic\WooCommerce\Internal\EmailEditor\EmailPatterns\PatternsController;
-use Automattic\WooCommerce\Internal\EmailEditor\EmailApiController;
-use Automattic\WooCommerce\Internal\EmailEditor\EmailTemplates\TemplateApiController;
-use Automattic\WooCommerce\Internal\EmailEditor\EmailTemplates\TemplatesController;
-use Automattic\WooCommerce\Internal\EmailEditor\Integration;
-use Automattic\WooCommerce\Internal\EmailEditor\PageRenderer;
-use Automattic\WooCommerce\Internal\EmailEditor\PersonalizationTagManager;
-use Automattic\WooCommerce\Internal\EmailEditor\TransactionalEmailPersonalizer;
-use Automattic\WooCommerce\Internal\EmailEditor\WooContentProcessor;
-use Automattic\WooCommerce\Internal\EmailEditor\WCTransactionalEmails\WCTransactionalEmails;
-
-/**
- * Service provider for the EmailEditor namespace.
- */
-class EmailEditorServiceProvider extends AbstractInterfaceServiceProvider {
-
-	/**
-	 * The classes/interfaces that are serviced by this service provider.
-	 *
-	 * @var array
-	 */
-	protected $provides = array(
-		Integration::class,
-		PageRenderer::class,
-		PersonalizationTagManager::class,
-		PatternsController::class,
-		TemplatesController::class,
-		WooContentProcessor::class,
-		BlockEmailRenderer::class,
-		TemplateApiController::class,
-		WCTransactionalEmails::class,
-		EmailApiController::class,
-		TransactionalEmailPersonalizer::class,
-	);
-
-	/**
-	 * Register the classes.
-	 */
-	public function register() {
-		$this->share( Integration::class );
-		$this->share( PageRenderer::class );
-		$this->share( PersonalizationTagManager::class );
-		$this->share( PatternsController::class );
-		$this->share( TemplatesController::class );
-		$this->share( WooContentProcessor::class );
-		$this->share( BlockEmailRenderer::class )->addArgument( WooContentProcessor::class );
-		$this->share( WCTransactionalEmails::class );
-		$this->share( TemplateApiController::class );
-		$this->share( EmailApiController::class );
-		$this->share( TransactionalEmailPersonalizer::class );
-	}
-}
diff --git a/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/EmailPreviewServiceProvider.php b/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/EmailPreviewServiceProvider.php
deleted file mode 100644
index 817874d3d1..0000000000
--- a/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/EmailPreviewServiceProvider.php
+++ /dev/null
@@ -1,31 +0,0 @@
-<?php
-declare( strict_types=1 );
-
-namespace Automattic\WooCommerce\Internal\DependencyManagement\ServiceProviders;
-
-use Automattic\WooCommerce\Internal\Admin\EmailPreview\EmailPreview;
-use Automattic\WooCommerce\Internal\Admin\EmailPreview\EmailPreviewRestController;
-
-/**
- * Service provider for the EmailPreview namespace.
- */
-class EmailPreviewServiceProvider extends AbstractInterfaceServiceProvider {
-
-	/**
-	 * The classes/interfaces that are serviced by this service provider.
-	 *
-	 * @var array
-	 */
-	protected $provides = array(
-		EmailPreview::class,
-		EmailPreviewRestController::class,
-	);
-
-	/**
-	 * Register the classes.
-	 */
-	public function register() {
-		$this->share( EmailPreview::class );
-		$this->share_with_implements_tags( EmailPreviewRestController::class );
-	}
-}
diff --git a/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/EnginesServiceProvider.php b/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/EnginesServiceProvider.php
deleted file mode 100644
index 5b91c65264..0000000000
--- a/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/EnginesServiceProvider.php
+++ /dev/null
@@ -1,37 +0,0 @@
-<?php
-/**
- * UtilsClassesServiceProvider class file.
- */
-
-namespace Automattic\WooCommerce\Internal\DependencyManagement\ServiceProviders;
-
-use Automattic\WooCommerce\Internal\ReceiptRendering\ReceiptRenderingEngine;
-use Automattic\WooCommerce\Internal\ReceiptRendering\ReceiptRenderingRestController;
-use Automattic\WooCommerce\Proxies\LegacyProxy;
-use Automattic\WooCommerce\Internal\TransientFiles\TransientFilesEngine;
-
-/**
- * Service provider for the engine classes in the Automattic\WooCommerce\src namespace.
- */
-class EnginesServiceProvider extends AbstractInterfaceServiceProvider {
-
-	/**
-	 * The classes/interfaces that are serviced by this service provider.
-	 *
-	 * @var array
-	 */
-	protected $provides = array(
-		TransientFilesEngine::class,
-		ReceiptRenderingEngine::class,
-		ReceiptRenderingRestController::class,
-	);
-
-	/**
-	 * Register the classes.
-	 */
-	public function register() {
-		$this->share_with_implements_tags( TransientFilesEngine::class )->addArgument( LegacyProxy::class );
-		$this->share( ReceiptRenderingEngine::class )->addArguments( array( TransientFilesEngine::class, LegacyProxy::class ) );
-		$this->share_with_implements_tags( ReceiptRenderingRestController::class );
-	}
-}
diff --git a/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/FeaturesServiceProvider.php b/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/FeaturesServiceProvider.php
deleted file mode 100644
index c860081270..0000000000
--- a/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/FeaturesServiceProvider.php
+++ /dev/null
@@ -1,31 +0,0 @@
-<?php
-
-namespace Automattic\WooCommerce\Internal\DependencyManagement\ServiceProviders;
-
-use Automattic\WooCommerce\Internal\DependencyManagement\AbstractServiceProvider;
-use Automattic\WooCommerce\Internal\Features\FeaturesController;
-use Automattic\WooCommerce\Proxies\LegacyProxy;
-use Automattic\WooCommerce\Utilities\PluginUtil;
-
-/**
- * Service provider for the features enabling/disabling/compatibility engine.
- */
-class FeaturesServiceProvider extends AbstractServiceProvider {
-
-	/**
-	 * The classes/interfaces that are serviced by this service provider.
-	 *
-	 * @var array
-	 */
-	protected $provides = array(
-		FeaturesController::class,
-	);
-
-	/**
-	 * Register the classes.
-	 */
-	public function register() {
-		$this->share( FeaturesController::class )
-			->addArguments( array( LegacyProxy::class, PluginUtil::class ) );
-	}
-}
diff --git a/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/ImportExportServiceProvider.php b/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/ImportExportServiceProvider.php
deleted file mode 100644
index 58984a41fb..0000000000
--- a/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/ImportExportServiceProvider.php
+++ /dev/null
@@ -1,35 +0,0 @@
-<?php
-/**
- * ImportExportServiceProvider class file.
- */
-
-declare( strict_types = 1 );
-
-namespace Automattic\WooCommerce\Internal\DependencyManagement\ServiceProviders;
-
-use Automattic\WooCommerce\Internal\Admin\ImportExport\CSVUploadHelper;
-use Automattic\WooCommerce\Internal\DependencyManagement\AbstractServiceProvider;
-
-/**
- * Service provider for the import/export classes.
- *
- * @since 9.3.0
- */
-class ImportExportServiceProvider extends AbstractServiceProvider {
-
-	/**
-	 * The classes/interfaces that are serviced by this service provider.
-	 *
-	 * @var array
-	 */
-	protected $provides = array(
-		CSVUploadHelper::class,
-	);
-
-	/**
-	 * Register the classes.
-	 */
-	public function register() {
-		$this->share( CSVUploadHelper::class );
-	}
-}
diff --git a/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/LayoutTemplatesServiceProvider.php b/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/LayoutTemplatesServiceProvider.php
deleted file mode 100644
index 8eff7e2f43..0000000000
--- a/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/LayoutTemplatesServiceProvider.php
+++ /dev/null
@@ -1,28 +0,0 @@
-<?php
-
-namespace Automattic\WooCommerce\Internal\DependencyManagement\ServiceProviders;
-
-use Automattic\WooCommerce\Internal\DependencyManagement\AbstractServiceProvider;
-use Automattic\WooCommerce\LayoutTemplates\LayoutTemplateRegistry;
-
-/**
- * Service provider for layout templates.
- */
-class LayoutTemplatesServiceProvider extends AbstractServiceProvider {
-
-	/**
-	 * The classes/interfaces that are serviced by this service provider.
-	 *
-	 * @var array
-	 */
-	protected $provides = array(
-		LayoutTemplateRegistry::class,
-	);
-
-	/**
-	 * Register the classes.
-	 */
-	public function register() {
-		$this->share( LayoutTemplateRegistry::class );
-	}
-}
diff --git a/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/LoggingServiceProvider.php b/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/LoggingServiceProvider.php
deleted file mode 100644
index 89f1522123..0000000000
--- a/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/LoggingServiceProvider.php
+++ /dev/null
@@ -1,45 +0,0 @@
-<?php
-
-namespace Automattic\WooCommerce\Internal\DependencyManagement\ServiceProviders;
-
-use Automattic\WooCommerce\Internal\Admin\Logging\{ PageController, Settings };
-use Automattic\WooCommerce\Internal\Admin\Logging\FileV2\FileController;
-use Automattic\WooCommerce\Internal\DependencyManagement\AbstractServiceProvider;
-use Automattic\WooCommerce\Internal\Logging\RemoteLogger;
-
-/**
- * LoggingServiceProvider class.
- */
-class LoggingServiceProvider extends AbstractServiceProvider {
-	/**
-	 * List services provided by this class.
-	 *
-	 * @var string[]
-	 */
-	protected $provides = array(
-		FileController::class,
-		PageController::class,
-		Settings::class,
-		RemoteLogger::class,
-	);
-
-	/**
-	 * Registers services provided by this class.
-	 *
-	 * @return void
-	 */
-	public function register() {
-		$this->share( FileController::class );
-
-		$this->share( PageController::class )->addArguments(
-			array(
-				FileController::class,
-				Settings::class,
-			)
-		);
-
-		$this->share( Settings::class );
-
-		$this->share( RemoteLogger::class );
-	}
-}
diff --git a/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/MarketingServiceProvider.php b/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/MarketingServiceProvider.php
deleted file mode 100644
index c00e484fe8..0000000000
--- a/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/MarketingServiceProvider.php
+++ /dev/null
@@ -1,41 +0,0 @@
-<?php
-/**
- * MarketingServiceProvider class file.
- */
-
-namespace Automattic\WooCommerce\Internal\DependencyManagement\ServiceProviders;
-
-use Automattic\WooCommerce\Admin\Marketing\MarketingChannels;
-use Automattic\WooCommerce\Internal\Admin\Marketing\MarketingSpecs;
-use Automattic\WooCommerce\Internal\DependencyManagement\AbstractServiceProvider;
-
-// Indicates that the multichannel marketing classes exist.
-// This constant will be checked by third-party extensions before utilizing any of the classes defined for this feature.
-if ( ! defined( 'WC_MCM_EXISTS' ) ) {
-	define( 'WC_MCM_EXISTS', true );
-}
-
-/**
- * Service provider for the non-static utils classes in the Automattic\WooCommerce\src namespace.
- *
- * @since x.x.x
- */
-class MarketingServiceProvider extends AbstractServiceProvider {
-	/**
-	 * The classes/interfaces that are serviced by this service provider.
-	 *
-	 * @var array
-	 */
-	protected $provides = array(
-		MarketingSpecs::class,
-		MarketingChannels::class,
-	);
-
-	/**
-	 * Register the classes.
-	 */
-	public function register() {
-		$this->share( MarketingSpecs::class );
-		$this->share( MarketingChannels::class );
-	}
-}
diff --git a/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/MarketplaceServiceProvider.php b/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/MarketplaceServiceProvider.php
deleted file mode 100644
index 15c5a647c4..0000000000
--- a/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/MarketplaceServiceProvider.php
+++ /dev/null
@@ -1,31 +0,0 @@
-<?php
-/**
- * MarketplaceServiceProvider class file.
- */
-
-namespace Automattic\WooCommerce\Internal\DependencyManagement\ServiceProviders;
-
-use Automattic\WooCommerce\Internal\DependencyManagement\AbstractServiceProvider;
-use Automattic\WooCommerce\Internal\Admin\Marketplace;
-
-/**
- * Service provider for the Marketplace namespace.
- */
-class MarketplaceServiceProvider extends AbstractServiceProvider {
-
-	/**
-	 * The classes/interfaces that are serviced by this service provider.
-	 *
-	 * @var array
-	 */
-	protected $provides = array(
-		Marketplace::class,
-	);
-
-	/**
-	 * Register the classes.
-	 */
-	public function register() {
-		$this->share( Marketplace::class );
-	}
-}
diff --git a/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/ObjectCacheServiceProvider.php b/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/ObjectCacheServiceProvider.php
deleted file mode 100644
index 28a0165cee..0000000000
--- a/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/ObjectCacheServiceProvider.php
+++ /dev/null
@@ -1,28 +0,0 @@
-<?php
-
-namespace Automattic\WooCommerce\Internal\DependencyManagement\ServiceProviders;
-
-use Automattic\WooCommerce\Caching\WPCacheEngine;
-use Automattic\WooCommerce\Internal\DependencyManagement\AbstractServiceProvider;
-
-/**
- * Service provider for the object cache mechanism.
- */
-class ObjectCacheServiceProvider extends AbstractServiceProvider {
-
-	/**
-	 * The classes/interfaces that are serviced by this service provider.
-	 *
-	 * @var array
-	 */
-	protected $provides = array(
-		WPCacheEngine::class,
-	);
-
-	/**
-	 * Register the classes.
-	 */
-	public function register() {
-		$this->share( WPCacheEngine::class );
-	}
-}
diff --git a/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/OptionSanitizerServiceProvider.php b/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/OptionSanitizerServiceProvider.php
deleted file mode 100644
index ef59841107..0000000000
--- a/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/OptionSanitizerServiceProvider.php
+++ /dev/null
@@ -1,32 +0,0 @@
-<?php
-/**
- * OptionSanitizerServiceProvider class file.
- */
-
-namespace Automattic\WooCommerce\Internal\DependencyManagement\ServiceProviders;
-
-use Automattic\WooCommerce\Internal\DependencyManagement\AbstractServiceProvider;
-use Automattic\WooCommerce\Internal\Settings\OptionSanitizer;
-
-/**
- * Service provider for the OptionSanitizer class.
- */
-class OptionSanitizerServiceProvider extends AbstractServiceProvider {
-
-	/**
-	 * The classes/interfaces that are serviced by this service provider.
-	 *
-	 * @var array
-	 */
-	protected $provides = array(
-		OptionSanitizer::class,
-	);
-
-	/**
-	 * Register the classes.
-	 */
-	public function register() {
-		$this->share( OptionSanitizer::class );
-	}
-
-}
diff --git a/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/OrderAdminServiceProvider.php b/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/OrderAdminServiceProvider.php
deleted file mode 100644
index 693ebc510e..0000000000
--- a/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/OrderAdminServiceProvider.php
+++ /dev/null
@@ -1,49 +0,0 @@
-<?php
-/**
- * Service provider for various order admin classes.
- */
-
-namespace Automattic\WooCommerce\Internal\DependencyManagement\ServiceProviders;
-
-use Automattic\WooCommerce\Internal\Admin\Orders\COTRedirectionController;
-use Automattic\WooCommerce\Internal\Admin\Orders\Edit;
-use Automattic\WooCommerce\Internal\Admin\Orders\EditLock;
-use Automattic\WooCommerce\Internal\Admin\Orders\ListTable;
-use Automattic\WooCommerce\Internal\Admin\Orders\MetaBoxes\TaxonomiesMetaBox;
-use Automattic\WooCommerce\Internal\Admin\Orders\PageController;
-use Automattic\WooCommerce\Internal\DataStores\Orders\OrdersTableDataStore;
-use Automattic\WooCommerce\Internal\DependencyManagement\AbstractServiceProvider;
-
-/**
- * OrderAdminServiceProvider class.
- */
-class OrderAdminServiceProvider extends AbstractServiceProvider {
-
-	/**
-	 * List services provided by this class.
-	 *
-	 * @var string[]
-	 */
-	protected $provides = array(
-		COTRedirectionController::class,
-		PageController::class,
-		Edit::class,
-		ListTable::class,
-		EditLock::class,
-		TaxonomiesMetaBox::class,
-	);
-
-	/**
-	 * Registers services provided by this class.
-	 *
-	 * @return void
-	 */
-	public function register() {
-		$this->share( COTRedirectionController::class );
-		$this->share( PageController::class );
-		$this->share( Edit::class )->addArgument( PageController::class );
-		$this->share( ListTable::class )->addArguments( array( PageController::class ) );
-		$this->share( EditLock::class );
-		$this->share( TaxonomiesMetaBox::class )->addArgument( OrdersTableDataStore::class );
-	}
-}
diff --git a/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/OrderAttributionServiceProvider.php b/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/OrderAttributionServiceProvider.php
deleted file mode 100644
index 8948351132..0000000000
--- a/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/OrderAttributionServiceProvider.php
+++ /dev/null
@@ -1,54 +0,0 @@
-<?php
-declare( strict_types=1 );
-
-namespace Automattic\WooCommerce\Internal\DependencyManagement\ServiceProviders;
-
-use Automattic\WooCommerce\Internal\Features\FeaturesController;
-use Automattic\WooCommerce\Internal\Integrations\WPConsentAPI;
-use Automattic\WooCommerce\Internal\Orders\OrderAttributionController;
-use Automattic\WooCommerce\Internal\Orders\OrderAttributionBlocksController;
-use Automattic\WooCommerce\Proxies\LegacyProxy;
-use Automattic\WooCommerce\StoreApi\Schemas\ExtendSchema;
-use Automattic\WooCommerce\StoreApi\StoreApi;
-
-/**
- * Class OrderAttributionServiceProvider
- *
- * @since 8.5.0
- */
-class OrderAttributionServiceProvider extends AbstractInterfaceServiceProvider {
-
-	/**
-	 * The classes/interfaces that are serviced by this service provider.
-	 *
-	 * @var array
-	 */
-	protected $provides = array(
-		OrderAttributionController::class,
-		OrderAttributionBlocksController::class,
-		WPConsentAPI::class,
-	);
-
-	/**
-	 * Register the classes.
-	 */
-	public function register() {
-		$this->share_with_implements_tags( WPConsentAPI::class );
-		$this->share_with_implements_tags( OrderAttributionController::class )
-			->addArguments(
-				array(
-					LegacyProxy::class,
-					FeaturesController::class,
-					WPConsentAPI::class,
-				)
-			);
-		$this->share_with_implements_tags( OrderAttributionBlocksController::class )
-			->addArguments(
-				array(
-					StoreApi::container()->get( ExtendSchema::class ),
-					FeaturesController::class,
-					OrderAttributionController::class,
-				)
-			);
-	}
-}
diff --git a/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/OrderMetaBoxServiceProvider.php b/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/OrderMetaBoxServiceProvider.php
deleted file mode 100644
index e04eb73402..0000000000
--- a/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/OrderMetaBoxServiceProvider.php
+++ /dev/null
@@ -1,37 +0,0 @@
-<?php
-/**
- * Service provider for order meta boxes.
- */
-
-namespace Automattic\WooCommerce\Internal\DependencyManagement\ServiceProviders;
-
-use Automattic\WooCommerce\Internal\Admin\Orders\MetaBoxes\CustomerHistory;
-use Automattic\WooCommerce\Internal\Admin\Orders\MetaBoxes\CustomMetaBox;
-use Automattic\WooCommerce\Internal\Admin\Orders\MetaBoxes\OrderAttribution;
-use Automattic\WooCommerce\Internal\DependencyManagement\AbstractServiceProvider;
-
-/**
- * OrderMetaBoxServiceProvider class.
- */
-class OrderMetaBoxServiceProvider extends AbstractServiceProvider {
-
-	/**
-	 * The classes/interfaces that are serviced by this service provider.
-	 *
-	 * @var array
-	 */
-	protected $provides = array(
-		CustomerHistory::class,
-		CustomMetaBox::class,
-		OrderAttribution::class,
-	);
-
-	/**
-	 * Register the classes.
-	 */
-	public function register() {
-		$this->share( CustomerHistory::class );
-		$this->share( CustomMetaBox::class );
-		$this->share( OrderAttribution::class );
-	}
-}
diff --git a/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/OrdersControllersServiceProvider.php b/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/OrdersControllersServiceProvider.php
deleted file mode 100644
index 750e6ab863..0000000000
--- a/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/OrdersControllersServiceProvider.php
+++ /dev/null
@@ -1,37 +0,0 @@
-<?php
-/**
- * OrdersControllersServiceProvider class file.
- */
-
-namespace Automattic\WooCommerce\Internal\DependencyManagement\ServiceProviders;
-
-use Automattic\WooCommerce\Internal\DependencyManagement\AbstractServiceProvider;
-use Automattic\WooCommerce\Internal\Orders\CouponsController;
-use Automattic\WooCommerce\Internal\Orders\OrderActionsRestController;
-use Automattic\WooCommerce\Internal\Orders\TaxesController;
-
-/**
- * Service provider for the orders controller classes in the Automattic\WooCommerce\Internal\Orders namespace.
- */
-class OrdersControllersServiceProvider extends AbstractInterfaceServiceProvider {
-
-	/**
-	 * The classes/interfaces that are serviced by this service provider.
-	 *
-	 * @var array
-	 */
-	protected $provides = array(
-		CouponsController::class,
-		TaxesController::class,
-		OrderActionsRestController::class,
-	);
-
-	/**
-	 * Register the classes.
-	 */
-	public function register() {
-		$this->share( CouponsController::class );
-		$this->share( TaxesController::class );
-		$this->share_with_implements_tags( OrderActionsRestController::class );
-	}
-}
diff --git a/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/OrdersDataStoreServiceProvider.php b/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/OrdersDataStoreServiceProvider.php
deleted file mode 100644
index 7f55eb21e8..0000000000
--- a/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/OrdersDataStoreServiceProvider.php
+++ /dev/null
@@ -1,107 +0,0 @@
-<?php
-/**
- * OrdersDataStoreServiceProvider class file.
- */
-
-namespace Automattic\WooCommerce\Internal\DependencyManagement\ServiceProviders;
-
-use Automattic\Jetpack\Constants;
-use Automattic\WooCommerce\Caches\OrderCache;
-use Automattic\WooCommerce\Caches\OrderCacheController;
-use Automattic\WooCommerce\Caches\OrderCountCacheService;
-use Automattic\WooCommerce\Database\Migrations\CustomOrderTable\CLIRunner;
-use Automattic\WooCommerce\Database\Migrations\CustomOrderTable\PostsToOrdersMigrationController;
-use Automattic\WooCommerce\Internal\BatchProcessing\BatchProcessingController;
-use Automattic\WooCommerce\Internal\DataStores\Orders\OrdersTableRefundDataStore;
-use Automattic\WooCommerce\Internal\DependencyManagement\AbstractServiceProvider;
-use Automattic\WooCommerce\Internal\DataStores\Orders\DataSynchronizer;
-use Automattic\WooCommerce\Internal\DataStores\Orders\CustomOrdersTableController;
-use Automattic\WooCommerce\Internal\DataStores\Orders\LegacyDataCleanup;
-use Automattic\WooCommerce\Internal\DataStores\Orders\LegacyDataHandler;
-use Automattic\WooCommerce\Internal\DataStores\Orders\OrdersTableDataStore;
-use Automattic\WooCommerce\Internal\DataStores\Orders\OrdersTableDataStoreMeta;
-use Automattic\WooCommerce\Internal\Features\FeaturesController;
-use Automattic\WooCommerce\Internal\Utilities\DatabaseUtil;
-use Automattic\WooCommerce\Proxies\LegacyProxy;
-use Automattic\WooCommerce\Utilities\PluginUtil;
-
-/**
- * Service provider for the classes in the Internal\DataStores\Orders namespace.
- */
-class OrdersDataStoreServiceProvider extends AbstractServiceProvider {
-
-	/**
-	 * The classes/interfaces that are serviced by this service provider.
-	 *
-	 * @var array
-	 */
-	protected $provides = array(
-		DataSynchronizer::class,
-		CustomOrdersTableController::class,
-		OrdersTableDataStore::class,
-		CLIRunner::class,
-		OrdersTableDataStoreMeta::class,
-		OrdersTableRefundDataStore::class,
-		OrderCache::class,
-		OrderCacheController::class,
-		OrderCountCacheService::class,
-		LegacyDataHandler::class,
-		LegacyDataCleanup::class,
-	);
-
-	/**
-	 * Register the classes.
-	 */
-	public function register() {
-		$this->share( OrdersTableDataStoreMeta::class );
-
-		$this->share( OrdersTableDataStore::class )->addArguments( array( OrdersTableDataStoreMeta::class, DatabaseUtil::class, LegacyProxy::class ) );
-		$this->share( DataSynchronizer::class )->addArguments(
-			array(
-				OrdersTableDataStore::class,
-				DatabaseUtil::class,
-				PostsToOrdersMigrationController::class,
-				LegacyProxy::class,
-				OrderCacheController::class,
-				BatchProcessingController::class,
-				OrderCountCacheService::class,
-			)
-		);
-		$this->share( OrdersTableRefundDataStore::class )->addArguments( array( OrdersTableDataStoreMeta::class, DatabaseUtil::class, LegacyProxy::class ) );
-		$this->share( CustomOrdersTableController::class )->addArguments(
-			array(
-				OrdersTableDataStore::class,
-				DataSynchronizer::class,
-				LegacyDataCleanup::class,
-				OrdersTableRefundDataStore::class,
-				BatchProcessingController::class,
-				FeaturesController::class,
-				OrderCache::class,
-				OrderCacheController::class,
-				PluginUtil::class,
-				DatabaseUtil::class,
-			)
-		);
-		$this->share( OrderCache::class );
-		$this->share( OrderCacheController::class )->addArgument( OrderCache::class );
-		$this->share( OrderCountCacheService::class )->addArgument();
-		if ( Constants::is_defined( 'WP_CLI' ) && WP_CLI ) {
-			$this->share( CLIRunner::class )->addArguments( array( CustomOrdersTableController::class, DataSynchronizer::class, PostsToOrdersMigrationController::class ) );
-		}
-
-		$this->share( LegacyDataCleanup::class )->addArguments(
-			array(
-				BatchProcessingController::class,
-				LegacyDataHandler::class,
-				DataSynchronizer::class,
-			)
-		);
-		$this->share( LegacyDataHandler::class )->addArguments(
-			array(
-				OrdersTableDataStore::class,
-				DataSynchronizer::class,
-				PostsToOrdersMigrationController::class,
-			)
-		);
-	}
-}
diff --git a/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/ProductAttributesLookupServiceProvider.php b/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/ProductAttributesLookupServiceProvider.php
deleted file mode 100644
index adc47532c1..0000000000
--- a/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/ProductAttributesLookupServiceProvider.php
+++ /dev/null
@@ -1,40 +0,0 @@
-<?php
-/**
- * ProductAttributesLookupServiceProvider class file.
- */
-
-namespace Automattic\WooCommerce\Internal\DependencyManagement\ServiceProviders;
-
-use Automattic\WooCommerce\Internal\DependencyManagement\AbstractServiceProvider;
-use Automattic\WooCommerce\Internal\ProductAttributesLookup\CLIRunner;
-use Automattic\WooCommerce\Internal\ProductAttributesLookup\DataRegenerator;
-use Automattic\WooCommerce\Internal\ProductAttributesLookup\Filterer;
-use Automattic\WooCommerce\Internal\ProductAttributesLookup\LookupDataStore;
-
-/**
- * Service provider for the ProductAttributesLookupServiceProvider namespace.
- */
-class ProductAttributesLookupServiceProvider extends AbstractServiceProvider {
-
-	/**
-	 * The classes/interfaces that are serviced by this service provider.
-	 *
-	 * @var array
-	 */
-	protected $provides = array(
-		DataRegenerator::class,
-		Filterer::class,
-		LookupDataStore::class,
-		CLIRunner::class,
-	);
-
-	/**
-	 * Register the classes.
-	 */
-	public function register() {
-		$this->share( DataRegenerator::class )->addArgument( LookupDataStore::class );
-		$this->share( Filterer::class )->addArgument( LookupDataStore::class );
-		$this->share( LookupDataStore::class );
-		$this->share( CLIRunner::class )->addArguments( array( DataRegenerator::class, LookupDataStore::class ) );
-	}
-}
diff --git a/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/ProductDownloadsServiceProvider.php b/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/ProductDownloadsServiceProvider.php
deleted file mode 100644
index 3b8eb46a52..0000000000
--- a/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/ProductDownloadsServiceProvider.php
+++ /dev/null
@@ -1,36 +0,0 @@
-<?php
-
-namespace Automattic\WooCommerce\Internal\DependencyManagement\ServiceProviders;
-
-use Automattic\WooCommerce\Internal\DependencyManagement\AbstractServiceProvider;
-use Automattic\WooCommerce\Internal\ProductDownloads\ApprovedDirectories\Admin\SyncUI;
-use Automattic\WooCommerce\Internal\ProductDownloads\ApprovedDirectories\Admin\UI;
-use Automattic\WooCommerce\Internal\ProductDownloads\ApprovedDirectories\Register;
-use Automattic\WooCommerce\Internal\ProductDownloads\ApprovedDirectories\Synchronize;
-
-/**
- * Service provider for the Product Downloads-related services.
- */
-class ProductDownloadsServiceProvider extends AbstractServiceProvider {
-	/**
-	 * The classes/interfaces that are serviced by this service provider.
-	 *
-	 * @var array
-	 */
-	protected $provides = array(
-		Register::class,
-		Synchronize::class,
-		SyncUI::class,
-		UI::class,
-	);
-
-	/**
-	 * Register the classes.
-	 */
-	public function register() {
-		$this->share( Register::class );
-		$this->share( Synchronize::class )->addArgument( Register::class );
-		$this->share( SyncUI::class )->addArgument( Register::class );
-		$this->share( UI::class )->addArgument( Register::class );
-	}
-}
diff --git a/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/ProductFiltersServiceProvider.php b/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/ProductFiltersServiceProvider.php
deleted file mode 100644
index b195a75976..0000000000
--- a/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/ProductFiltersServiceProvider.php
+++ /dev/null
@@ -1,35 +0,0 @@
-<?php
-declare(strict_types=1);
-
-namespace Automattic\WooCommerce\Internal\DependencyManagement\ServiceProviders;
-
-use Automattic\WooCommerce\Internal\ProductFilters\MainQueryController;
-use Automattic\WooCommerce\Internal\ProductFilters\FilterDataProvider;
-use Automattic\WooCommerce\Internal\ProductFilters\QueryClauses;
-
-/**
- * ProductFiltersServiceProvider class.
- */
-class ProductFiltersServiceProvider extends AbstractInterfaceServiceProvider {
-	/**
-	 * List services provided by this class.
-	 *
-	 * @var string[]
-	 */
-	protected $provides = array(
-		QueryClauses::class,
-		MainQueryController::class,
-		FilterDataProvider::class,
-	);
-
-	/**
-	 * Registers services provided by this class.
-	 *
-	 * @return void
-	 */
-	public function register() {
-		$this->share( QueryClauses::class );
-		$this->share_with_implements_tags( MainQueryController::class )->addArgument( QueryClauses::class );
-		$this->share( FilterDataProvider::class );
-	}
-}
diff --git a/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/ProductImageBySKUServiceProvider.php b/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/ProductImageBySKUServiceProvider.php
deleted file mode 100644
index e4f7267cae..0000000000
--- a/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/ProductImageBySKUServiceProvider.php
+++ /dev/null
@@ -1,31 +0,0 @@
-<?php
-/**
- * ProductImageBySKUServiceProvider class file.
- */
-
-namespace Automattic\WooCommerce\Internal\DependencyManagement\ServiceProviders;
-
-use Automattic\WooCommerce\Internal\DependencyManagement\AbstractServiceProvider;
-use Automattic\WooCommerce\Internal\ProductImage\MatchImageBySKU;
-
-/**
- * Service provider for the ProductImageBySKUServiceProvider namespace.
- */
-class ProductImageBySKUServiceProvider extends AbstractServiceProvider {
-
-	/**
-	 * The classes/interfaces that are serviced by this service provider.
-	 *
-	 * @var array
-	 */
-	protected $provides = array(
-		MatchImageBySKU::class,
-	);
-
-	/**
-	 * Register the classes.
-	 */
-	public function register() {
-		$this->share( MatchImageBySKU::class );
-	}
-}
diff --git a/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/ProductReviewsServiceProvider.php b/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/ProductReviewsServiceProvider.php
deleted file mode 100644
index 391fd257fb..0000000000
--- a/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/ProductReviewsServiceProvider.php
+++ /dev/null
@@ -1,34 +0,0 @@
-<?php
-/**
- * OrdersDataStoreServiceProvider class file.
- */
-
-namespace Automattic\WooCommerce\Internal\DependencyManagement\ServiceProviders;
-
-use Automattic\WooCommerce\Internal\Admin\ProductReviews\Reviews;
-use Automattic\WooCommerce\Internal\Admin\ProductReviews\ReviewsCommentsOverrides;
-use Automattic\WooCommerce\Internal\DependencyManagement\AbstractServiceProvider;
-
-/**
- * Service provider for the classes in the Internal\Admin\ProductReviews namespace.
- */
-class ProductReviewsServiceProvider extends AbstractServiceProvider {
-
-	/**
-	 * The classes/interfaces that are serviced by this service provider.
-	 *
-	 * @var array
-	 */
-	protected $provides = array(
-		Reviews::class,
-		ReviewsCommentsOverrides::class,
-	);
-
-	/**
-	 * Register the classes.
-	 */
-	public function register() {
-		$this->share( Reviews::class );
-		$this->share( ReviewsCommentsOverrides::class );
-	}
-}
diff --git a/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/ProxiesServiceProvider.php b/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/ProxiesServiceProvider.php
deleted file mode 100644
index 4e2823d5e0..0000000000
--- a/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/ProxiesServiceProvider.php
+++ /dev/null
@@ -1,34 +0,0 @@
-<?php
-/**
- * ProxiesServiceProvider class file.
- */
-
-namespace Automattic\WooCommerce\Internal\DependencyManagement\ServiceProviders;
-
-use Automattic\WooCommerce\Internal\DependencyManagement\AbstractServiceProvider;
-use Automattic\WooCommerce\Proxies\LegacyProxy;
-use Automattic\WooCommerce\Proxies\ActionsProxy;
-
-/**
- * Service provider for the classes in the Automattic\WooCommerce\Proxies namespace.
- */
-class ProxiesServiceProvider extends AbstractServiceProvider {
-
-	/**
-	 * The classes/interfaces that are serviced by this service provider.
-	 *
-	 * @var array
-	 */
-	protected $provides = array(
-		LegacyProxy::class,
-		ActionsProxy::class,
-	);
-
-	/**
-	 * Register the classes.
-	 */
-	public function register() {
-		$this->share( ActionsProxy::class );
-		$this->share_with_auto_arguments( LegacyProxy::class );
-	}
-}
diff --git a/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/RestockRefundedItemsAdjusterServiceProvider.php b/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/RestockRefundedItemsAdjusterServiceProvider.php
deleted file mode 100644
index 08d9f5e892..0000000000
--- a/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/RestockRefundedItemsAdjusterServiceProvider.php
+++ /dev/null
@@ -1,31 +0,0 @@
-<?php
-/**
- * RestockRefundedItemsAdjusterServiceProvider class file.
- */
-
-namespace Automattic\WooCommerce\Internal\DependencyManagement\ServiceProviders;
-
-use Automattic\WooCommerce\Internal\DependencyManagement\AbstractServiceProvider;
-use Automattic\WooCommerce\Internal\RestockRefundedItemsAdjuster;
-
-/**
- * Service provider for the RestockRefundedItemsAdjuster class.
- */
-class RestockRefundedItemsAdjusterServiceProvider extends AbstractServiceProvider {
-
-	/**
-	 * The classes/interfaces that are serviced by this service provider.
-	 *
-	 * @var array
-	 */
-	protected $provides = array(
-		RestockRefundedItemsAdjuster::class,
-	);
-
-	/**
-	 * Register the classes.
-	 */
-	public function register() {
-		$this->share( RestockRefundedItemsAdjuster::class );
-	}
-}
diff --git a/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/StatsServiceProvider.php b/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/StatsServiceProvider.php
deleted file mode 100644
index 793fdf9418..0000000000
--- a/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/StatsServiceProvider.php
+++ /dev/null
@@ -1,33 +0,0 @@
-<?php
-/**
- * StatsServiceProvider class file.
- */
-
-declare( strict_types = 1 );
-
-namespace Automattic\WooCommerce\Internal\DependencyManagement\ServiceProviders;
-
-use Automattic\WooCommerce\Internal\DependencyManagement\AbstractServiceProvider;
-use Automattic\WooCommerce\Internal\McStats;
-
-/**
- * Service provider for the Stats.
- */
-class StatsServiceProvider extends AbstractServiceProvider {
-
-	/**
-	 * The classes/interfaces that are serviced by this service provider.
-	 *
-	 * @var array
-	 */
-	protected $provides = array(
-		McStats::class,
-	);
-
-	/**
-	 * Register the classes.
-	 */
-	public function register() {
-		$this->add( McStats::class );
-	}
-}
diff --git a/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/UtilsClassesServiceProvider.php b/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/UtilsClassesServiceProvider.php
deleted file mode 100644
index 76f53b17fa..0000000000
--- a/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/UtilsClassesServiceProvider.php
+++ /dev/null
@@ -1,63 +0,0 @@
-<?php
-/**
- * UtilsClassesServiceProvider class file.
- */
-
-namespace Automattic\WooCommerce\Internal\DependencyManagement\ServiceProviders;
-
-use Automattic\WooCommerce\Internal\DataStores\Orders\CustomOrdersTableController;
-use Automattic\WooCommerce\Internal\DataStores\Orders\DataSynchronizer;
-use Automattic\WooCommerce\Internal\DependencyManagement\AbstractServiceProvider;
-use Automattic\WooCommerce\Internal\Utilities\COTMigrationUtil;
-use Automattic\WooCommerce\Internal\Utilities\DatabaseUtil;
-use Automattic\WooCommerce\Internal\Utilities\HtmlSanitizer;
-use Automattic\WooCommerce\Internal\Utilities\LegacyRestApiStub;
-use Automattic\WooCommerce\Internal\Utilities\PluginInstaller;
-use Automattic\WooCommerce\Internal\Utilities\WebhookUtil;
-use Automattic\WooCommerce\Proxies\LegacyProxy;
-use Automattic\WooCommerce\Utilities\PluginUtil;
-use Automattic\WooCommerce\Utilities\OrderUtil;
-use Automattic\WooCommerce\Utilities\RestApiUtil;
-use Automattic\WooCommerce\Utilities\TimeUtil;
-
-/**
- * Service provider for the non-static utils classes in the Automattic\WooCommerce\src namespace.
- */
-class UtilsClassesServiceProvider extends AbstractInterfaceServiceProvider {
-
-	/**
-	 * The classes/interfaces that are serviced by this service provider.
-	 *
-	 * @var array
-	 */
-	protected $provides = array(
-		DatabaseUtil::class,
-		HtmlSanitizer::class,
-		OrderUtil::class,
-		PluginUtil::class,
-		COTMigrationUtil::class,
-		WebhookUtil::class,
-		RestApiUtil::class,
-		TimeUtil::class,
-		PluginInstaller::class,
-		LegacyRestApiStub::class,
-	);
-
-	/**
-	 * Register the classes.
-	 */
-	public function register() {
-		$this->share( DatabaseUtil::class );
-		$this->share( HtmlSanitizer::class );
-		$this->share( OrderUtil::class );
-		$this->share( PluginUtil::class )
-			->addArgument( LegacyProxy::class );
-		$this->share( COTMigrationUtil::class )
-			->addArguments( array( CustomOrdersTableController::class, DataSynchronizer::class ) );
-		$this->share( WebhookUtil::class );
-		$this->share( RestApiUtil::class );
-		$this->share( TimeUtil::class );
-		$this->share_with_implements_tags( PluginInstaller::class );
-		$this->share_with_implements_tags( LegacyRestApiStub::class )->addArgument( RestApiUtil::class );
-	}
-}
diff --git a/plugins/woocommerce/src/Internal/RestApiControllerBase.php b/plugins/woocommerce/src/Internal/RestApiControllerBase.php
index 7968dbc63b..3706dccb2b 100644
--- a/plugins/woocommerce/src/Internal/RestApiControllerBase.php
+++ b/plugins/woocommerce/src/Internal/RestApiControllerBase.php
@@ -14,11 +14,7 @@ use Exception;
 /**
  * Base class for REST API controllers defined inside the 'src' directory.
  *
- * Besides implementing the abstract methods, derived classes must be registered in the dependency injection
- * container with the 'share_with_implements_tags' method inside a service provider that inherits from
- * 'AbstractInterfaceServiceProvider'. This ensures that 'register_routes' is invoked.
- *
- * Also, the following must be added at the end of the 'init_hooks' method in the 'WooCommerce' class,
+ * The following must be added at the end of the 'init_hooks' method in the 'WooCommerce' class,
  * otherwise the routes won't be registered:
  * $container->get( <full class name>::class )->register();
  *
diff --git a/plugins/woocommerce/src/Proxies/LegacyProxy.php b/plugins/woocommerce/src/Proxies/LegacyProxy.php
index 2edcdbd705..f9a41cb4fc 100644
--- a/plugins/woocommerce/src/Proxies/LegacyProxy.php
+++ b/plugins/woocommerce/src/Proxies/LegacyProxy.php
@@ -7,7 +7,6 @@ namespace Automattic\WooCommerce\Proxies;

 use Automattic\WooCommerce\Internal\DependencyManagement\Definition;
 use Automattic\WooCommerce\Utilities\StringUtil;
-use Automattic\WooCommerce\Vendor\Psr\Container\ContainerInterface;

 /**
  * Proxy class to access legacy WooCommerce functionality.
@@ -38,7 +37,7 @@ class LegacyProxy {
 		if ( StringUtil::starts_with( $class_name, 'Automattic\\WooCommerce\\' ) ) {
 			throw new \Exception(
 				'The LegacyProxy class is not intended for getting instances of classes whose namespace starts with \'Automattic\\WooCommerce\', please use ' .
-				Definition::INJECTION_METHOD . ' method injection or the instance of ' . ContainerInterface::class . ' for that.'
+				'\'init\' method injection or \'wc_get_container()->get()\' for that.'
 			);
 		}

diff --git a/plugins/woocommerce/src/README.md b/plugins/woocommerce/src/README.md
index afa6d5fa6e..57f4b425b2 100644
--- a/plugins/woocommerce/src/README.md
+++ b/plugins/woocommerce/src/README.md
@@ -7,12 +7,11 @@
     * [Updating the autoloader class maps](#updating-the-autoloader-class-maps)
 * [Installing packages](#installing-packages)
 * [The container](#the-container)
-    * [Resolving classes](#resolving-classes)
+    * [Retrieving classes](#retrieving-classes)
         * [From other classes in the `src` directory](#1-other-classes-in-the-src-directory)
         * [From code in the `includes` directory](#2-code-in-the-includes-directory)
-    * [Registering classes](#registering-classes)
-        * [Using concretes](#using-concretes)
         * [A note on legacy classes](#a-note-on-legacy-classes)
+    * [Historical note](#historical-note)
 * [The `Internal` namespace](#the-internal-namespace)
 * [Interacting with legacy code](#interacting-with-legacy-code)
     * [The `LegacyProxy` class](#the-legacyproxy-class)
@@ -67,39 +66,21 @@ composer update

 ## The container

-### Important notice
+WooCommerce uses a [PSR-11](https://www.php-fig.org/psr/psr-11/) compatible container for retrieving instances of all the classes in this directory by using the [dependency injection](https://en.wikipedia.org/wiki/Dependency_injection) pattern. This container is very simple: explicit class registration is not needed, any class in the `Automattic\Woocommerce` namespace can be retrieved and reflection is used to locate and instantiate classes and their dependencies.

-As of version 9.5 WooCommerce uses a new, simpler, custom-made container instead of the old one based on the PHP League's Container package. However, the old container is still in place and it's possible to configure WooCommerce to use it (instead of the new container) by adding one of these snippets:
+The container assumes that all the retrieved classes are single-instance classes: the class will be instantiated the first time it's requested, and further requests will serve a cached version of the created instance. Thus for data-only classes for which multiple instances may be needed, instances should be created directly with `new` instead.

-1. `define('WOOCOMMERCE_USE_OLD_DI_CONTAINER', true);`
-2. `add_filter('woocommerce_use_old_di_container', '__return_true');`
+The term "resolve a class" used in this document means instantiating and caching the class if needed, then returning the cached instance of the class.

-This should be done **only** if a problem with the new container causes disruption in the site *(and if you discover such a problem, please [create an issue in GitHub](https://github.com/woocommerce/woocommerce/issues/new) so that we can keep track of it and work on a fix)*. This fallback mechanism, together with the old container and the PHP League's Container package, will be removed in WooCommerce 10.0.
+See [Writing unit tests](#writing-unit-tests) for information on how to mock/replace class dependencies in unit tests.

-The new container is used in the same way as the old one: it's only for classes in the `src` directory, dependencies are defined in an `init` method of the classes, the container exposes a `get` method and a `has` method, and `wc_get_container` can be used to use the container from [legacy code](https://github.com/woocommerce/woocommerce/blob/trunk/plugins/woocommerce/includes/README.md/?rgh-link-date=2024-10-29T14%3A32%3A58Z#L6-L7); the difference is that explicit class registration is not needed anymore (any class in the `Automattic\Woocommerce` namespace can be resolved). **However**, until WooCommerce 10.0 arrives please keep registering new classes using service providers as instructed below, so that the old container can be used if needed.
+### Retrieving classes

-As for the unit tests, they can be forced to use the old container by defining the `USE_OLD_DI_CONTAINER` environment variable.
-
-#### End of important notice
-
-WooCommerce uses a [PSR-11](https://www.php-fig.org/psr/psr-11/) compatible container for registering and resolving all the classes in this directory by using the [dependency injection](https://en.wikipedia.org/wiki/Dependency_injection) pattern. More specifically, we use [the container from The PHP League](https://container.thephpleague.com/); this is relevant when registering classes, but not when resolving them. The full class name of the container used is `Automattic\WooCommerce\Container` (it uses the PHP League's container under the hood).
-
-*Resolving* a class means asking the container to provide an instance of the class (or interface). *Registering* a class means telling the container how the class should be resolved.
-
-In principle, the container should be used to register and resolve all the classes in the `src` directory. The exception might be data-only classes that could be created the old way (using a plain `new` statement); but as a rule of thumb, the container should always be used.
-
-There are two ways to resolve registered classes, depending on from where they are resolved:
-
-* Classes in the `src` directory specify their dependencies as `init` arguments, which are automatically supplied by the container when the class is resolved (this is called *dependency injection*).
-* For code in the `includes` directory there's a `wc_get_container` function that will return the container, then its `get` method can be used to resolve any class.
-
-### Resolving classes
-
-There are two ways to resolve registered classes, depending on from where they need to be resolved:
+There are two ways to retrieve classes, depending on how they need to be resolved:

 #### 1. Other classes in the `src` directory

-When a class in the `src` directory depends on other one classes from the same directory, it should use method injection. This means specifying these dependencies as arguments in a `init` method with appropriate type hints, and storing these in private variables, ready to be used when needed:
+When a class in the `src` directory depends on other one classes that are also in `src`, it should use method injection. This means specifying these dependencies as arguments in a `init` method with appropriate type hints, and storing these in private variables, ready to be used when needed:

 ```php
 use TheService1Namespace\Service1;
@@ -145,7 +126,7 @@ In general, however, method injection is strongly preferred and the lazy approac

 #### 2. Code in the `includes` directory

-When you need to use classes defined in the `src` directory from within legacy code in `includes`, use the `wc_get_container` function to get the instance of the container, then resolve the required class with `get`:
+When you need to use classes defined in the `src` directory from within legacy code in `includes`, use the `wc_get_container` function to get the instance of the container, then retrieve the required class with `get`:

 ```php
 use TheService1Namespace\Service1;
@@ -158,128 +139,17 @@ function wc_function_that_needs_service_1() {

 This is also the recommended approach when moving code from `includes` to `src` while keeping the existing entry points for the old code in place for compatibility.

-Worth noting: the container will throw a `ContainerException` when receiving a request for resolving a class that hasn't been registered. All classes need to have been registered prior to being resolved.
-
-### Registering classes
-
-For a class to be resolvable using the container, it needs to have been previously registered in the same container.
-
-The `Container` class is "read-only", in that it has a `get` method to resolve classes but it doesn't have any method to register classes. Instead, class registration is done by using [service providers](https://container.thephpleague.com/3.x/service-providers/). That's how the whole process would go when creating a new class:
-
-First, create the class in the appropriate namespace (and thus in the matching folder), remember that the base namespace for the classes in the `src` directory is `Automattic\WooCommerce`. If the class depends on other classes from `src`, specify these dependencies as `init` arguments in detailed above.
-
-Example of such a class:
-
-```php
-namespace Automattic\WooCommerce\TheClassNamespace;
-use Automattic\WooCommerce\TheDependencyNamespace\TheDependencyClass;
-
-
-class TheClass {
-    private $the_dependency;
-
-    public function init( TheDependencyClass $dependency ) {
-        $this->the_dependency = $dependency;
-    }
-
-}
-```
-
-Then, create a `<class name>ServiceProvider` class in the `src/Internal/DependencyManagement/ServiceProviders` folder (and thus in the appropriate namespace) as follows:
-
-```php
-namespace Automattic\WooCommerce\Internal\DependencyManagement\ServiceProviders;
-
-use Automattic\WooCommerce\Internal\DependencyManagement\AbstractServiceProvider;
-use Automattic\WooCommerce\TheClassNamespace\TheClass;
-use Automattic\WooCommerce\TheDependencyNamespace\TheDependencyClass;
-
-class TheClassServiceProvider extends AbstractServiceProvider {
-
-    protected $provides = array(
-        TheClass::class
-    );
-
-    public function register() {
-        $this->add( TheClass::class )->addArgument( TheDependencyClass::class );
-    }
-}
-```
-
-Last (but certainly not least, don't forget this step!), add the class name of the service provider to the array returned by the `get_service_providers` method in the `Container` class.
+Worth noting: the container will throw a `ContainerException` when receiving a request for retrieving a class that doesn't exist or is not in the `Automattic\Woocommerce` namespace, or when there's an error preventing the instantiation (for example the class doesn't have a public constructor). You can use the container `has` method to verify that a given class can actually be retrieved, but this method will only verify that the class exists and is in the correct namespace.

-Worth noting:
-
-* In the example the service provider is used to register only one class, but service providers can be used to register a group of related classes. The `$provides` property must contain all the names of the classes that the provider can register.
-* The container will invoke the provider `register` method the first time any of the classes in `$provides` is resolved.
-* If you look at [the service provider documentation](https://container.thephpleague.com/3.x/service-providers/) you will see that classes are registered using `this->getContainer()->add`. WooCommerce's `AbstractServiceProvider` adds a utility `add` method itself that serves the same purpose.
-* You can use `share` instead of `add` to register single-instance classes (the class is instantiated only once and cached, so the same instance is returned every time the class is resolved).
-
-If the class being registered has `init` arguments then the `add` (or `share`) method must be followed by as many `addArguments` calls as needed. WooCommerce's `AbstractServiceProvider` adds a utility `add_with_auto_arguments` method (and a sibling `share_with_auto_arguments` method) that uses reflection to figure out and register all the `init` arguments (which need to have type hints). Please have in mind the possible performance penalty incurred by the usage of reflection when using this helper method.
-
-An alternative version of the service provider, which is used to register both the class and its dependency, and which takes advantage of `add_with_auto_arguments`, could be as follows:
-
-```php
-namespace Automattic\WooCommerce\Internal\DependencyManagement\ServiceProviders;
-
-use Automattic\WooCommerce\Internal\DependencyManagement\AbstractServiceProvider;
-use Automattic\WooCommerce\TheClassNamespace\TheClass;
-use Automattic\WooCommerce\TheDependencyNamespace\TheDependencyClass;
-
-class TheClassServiceProvider extends AbstractServiceProvider {
-
-    protected $provides = array(
-        TheClass::class,
-        TheDependencyClass::class
-    );
-
-    public function register() {
-        $this->share( TheDependencyClass::class );
-        $this->share_with_auto_arguments( ActionsProxy::class );
-    }
-}
-```
-
-#### Using concretes
-
-By default, the `add` and `share` methods instruct the container to resolve the registered class by using `new` to create a new instance of the class. But these methods accept an optional `$concrete` argument that can be used to tell the container to resolve the class in a different way. `$concrete` may be one of the following:
-
-* A class name
-
-The supplied class name will be instantiated when the registered class name is resolved. This is especially useful to register interfaces, example:
-
-```php
-$this->add( TheInterface::class, TheClassImplementingTheInterface::class );
-```
-
-* An object
-
-The supplied object will be returned then the registered class name is resolved. Example:
-
-```php
-$instance = new TheClass();
-$this->add( TheClass::class, $instance );
-```
-
-* A closure
-
-The closure will be executed and the result value will be returned when the registered class name is resolved. Example:
-
-```php
-$factory = function( TheDependencyClass $dependency ) {
-    return new TheClass( $dependency );
-};
-
-$this->add( TheClass::class, $factory );
-```
+#### A note on legacy classes

-Note that if the closure is defined as a function with arguments, the supplied parameters will be resolved too.
+The container is intended for retrieving **only** classes in the `src` folder, or put another way, classes in the `Automattic\Woocommerce` namespace. An attempt to retrieve a class that is not in that namespace will throw an exception.

-#### A note on legacy classes
+This implies that classes outside `src` can't be dependency-injected, and thus must not be used as type hints in `init` arguments. There are mechanisms in place to interact with "outside" code (including code from the `includes` folder and third-party code) in a way that makes it easy to write unit tests - see [The `LegacyProxy` class](#the-legacyproxy-class).

-The container is intended for registering **only** classes in the `src` folder. There is a check in place to prevent classes outside the root `Automattic\Woocommerce` namespace from being registered.
+### Historical note

-This implies that classes outside `src` can't be dependency-injected, and thus must not be used as type hints in `init` arguments. There are mechanisms in place to interact with "outside" code (including code from the `includes` folder and third-party code) in a way that makes it easy to write unit tests.
+In previous versions WooCommerce used [the PHP League's Container package](https://container.thephpleague.com/) as the underlying dependency injection engine, requiring explicit registration for all the classes intended to be retrieved using it. The new simplified container [was introduced in WooCommerce 9.5](https://developer.woocommerce.com/2024/11/15/developer-advisory-changes-to-the-dependency-injection-container-in-woocommerce/), while the old container package and all the related infrastructure code was removed in WooCommerce 10.0.

 ## The `Internal` namespace

@@ -349,7 +219,7 @@ Both ways are completely equivalent since the helper methods are just doing `wc_

 ### Using the mockable proxy in tests

-When unit tests run the container will return an instance of `MockableLegacyProxy` when `LegacyProxy` is resolved. This class has the same public methods as `LegacyProxy` but also the following ones:
+When unit tests run the container will return an instance of `MockableLegacyProxy` when `LegacyProxy` is retrieved. This class has the same public methods as `LegacyProxy` but also the following ones:

 * `register_class_mocks`: defines mocks for classes that are retrieved via `get_instance_of`.
 * `register_function_mocks`: defines mocks for functions that are invoked via `call_function`.
@@ -378,7 +248,7 @@ Please see [the code of the MockableLegacyProxy class](https://github.com/woocom

 ### But how does `get_instance_of` work?

-We use a container to resolve instances of classes in the `src` directory, but how does the legacy proxy's `get_instance_of` know how to resolve legacy classes?
+We use a container to retrieve instances of classes in the `src` directory, but how does the legacy proxy's `get_instance_of` know how to resolve legacy classes?

 This is a mostly ad-hoc process. When a class has a special way to be instantiated or retrieved (e.g. a static `instance` method), then that is used; otherwise the method fallbacks to simply creating a new instance of the class using `new`.

diff --git a/plugins/woocommerce/tests/legacy/bootstrap.php b/plugins/woocommerce/tests/legacy/bootstrap.php
index bc04301016..bb832a80b5 100644
--- a/plugins/woocommerce/tests/legacy/bootstrap.php
+++ b/plugins/woocommerce/tests/legacy/bootstrap.php
@@ -38,12 +38,6 @@ class WC_Unit_Tests_Bootstrap {
 	 * @since 2.2
 	 */
 	public function __construct() {
-		$use_old_container = false;
-		if ( getenv( 'USE_OLD_DI_CONTAINER' ) ) {
-			define( 'WOOCOMMERCE_USE_OLD_DI_CONTAINER', true );
-			$use_old_container = true;
-		}
-
 		$this->tests_dir  = __DIR__;
 		$this->plugin_dir = dirname( dirname( $this->tests_dir ) );

@@ -105,7 +99,7 @@ class WC_Unit_Tests_Bootstrap {
 		$this->includes();

 		// re-initialize dependency injection, this needs to be the last operation after everything else is in place.
-		$this->initialize_dependency_injection( $use_old_container );
+		$this->initialize_dependency_injection();

 		if ( getenv( 'HPOS' ) ) {
 			$this->initialize_hpos();
@@ -198,11 +192,9 @@ class WC_Unit_Tests_Bootstrap {
 	 *
 	 * Note also that TestingContainer replaces the instance of LegacyProxy with an instance of MockableLegacyProxy.
 	 *
-	 * @param bool $use_old_container The underlying container is the old ExtendedContainer class. This parameter will disappear in WooCommerce 10.0.
-	 *
 	 * @throws \Exception The Container class doesn't have a 'container' property.
 	 */
-	private function initialize_dependency_injection( bool $use_old_container ) {
+	private function initialize_dependency_injection() {
 		try {
 			$inner_container_property = new \ReflectionProperty( \Automattic\WooCommerce\Container::class, 'container' );
 		} catch ( ReflectionException $ex ) {
@@ -213,12 +205,8 @@ class WC_Unit_Tests_Bootstrap {

 		$container       = wc_get_container();
 		$inner_container = $inner_container_property->getValue( $container );
-		if ( $use_old_container ) {
-			$inner_container->replace( LegacyProxy::class, MockableLegacyProxy::class );
-		} else {
-			$inner_container = new TestingContainer( $inner_container );
-			$inner_container_property->setValue( $container, $inner_container );
-		}
+		$inner_container = new TestingContainer( $inner_container );
+		$inner_container_property->setValue( $container, $inner_container );

 		$GLOBALS['wc_container'] = $inner_container;
 	}
diff --git a/plugins/woocommerce/tests/php/src/Internal/DependencyManagement/AbstractInterfaceServiceProviderTest.php b/plugins/woocommerce/tests/php/src/Internal/DependencyManagement/AbstractInterfaceServiceProviderTest.php
deleted file mode 100644
index 9c71ffe156..0000000000
--- a/plugins/woocommerce/tests/php/src/Internal/DependencyManagement/AbstractInterfaceServiceProviderTest.php
+++ /dev/null
@@ -1,215 +0,0 @@
-<?php
-/**
- * AbstractInterfaceServiceProviderTest class file.
- */
-
-namespace Automattic\WooCommerce\Tests\Internal\DependencyManagement;
-
-use Automattic\WooCommerce\Internal\DependencyManagement\ContainerException;
-use Automattic\WooCommerce\Internal\DependencyManagement\ExtendedContainer;
-use Automattic\WooCommerce\Internal\DependencyManagement\ServiceProviders\AbstractInterfaceServiceProvider;
-use Automattic\WooCommerce\Tests\Internal\DependencyManagement\ExampleClasses\AnotherClassInterface;
-use Automattic\WooCommerce\Tests\Internal\DependencyManagement\ExampleClasses\ClassInterface;
-use Automattic\WooCommerce\Tests\Internal\DependencyManagement\ExampleClasses\ClassWithInterface;
-use Automattic\WooCommerce\Tests\Internal\DependencyManagement\ExampleClasses\ClassWithMultipleInterfaces;
-use Automattic\WooCommerce\Tests\Internal\DependencyManagement\ExampleClasses\ClassWithNoInterface;
-use Automattic\WooCommerce\Vendor\League\Container\Definition\DefinitionInterface;
-use stdClass;
-
-/**
- * Tests for AbstractInterfaceServiceProvider.
- */
-class AbstractInterfaceServiceProviderTest extends \WC_Unit_Test_Case {
-
-	/**
-	 * The system under test.
-	 *
-	 * @var AbstractInterfaceServiceProvider
-	 */
-	private $sut;
-
-	/**
-	 * The container used for tests.
-	 *
-	 * @var ExtendedContainer
-	 */
-	private $container;
-
-	/**
-	 * Runs before each test.
-	 */
-	public function setUp(): void {
-		$this->container = new ExtendedContainer();
-
-		$this->sut = new class() extends AbstractInterfaceServiceProvider {
-			// phpcs:disable
-
-			public $provides = [
-				ClassWithInterface::class,
-				ClassWithMultipleInterfaces::class,
-				ClassWithNoInterface::class,
-			];
-
-			/**
-			 * Register a class in the container and add tags for all the interfaces it implements.
-			 *
-			 * @param string    $id         Entry ID (typically a class or interface name).
-			 * @param mixed     $concrete   Concrete entity to register under that ID, null for automatic creation.
-			 * @param bool|null $shared     Whether to register the class as shared (`get` always returns the same instance).
-			 *
-			 * @return DefinitionInterface
-			 */
-			public function add_with_implements_tags( string $id, $concrete = null, ?bool $shared = null ): DefinitionInterface {
-				return parent::add_with_implements_tags( $id, $concrete, $shared );
-			}
-
-			/**
-			 * Register a class in the container and add tags for all the interfaces it implements.
-			 *
-			 * @param string    $id         Entry ID (typically a class or interface name).
-			 * @param mixed     $concrete   Concrete entity to register under that ID, null for automatic creation.
-			 *
-			 * @return DefinitionInterface
-			 */
-			public function share_with_implements_tags( string $id, $concrete = null ): DefinitionInterface {
-				return parent::share_with_implements_tags( $id, $concrete );
-			}
-
-			/**
-			 * The mandatory 'register' method (defined in the base class as abstract).
-			 * Not implemented because this class is tested on its own, not as a service
-			 * provider actually registered on a container.
-			 */
-			public function register() {}
-
-			// phpcs:enable
-		};
-
-		$this->sut->setContainer( $this->container );
-	}
-
-	/**
-	 * Tests adding a scalar value provides an exception.
-	 *
-	 * @return void
-	 */
-	public function test_add_with_implements_tags_throws_on_a_scalar_passed() {
-		$this->expectException( ContainerException::class );
-		$this->expectExceptionMessage( "You cannot add '123', only classes in the Automattic\WooCommerce\ namespace are allowed." );
-
-		$this->sut->add_with_implements_tags( 123 );
-	}
-
-	/**
-	 * Tests adding a wrong namespace value provides an exception.
-	 *
-	 * @return void
-	 */
-	public function test_add_with_implements_tags_throws_on_not_a_proper_namespace_class_passed() {
-		$this->expectException( ContainerException::class );
-		$this->expectExceptionMessage( "You cannot add 'stdClass', only classes in the Automattic\WooCommerce\ namespace are allowed." );
-
-		$this->sut->add_with_implements_tags( stdClass::class );
-	}
-
-	/**
-	 * Tests adding a class implementing an interface adds the interface as a tag.
-	 *
-	 * @return void
-	 */
-	public function test_add_with_implements_tags_for_a_class_with_a_single_interface() {
-		$definition = $this->sut->add_with_implements_tags( ClassWithInterface::class );
-
-		$this->assertTrue( $definition->hasTag( ClassInterface::class ) );
-	}
-
-	/**
-	 * Tests adding a class implementing multiple interfaces adds all the interfaces as tags.
-	 *
-	 * @return void
-	 */
-	public function test_add_with_implements_tags_for_a_class_with_multiple_interfaces() {
-		$definition = $this->sut->add_with_implements_tags( ClassWithMultipleInterfaces::class );
-
-		$this->assertTrue( $definition->hasTag( ClassInterface::class ) );
-		$this->assertTrue( $definition->hasTag( AnotherClassInterface::class ) );
-	}
-
-	/**
-	 * Tests adding a class with no interfaces doesn't add any tags.
-	 *
-	 * @return void
-	 */
-	public function test_add_with_implements_tags_for_a_class_with_no_interfaces() {
-		$definition = $this->sut->add_with_implements_tags( ClassWithNoInterface::class );
-
-		$this->assertFalse( $definition->hasTag( ClassInterface::class ) );
-		$this->assertFalse( $definition->hasTag( AnotherClassInterface::class ) );
-	}
-
-	/**
-	 * Tests adding a class with multiple interfaces adds interfaces to aliases the service provides.
-	 *
-	 * @return void
-	 */
-	public function test_add_with_implements_tags_for_a_class_with_a_single_interface_and_a_single_tag() {
-		$this->sut->add_with_implements_tags( ClassWithMultipleInterfaces::class, null, false );
-
-		$this->assertTrue( $this->sut->provides( ClassInterface::class ) );
-		$this->assertTrue( $this->sut->provides( AnotherClassInterface::class ) );
-	}
-
-	/**
-	 * Tests adding a class under alias returns the proper object.
-	 *
-	 * @return void
-	 * @throws ContainerException Dependency injection error.
-	 */
-	public function test_add_with_implements_tags_with_concrete() {
-		$this->sut->add_with_implements_tags( ClassWithNoInterface::class, ClassWithMultipleInterfaces::class );
-
-		$resolved = $this->container->get( ClassWithNoInterface::class );
-
-		$this->assertInstanceOf( ClassWithMultipleInterfaces::class, $resolved );
-	}
-
-	/**
-	 * Tests sharing a class with multiple interfaces adds the interfaces as tags.
-	 *
-	 * @return void
-	 */
-	public function test_share_with_implements_tags_adds_proper_interface_tags() {
-		$definition = $this->sut->share_with_implements_tags( ClassWithMultipleInterfaces::class, null );
-
-		$this->assertTrue( $definition->hasTag( ClassInterface::class ) );
-		$this->assertTrue( $definition->hasTag( AnotherClassInterface::class ) );
-	}
-
-	/**
-	 * Tests sharing a class with multiple interfaces adds interfaces to aliases the service provides.
-	 *
-	 * @return void
-	 */
-	public function test_share_with_implements_tags_does_proper_provides() {
-		$this->sut->share_with_implements_tags( ClassWithMultipleInterfaces::class, null );
-
-		$this->assertTrue( $this->sut->provides( ClassInterface::class ) );
-		$this->assertTrue( $this->sut->provides( AnotherClassInterface::class ) );
-	}
-
-	/**
-	 * Tests sharing a class with multiple interfaces returns the same instance.
-	 *
-	 * @return void
-	 * @throws ContainerException Dependency injection error.
-	 */
-	public function test_share_with_implements_tags_returns_the_same_instance() {
-		$definition = $this->sut->share_with_implements_tags( ClassWithMultipleInterfaces::class, null );
-
-		$this->assertTrue( $definition->isShared() );
-
-		$object = $this->container->get( ClassWithMultipleInterfaces::class );
-
-		$this->assertEquals( $definition->resolve(), $object );
-	}
-}
diff --git a/plugins/woocommerce/tests/php/src/Internal/DependencyManagement/AbstractServiceProviderTest.php b/plugins/woocommerce/tests/php/src/Internal/DependencyManagement/AbstractServiceProviderTest.php
deleted file mode 100644
index c3b8209151..0000000000
--- a/plugins/woocommerce/tests/php/src/Internal/DependencyManagement/AbstractServiceProviderTest.php
+++ /dev/null
@@ -1,232 +0,0 @@
-<?php
-/**
- * AbstractServiceProviderTests class file.
- */
-
-namespace Automattic\WooCommerce\Tests\Internal\DependencyManagement;
-
-use Automattic\WooCommerce\Internal\DependencyManagement\AbstractServiceProvider;
-use Automattic\WooCommerce\Internal\DependencyManagement\ContainerException;
-use Automattic\WooCommerce\Internal\DependencyManagement\Definition;
-use Automattic\WooCommerce\Internal\DependencyManagement\ExtendedContainer;
-use Automattic\WooCommerce\Tests\Internal\DependencyManagement\ExampleClasses\ClassWithInjectionMethodArgumentWithoutTypeHint;
-use Automattic\WooCommerce\Tests\Internal\DependencyManagement\ExampleClasses\ClassWithDependencies;
-use Automattic\WooCommerce\Tests\Internal\DependencyManagement\ExampleClasses\ClassWithNonFinalInjectionMethod;
-use Automattic\WooCommerce\Tests\Internal\DependencyManagement\ExampleClasses\ClassWithPrivateInjectionMethod;
-use Automattic\WooCommerce\Tests\Internal\DependencyManagement\ExampleClasses\ClassWithScalarInjectionMethodArgument;
-use Automattic\WooCommerce\Tests\Internal\DependencyManagement\ExampleClasses\DependencyClass;
-use Automattic\WooCommerce\Vendor\League\Container\Definition\DefinitionInterface;
-
-/**
- * Tests for AbstractServiceProvider.
- */
-class AbstractServiceProviderTest extends \WC_Unit_Test_Case {
-
-	/**
-	 * The system under test.
-	 *
-	 * @var AbstractServiceProvider
-	 */
-	private $sut;
-
-	/**
-	 * The container used for tests.
-	 *
-	 * @var ExtendedContainer
-	 */
-	private $container;
-
-	/**
-	 * Runs before each test.
-	 */
-	public function setUp(): void {
-		$this->container = new ExtendedContainer();
-
-		$this->sut = new class() extends AbstractServiceProvider {
-			// phpcs:disable
-
-			/**
-			 * Public version of add_with_auto_arguments, which is usually protected.
-			 */
-			public function add_with_auto_arguments( string $class_name, $concrete = null, bool $shared = false ) : DefinitionInterface {
-				return parent::add_with_auto_arguments( $class_name, $concrete, $shared );
-			}
-
-			/**
-			 * The mandatory 'register' method (defined in the base class as abstract).
-			 * Not implemented because this class is tested on its own, not as a service provider actually registered on a container.
-			 */
-			public function register() {}
-
-			// phpcs:enable
-		};
-
-		$this->sut->setContainer( $this->container );
-	}
-
-	/**
-	 * Runs before all the tests of the class.
-	 */
-	public static function setUpBeforeClass(): void {
-		/**
-		 * Return a new instance of ClassWithDependencies.
-		 *
-		 * @param DependencyClass $dependency The dependency to inject.
-		 * @return ClassWithDependencies The new instance.
-		 */
-		function get_new_dependency_class( DependencyClass $dependency ) {
-			return new ClassWithDependencies( $dependency );
-		};
-	}
-
-	/**
-	 * @testdox 'add_with_auto_arguments' should throw an exception if an invalid class name is passed as class name.
-	 */
-	public function test_add_with_auto_arguments_throws_on_non_class_passed_as_class_name() {
-		$this->expectException( ContainerException::class );
-		$this->expectExceptionMessage( "You cannot add 'foobar', only classes in the Automattic\WooCommerce\ namespace are allowed." );
-
-		$this->sut->add_with_auto_arguments( 'foobar' );
-	}
-
-	/**
-	 * @testdox 'add_with_auto_arguments' should throw an exception if the passed class has a private injection method.
-	 */
-	public function test_add_with_auto_arguments_throws_on_class_private_method_injection() {
-		$this->expectException( ContainerException::class );
-		$this->expectExceptionMessage( "Method '" . Definition::INJECTION_METHOD . "' of class '" . ClassWithPrivateInjectionMethod::class . "' isn't 'final public', instances can't be created." );
-
-		$this->sut->add_with_auto_arguments( ClassWithPrivateInjectionMethod::class );
-	}
-
-	/**
-	 * @testdox 'add_with_auto_arguments' should throw an exception if the passed class has a non-final injection method.
-	 */
-	public function test_add_with_auto_arguments_throws_on_class_non_final_method_injection() {
-		$this->expectException( ContainerException::class );
-		$this->expectExceptionMessage( "Method '" . Definition::INJECTION_METHOD . "' of class '" . ClassWithNonFinalInjectionMethod::class . "' isn't 'final', instances can't be created." );
-
-		$this->sut->add_with_auto_arguments( ClassWithNonFinalInjectionMethod::class );
-	}
-
-	/**
-	 * @testdox 'add_with_auto_arguments' should throw an exception if the passed concrete is a class with a private injection method.
-	 */
-	public function test_add_with_auto_arguments_throws_on_concrete_private_method_injection() {
-		$this->expectException( ContainerException::class );
-		$this->expectExceptionMessage( "Method '" . Definition::INJECTION_METHOD . "' of class '" . ClassWithPrivateInjectionMethod::class . "' isn't 'final public', instances can't be created." );
-
-		$this->sut->add_with_auto_arguments( ClassWithDependencies::class, ClassWithPrivateInjectionMethod::class );
-	}
-
-	/**
-	 * @testdox 'add_with_auto_arguments' should throw an exception if the passed concrete is a class with a non-final injection method.
-	 */
-	public function test_add_with_auto_arguments_throws_on_concrete_non_final_method_injection() {
-		$this->expectException( ContainerException::class );
-		$this->expectExceptionMessage( "Method '" . Definition::INJECTION_METHOD . "' of class '" . ClassWithNonFinalInjectionMethod::class . "' isn't 'final', instances can't be created." );
-
-		$this->sut->add_with_auto_arguments( ClassWithDependencies::class, ClassWithNonFinalInjectionMethod::class );
-	}
-
-	/**
-	 * @testdox 'add_with_auto_arguments' should throw an exception if the passed class has a method argument without type hint.
-	 */
-	public function test_add_with_auto_arguments_throws_on_method_argument_without_type_hint() {
-		$this->expectException( ContainerException::class );
-		$this->expectExceptionMessage( "Argument 'argument_without_type_hint' of class '" . ClassWithInjectionMethodArgumentWithoutTypeHint::class . "' doesn't have a type hint or has one that doesn't specify a class." );
-
-		$this->sut->add_with_auto_arguments( ClassWithInjectionMethodArgumentWithoutTypeHint::class );
-	}
-
-	/**
-	 * @testdox 'add_with_auto_arguments' should throw an exception if the passed class has a method argument with a scalar type hint.
-	 */
-	public function test_add_with_auto_arguments_throws_on_method_argument_with_scalar_type_hint() {
-		$this->expectException( ContainerException::class );
-		$this->expectExceptionMessage( "Argument 'scalar_argument_without_default_value' of class '" . ClassWithScalarInjectionMethodArgument::class . "' doesn't have a type hint or has one that doesn't specify a class." );
-
-		$this->sut->add_with_auto_arguments( ClassWithScalarInjectionMethodArgument::class );
-	}
-
-	/**
-	 * @testdox 'add_with_auto_arguments' should properly register the supplied class when no concrete is passed.
-	 *
-	 * @testWith [true, 1]
-	 *           [false, 2]
-	 *
-	 * @param bool $shared Whether to register the test class as shared or not.
-	 * @param int  $expected_constructions_count Expected number of times that the test class will have been instantiated.
-	 */
-	public function test_add_with_auto_arguments_works_as_expected_with_no_concrete( bool $shared, int $expected_constructions_count ) {
-		ClassWithDependencies::$instances_count = 0;
-
-		$this->container->share( DependencyClass::class );
-		$this->sut->add_with_auto_arguments( ClassWithDependencies::class, null, $shared );
-
-		$this->container->get( ClassWithDependencies::class );
-		$resolved = $this->container->get( ClassWithDependencies::class );
-
-		// A new instance is created for each resolution or not, depending on $shared.
-		$this->assertEquals( $expected_constructions_count, ClassWithDependencies::$instances_count );
-
-		// Arguments with default values are honored.
-		$this->assertEquals( ClassWithDependencies::SOME_NUMBER, $resolved->some_number );
-
-		// Method arguments are filled as expected.
-		$this->assertSame( $this->container->get( DependencyClass::class ), $resolved->dependency_class );
-	}
-
-	/**
-	 * @testdox 'add_with_auto_arguments' should properly register the supplied class when a concrete representing a class name is passed.
-	 */
-	public function test_add_with_auto_arguments_works_as_expected_when_concrete_is_class_name() {
-		$this->sut->add_with_auto_arguments( ClassWithDependencies::class, DependencyClass::class );
-
-		$resolved = $this->container->get( ClassWithDependencies::class );
-
-		$this->assertInstanceOf( DependencyClass::class, $resolved );
-	}
-
-	/**
-	 * @testdox 'add_with_auto_arguments' should properly register the supplied class when a concrete that is an object is passed.
-	 */
-	public function test_add_with_auto_arguments_works_as_expected_when_concrete_is_object() {
-		$object = new DependencyClass();
-
-		$this->sut->add_with_auto_arguments( ClassWithDependencies::class, $object );
-
-		$resolved = $this->container->get( ClassWithDependencies::class );
-
-		$this->assertSame( $object, $resolved );
-	}
-
-	/**
-	 * @testdox 'add_with_auto_arguments' should properly register the supplied class when a concrete that is a closure is passed.
-	 */
-	public function test_add_with_auto_arguments_works_as_expected_when_concrete_is_a_closure() {
-		$this->container->share( DependencyClass::class );
-		$callable = function( DependencyClass $dependency ) {
-			return new ClassWithDependencies( $dependency );
-		};
-
-		$this->sut->add_with_auto_arguments( ClassWithDependencies::class, $callable );
-
-		$resolved = $this->container->get( ClassWithDependencies::class );
-
-		$this->assertInstanceOf( ClassWithDependencies::class, $resolved );
-	}
-
-	/**
-	 * @testdox 'add_with_auto_arguments' should properly register the supplied class when a concrete that is a function name is passed.
-	 */
-	public function test_add_with_auto_arguments_works_as_expected_when_concrete_is_a_function_name() {
-		$this->container->share( DependencyClass::class );
-
-		$this->sut->add_with_auto_arguments( ClassWithDependencies::class, __NAMESPACE__ . '\get_new_dependency_class' );
-
-		$resolved = $this->container->get( ClassWithDependencies::class );
-
-		$this->assertInstanceOf( ClassWithDependencies::class, $resolved );
-	}
-}
diff --git a/plugins/woocommerce/tests/php/src/Internal/DependencyManagement/ExampleClasses/ClassWithConstructorWithOptionalParameters.php b/plugins/woocommerce/tests/php/src/Internal/DependencyManagement/ExampleClasses/ClassWithConstructorWithOptionalParameters.php
new file mode 100644
index 0000000000..33ec7d4a20
--- /dev/null
+++ b/plugins/woocommerce/tests/php/src/Internal/DependencyManagement/ExampleClasses/ClassWithConstructorWithOptionalParameters.php
@@ -0,0 +1,20 @@
+<?php
+
+declare( strict_types=1 );
+
+namespace Automattic\WooCommerce\Internal\DependencyManagement\ExampleClasses;
+
+/**
+ * An example of a class with a constructor that has optional parameters.
+ */
+class ClassWithConstructorWithOptionalParameters {
+	// phpcs:disable Squiz.Commenting
+	public int $the_num;
+	public ?string $the_string;
+
+	public function __construct( int $some_parameter = 34, ?string $other_parameter = null ) {
+		$this->the_num    = $some_parameter;
+		$this->the_string = $other_parameter;
+	}
+	// phpcs:enable Squiz.Commenting
+}
diff --git a/plugins/woocommerce/tests/php/src/Internal/DependencyManagement/ExampleClasses/ClassWithConstructorWithParameters.php b/plugins/woocommerce/tests/php/src/Internal/DependencyManagement/ExampleClasses/ClassWithConstructorWithParameters.php
new file mode 100644
index 0000000000..8ee7cddacd
--- /dev/null
+++ b/plugins/woocommerce/tests/php/src/Internal/DependencyManagement/ExampleClasses/ClassWithConstructorWithParameters.php
@@ -0,0 +1,14 @@
+<?php
+
+declare( strict_types=1 );
+
+namespace Automattic\WooCommerce\Internal\DependencyManagement\ExampleClasses;
+
+/**
+ * An example of a class with a constructor that has non-optional parameters.
+ */
+class ClassWithConstructorWithParameters {
+	// phpcs:ignore Squiz.Commenting.FunctionComment.Missing
+	public function __construct( int $some_parameter, string $other_parameter ) {
+	}
+}
diff --git a/plugins/woocommerce/tests/php/src/Internal/DependencyManagement/ExampleClasses/ClassWithPrivateConstructor.php b/plugins/woocommerce/tests/php/src/Internal/DependencyManagement/ExampleClasses/ClassWithPrivateConstructor.php
new file mode 100644
index 0000000000..02a42f5f49
--- /dev/null
+++ b/plugins/woocommerce/tests/php/src/Internal/DependencyManagement/ExampleClasses/ClassWithPrivateConstructor.php
@@ -0,0 +1,14 @@
+<?php
+
+declare( strict_types=1 );
+
+namespace Automattic\WooCommerce\Internal\DependencyManagement\ExampleClasses;
+
+/**
+ * An example of a class with a private constructor.
+ */
+class ClassWithPrivateConstructor {
+	// phpcs:ignore Squiz.Commenting.FunctionComment.Missing
+	private function __construct() {
+	}
+}
diff --git a/plugins/woocommerce/tests/php/src/Internal/DependencyManagement/ExampleClasses/ClassWithProtectedConstructor.php b/plugins/woocommerce/tests/php/src/Internal/DependencyManagement/ExampleClasses/ClassWithProtectedConstructor.php
new file mode 100644
index 0000000000..516785221f
--- /dev/null
+++ b/plugins/woocommerce/tests/php/src/Internal/DependencyManagement/ExampleClasses/ClassWithProtectedConstructor.php
@@ -0,0 +1,14 @@
+<?php
+
+declare( strict_types=1 );
+
+namespace Automattic\WooCommerce\Internal\DependencyManagement\ExampleClasses;
+
+/**
+ * An example of a class with a protected constructor.
+ */
+class ClassWithProtectedConstructor {
+	// phpcs:ignore Squiz.Commenting.FunctionComment.Missing
+	protected function __construct() {
+	}
+}
diff --git a/plugins/woocommerce/tests/php/src/Internal/DependencyManagement/ExampleProviders/ClassA.php b/plugins/woocommerce/tests/php/src/Internal/DependencyManagement/ExampleProviders/ClassA.php
deleted file mode 100644
index be0202146c..0000000000
--- a/plugins/woocommerce/tests/php/src/Internal/DependencyManagement/ExampleProviders/ClassA.php
+++ /dev/null
@@ -1,10 +0,0 @@
-<?php
-
-namespace Automattic\WooCommerce\Tests\Internal\DependencyManagement\ExampleProviders;
-
-/**
- * Example class that is going to be retrieved by name from the dependency injection container.
- */
-class ClassA {
-
-}
diff --git a/plugins/woocommerce/tests/php/src/Internal/DependencyManagement/ExampleProviders/ClassAWithInterface1.php b/plugins/woocommerce/tests/php/src/Internal/DependencyManagement/ExampleProviders/ClassAWithInterface1.php
deleted file mode 100644
index a385b8540b..0000000000
--- a/plugins/woocommerce/tests/php/src/Internal/DependencyManagement/ExampleProviders/ClassAWithInterface1.php
+++ /dev/null
@@ -1,10 +0,0 @@
-<?php
-
-namespace Automattic\WooCommerce\Tests\Internal\DependencyManagement\ExampleProviders;
-
-/**
- * Example class that is going to be retrieved by interface name from the dependency injection container.
- */
-class ClassAWithInterface1 implements TheInterface {
-
-}
diff --git a/plugins/woocommerce/tests/php/src/Internal/DependencyManagement/ExampleProviders/ClassAWithInterface2.php b/plugins/woocommerce/tests/php/src/Internal/DependencyManagement/ExampleProviders/ClassAWithInterface2.php
deleted file mode 100644
index 0d461470de..0000000000
--- a/plugins/woocommerce/tests/php/src/Internal/DependencyManagement/ExampleProviders/ClassAWithInterface2.php
+++ /dev/null
@@ -1,10 +0,0 @@
-<?php
-
-namespace Automattic\WooCommerce\Tests\Internal\DependencyManagement\ExampleProviders;
-
-/**
- * Example class that is going to be retrieved by interface name from the dependency injection container.
- */
-class ClassAWithInterface2 implements TheInterface {
-
-}
diff --git a/plugins/woocommerce/tests/php/src/Internal/DependencyManagement/ExampleProviders/ClassB.php b/plugins/woocommerce/tests/php/src/Internal/DependencyManagement/ExampleProviders/ClassB.php
deleted file mode 100644
index 07cfb04318..0000000000
--- a/plugins/woocommerce/tests/php/src/Internal/DependencyManagement/ExampleProviders/ClassB.php
+++ /dev/null
@@ -1,10 +0,0 @@
-<?php
-
-namespace Automattic\WooCommerce\Tests\Internal\DependencyManagement\ExampleProviders;
-
-/**
- * Example class that is going to be retrieved by name from the dependency injection container.
- */
-class ClassB {
-
-}
diff --git a/plugins/woocommerce/tests/php/src/Internal/DependencyManagement/ExampleProviders/ClassBWithInterface1.php b/plugins/woocommerce/tests/php/src/Internal/DependencyManagement/ExampleProviders/ClassBWithInterface1.php
deleted file mode 100644
index b79e716eca..0000000000
--- a/plugins/woocommerce/tests/php/src/Internal/DependencyManagement/ExampleProviders/ClassBWithInterface1.php
+++ /dev/null
@@ -1,10 +0,0 @@
-<?php
-
-namespace Automattic\WooCommerce\Tests\Internal\DependencyManagement\ExampleProviders;
-
-/**
- * Example class that is going to be retrieved by interface name from the dependency injection container.
- */
-class ClassBWithInterface1 implements TheInterface {
-
-}
diff --git a/plugins/woocommerce/tests/php/src/Internal/DependencyManagement/ExampleProviders/ClassBWithInterface2.php b/plugins/woocommerce/tests/php/src/Internal/DependencyManagement/ExampleProviders/ClassBWithInterface2.php
deleted file mode 100644
index 9518ebf097..0000000000
--- a/plugins/woocommerce/tests/php/src/Internal/DependencyManagement/ExampleProviders/ClassBWithInterface2.php
+++ /dev/null
@@ -1,10 +0,0 @@
-<?php
-
-namespace Automattic\WooCommerce\Tests\Internal\DependencyManagement\ExampleProviders;
-
-/**
- * Example class that is going to be retrieved by interface name from the dependency injection container.
- */
-class ClassBWithInterface2 implements TheInterface {
-
-}
diff --git a/plugins/woocommerce/tests/php/src/Internal/DependencyManagement/ExampleProviders/ProviderA.php b/plugins/woocommerce/tests/php/src/Internal/DependencyManagement/ExampleProviders/ProviderA.php
deleted file mode 100644
index c056d0e091..0000000000
--- a/plugins/woocommerce/tests/php/src/Internal/DependencyManagement/ExampleProviders/ProviderA.php
+++ /dev/null
@@ -1,26 +0,0 @@
-<?php
-
-namespace Automattic\WooCommerce\Tests\Internal\DependencyManagement\ExampleProviders;
-
-use Automattic\WooCommerce\Internal\DependencyManagement\ServiceProviders\AbstractInterfaceServiceProvider;
-
-/**
- * Example service provider for the dependency injection container, it registers classes both by name and by interface.
- */
-class ProviderA extends AbstractInterfaceServiceProvider {
-	// phpcs:disable Squiz.Commenting
-
-	protected $provides = array(
-		ClassA::class,
-		ClassAWithInterface1::class,
-		ClassAWithInterface2::class,
-	);
-
-	public function register() {
-		$this->share( ClassA::class );
-		$this->share_with_implements_tags( ClassAWithInterface1::class );
-		$this->share_with_implements_tags( ClassAWithInterface2::class );
-	}
-
-	// phpcs:enable Squiz.Commenting
-}
diff --git a/plugins/woocommerce/tests/php/src/Internal/DependencyManagement/ExampleProviders/ProviderB.php b/plugins/woocommerce/tests/php/src/Internal/DependencyManagement/ExampleProviders/ProviderB.php
deleted file mode 100644
index 79e62c7790..0000000000
--- a/plugins/woocommerce/tests/php/src/Internal/DependencyManagement/ExampleProviders/ProviderB.php
+++ /dev/null
@@ -1,26 +0,0 @@
-<?php
-
-namespace Automattic\WooCommerce\Tests\Internal\DependencyManagement\ExampleProviders;
-
-use Automattic\WooCommerce\Internal\DependencyManagement\ServiceProviders\AbstractInterfaceServiceProvider;
-
-/**
- * Example service provider for the dependency injection container, it registers classes both by name and by interface.
- */
-class ProviderB extends AbstractInterfaceServiceProvider {
-	// phpcs:disable Squiz.Commenting
-
-	protected $provides = array(
-		ClassB::class,
-		ClassBWithInterface1::class,
-		ClassBWithInterface2::class,
-	);
-
-	public function register() {
-		$this->share( ClassA::class );
-		$this->share_with_implements_tags( ClassBWithInterface1::class );
-		$this->share_with_implements_tags( ClassBWithInterface2::class );
-	}
-
-	// phpcs:enable Squiz.Commenting
-}
diff --git a/plugins/woocommerce/tests/php/src/Internal/DependencyManagement/ExampleProviders/TheInterface.php b/plugins/woocommerce/tests/php/src/Internal/DependencyManagement/ExampleProviders/TheInterface.php
deleted file mode 100644
index 586732278d..0000000000
--- a/plugins/woocommerce/tests/php/src/Internal/DependencyManagement/ExampleProviders/TheInterface.php
+++ /dev/null
@@ -1,10 +0,0 @@
-<?php
-
-namespace Automattic\WooCommerce\Tests\Internal\DependencyManagement\ExampleProviders;
-
-/**
- * Example interface for classes that are going to be retrieved by interface name from the dependency injection container.
- */
-interface TheInterface {
-
-}
diff --git a/plugins/woocommerce/tests/php/src/Internal/DependencyManagement/ExtendedContainerTest.php b/plugins/woocommerce/tests/php/src/Internal/DependencyManagement/ExtendedContainerTest.php
deleted file mode 100644
index a86db56c75..0000000000
--- a/plugins/woocommerce/tests/php/src/Internal/DependencyManagement/ExtendedContainerTest.php
+++ /dev/null
@@ -1,289 +0,0 @@
-<?php
-/**
- * ExtendedContainerTests class file.
- */
-
-namespace Automattic\WooCommerce\Tests\Internal\DependencyManagement;
-
-use Automattic\WooCommerce\Internal\DependencyManagement\ContainerException;
-use Automattic\WooCommerce\Internal\DependencyManagement\ExtendedContainer;
-use Automattic\WooCommerce\Proxies\LegacyProxy;
-use Automattic\WooCommerce\StoreApi\Legacy;
-use Automattic\WooCommerce\Testing\Tools\DependencyManagement\MockableLegacyProxy;
-use Automattic\WooCommerce\Tests\Internal\DependencyManagement\ExampleClasses\ClassWithDependencies;
-use Automattic\WooCommerce\Tests\Internal\DependencyManagement\ExampleClasses\DependencyClass;
-use Automattic\WooCommerce\Tests\Internal\DependencyManagement\ExampleClasses\DerivedDependencyClass;
-use Automattic\WooCommerce\Tests\Internal\DependencyManagement\ExampleProviders\ClassA;
-use Automattic\WooCommerce\Tests\Internal\DependencyManagement\ExampleProviders\ClassAWithInterface1;
-use Automattic\WooCommerce\Tests\Internal\DependencyManagement\ExampleProviders\ClassAWithInterface2;
-use Automattic\WooCommerce\Tests\Internal\DependencyManagement\ExampleProviders\ClassBWithInterface1;
-use Automattic\WooCommerce\Tests\Internal\DependencyManagement\ExampleProviders\ClassBWithInterface2;
-use Automattic\WooCommerce\Tests\Internal\DependencyManagement\ExampleProviders\ProviderA;
-use Automattic\WooCommerce\Tests\Internal\DependencyManagement\ExampleProviders\ProviderB;
-use Automattic\WooCommerce\Tests\Internal\DependencyManagement\ExampleProviders\TheInterface;
-
-/**
- * Tests for ExtendedContainer.
- */
-class ExtendedContainerTest extends \WC_Unit_Test_Case {
-
-	/**
-	 * The system under test.
-	 *
-	 * @var ExtendedContainer
-	 */
-	private $sut;
-
-	/**
-	 * Runs before each test.
-	 */
-	public function setUp(): void {
-		$this->sut = new ExtendedContainer();
-	}
-
-	/**
-	 * @testDox 'add' should throw an exception when trying to register a class not in the WooCommerce root namespace.
-	 */
-	public function test_add_throws_when_trying_to_register_class_in_forbidden_namespace() {
-		$external_class = \WooCommerce::class;
-
-		$this->expectException( ContainerException::class );
-		$this->expectExceptionMessage( "You cannot add '$external_class', only classes in the Automattic\WooCommerce\ namespace are allowed." );
-
-		$this->sut->add( $external_class );
-	}
-
-	/**
-	 * @testDox 'add' should throw an exception when trying to register a concrete class not in the WooCommerce root namespace.
-	 */
-	public function test_add_throws_when_trying_to_register_concrete_class_in_forbidden_namespace() {
-		$external_class = \WooCommerce::class;
-
-		$this->expectException( ContainerException::class );
-		$this->expectExceptionMessage( "You cannot add concrete '$external_class', only classes in the Automattic\WooCommerce\ namespace are allowed." );
-
-		$this->sut->add( DependencyClass::class, $external_class );
-	}
-
-	/**
-	 * @testDox 'add' should allow registering classes in the WooCommerce root namespace.
-	 */
-	public function test_add_allows_registering_classes_in_woocommerce_root_namespace() {
-		$instance = new DependencyClass();
-		$this->sut->add( DependencyClass::class, $instance, true );
-		$resolved = $this->sut->get( DependencyClass::class );
-
-		$this->assertSame( $instance, $resolved );
-	}
-
-	/**
-	 * @testDox 'replace' should throw an exception when trying to replace a class that has not been previously registered.
-	 */
-	public function test_replace_throws_if_class_has_not_been_registered() {
-		$this->expectException( ContainerException::class );
-		$this->expectExceptionMessage( "The container doesn't have '" . DependencyClass::class . "' registered, please use 'add' instead of 'replace'." );
-
-		$this->sut->replace( DependencyClass::class, null );
-	}
-
-	/**
-	 * @testDox 'replace' should throw an exception when trying to use a class outside the Automattic\WooCommerce\ namespace as  the replacement.
-	 */
-	public function test_replace_throws_if_concrete_not_in_woocommerce_root_namespace() {
-		$instance = new DependencyClass();
-		$this->sut->add( DependencyClass::class, $instance, true );
-
-		$external_class = \WooCommerce::class;
-
-		$this->expectException( ContainerException::class );
-		$this->expectExceptionMessage( "You cannot use concrete '$external_class', only classes in the Automattic\WooCommerce\ namespace are allowed." );
-
-		$this->sut->replace( DependencyClass::class, $external_class );
-	}
-
-	/**
-	 * @testDox 'replace' should allow to replace existing registrations with object instances.
-	 */
-	public function test_replace_allows_replacing_existing_registrations() {
-		$instance_1 = new DependencyClass();
-		$instance_2 = new DependencyClass();
-
-		$this->sut->add( DependencyClass::class, $instance_1, true );
-		$this->assertSame( $instance_1, $this->sut->get( DependencyClass::class ) );
-
-		$this->sut->replace( DependencyClass::class, $instance_2, true );
-		$this->assertSame( $instance_2, $this->sut->get( DependencyClass::class ) );
-	}
-
-	/**
-	 * @testDox 'replace' should allow to replace existing registrations with anonymous classes.
-	 */
-	public function test_replace_allows_replacing_existing_registrations_with_anonymous_classes() {
-		$instance_1 = new DependencyClass();
-		$instance_2 = new class() extends DependencyClass {};
-
-		$this->sut->add( DependencyClass::class, $instance_1, true );
-		$this->assertSame( $instance_1, $this->sut->get( DependencyClass::class ) );
-
-		$this->sut->replace( DependencyClass::class, $instance_2 );
-		$this->assertSame( $instance_2, $this->sut->get( DependencyClass::class ) );
-	}
-
-	/**
-	 * @testDox 'replace' should allow replacing existing registrations with other class names.
-	 */
-	public function test_replace_allows_replacing_existing_registrations_with_class_names() {
-		$this->sut->add( DependencyClass::class, new DependencyClass(), true );
-		$this->assertInstanceOf( DependencyClass::class, $this->sut->get( DependencyClass::class ) );
-
-		$this->sut->replace( DependencyClass::class, DerivedDependencyClass::class );
-		$this->assertInstanceOf( DerivedDependencyClass::class, $this->sut->get( DependencyClass::class ) );
-	}
-
-	/**
-	 * @testDox 'init' should_be executed when resolving the class in the instance passed to 'replace'
-	 */
-	public function test_init_is_executed_when_resolving_the_class_in_the_instance_passed_to_replace() {
-		$this->sut->add( DependencyClass::class );
-		$this->sut->add( ClassWithDependencies::class )->addArgument( DependencyClass::class );
-
-		$this->sut->get( ClassWithDependencies::class );
-		$this->assertInstanceOf( DependencyClass::class, $this->sut->get( ClassWithDependencies::class )->dependency_class );
-
-		$derived_class = new class() extends ClassWithDependencies {};
-		$this->sut->replace( ClassWithDependencies::class, $derived_class );
-		$this->sut->replace( DependencyClass::class, DerivedDependencyClass::class );
-
-		$replaced_instance = $this->sut->get( ClassWithDependencies::class );
-		$this->assertEquals( $derived_class, $replaced_instance );
-		$this->assertInstanceOf( DerivedDependencyClass::class, $replaced_instance->dependency_class );
-	}
-
-	/**
-	 * @testDox 'reset_all_resolved' should discard cached resolutions for classes registered as 'shared'.
-	 */
-	public function test_reset_all_resolved_discards_cached_shared_resolutions() {
-		$this->sut->add( DependencyClass::class );
-		$this->sut->add( ClassWithDependencies::class, null, true )->addArgument( DependencyClass::class );
-		ClassWithDependencies::$instances_count = 0;
-
-		$this->sut->get( ClassWithDependencies::class );
-		$this->assertEquals( 1, ClassWithDependencies::$instances_count );
-		$this->sut->get( ClassWithDependencies::class );
-		$this->assertEquals( 1, ClassWithDependencies::$instances_count );
-
-		$this->sut->reset_all_resolved();
-
-		$this->sut->get( ClassWithDependencies::class );
-		$this->assertEquals( 2, ClassWithDependencies::$instances_count );
-		$this->sut->get( ClassWithDependencies::class );
-		$this->assertEquals( 2, ClassWithDependencies::$instances_count );
-	}
-
-	/**
-	 * @testDox 'reset_replacement' should revert a replaced definition back to its original concrete.
-	 */
-	public function test_reset_replacement_returns_a_replaced_definition_back_to_its_original_concrete() {
-		$this->sut->add( DependencyClass::class, new DependencyClass(), false );
-		$this->assertInstanceOf( DependencyClass::class, $this->sut->get( DependencyClass::class ) );
-
-		$this->sut->replace( DependencyClass::class, DerivedDependencyClass::class );
-		$this->assertInstanceOf( DerivedDependencyClass::class, $this->sut->get( DependencyClass::class ) );
-
-		$rederived_instance = new class() extends DerivedDependencyClass {};
-		$this->sut->replace( DependencyClass::class, $rederived_instance );
-		$this->assertSame( $rederived_instance, $this->sut->get( DependencyClass::class ) );
-
-		$was_reset = $this->sut->reset_replacement( DependencyClass::class );
-		$this->assertTrue( $was_reset );
-		$this->assertInstanceOf( DependencyClass::class, $this->sut->get( DependencyClass::class ) );
-	}
-
-	/**
-	 * @testDox 'reset_replacement' returns false if the given class hadn't got a replacement.
-	 */
-	public function test_reset_replacement_returns_false_if_the_given_class_hadnt_got_a_replacement() {
-		$this->assertFalse( $this->sut->reset_replacement( DependencyClass::class ) );
-	}
-
-	/**
-	 * @testDox 'reset_all_replacements' should revert all the replaced definitions back to their original concretes.
-	 */
-	public function test_reset_all_replacements_reverts_all_the_replaced_definitions_back_to_their_original_concretes() {
-		$this->sut->add( DependencyClass::class );
-		$this->sut->add( ClassWithDependencies::class )->addArgument( DependencyClass::class );
-
-		$this->assertInstanceOf( DependencyClass::class, $this->sut->get( ClassWithDependencies::class )->dependency_class );
-		$this->assertInstanceOf( ClassWithDependencies::class, $this->sut->get( ClassWithDependencies::class ) );
-
-		$this->sut->replace( DependencyClass::class, DerivedDependencyClass::class );
-		$derived_class = new class() extends ClassWithDependencies {};
-		$this->sut->replace( ClassWithDependencies::class, $derived_class );
-
-		$this->assertInstanceOf( DerivedDependencyClass::class, $this->sut->get( ClassWithDependencies::class )->dependency_class );
-		$this->assertSame( $derived_class, $this->sut->get( ClassWithDependencies::class ) );
-
-		$this->sut->reset_all_replacements();
-
-		$this->assertInstanceOf( DependencyClass::class, $this->sut->get( ClassWithDependencies::class )->dependency_class );
-		$this->assertInstanceOf( ClassWithDependencies::class, $this->sut->get( ClassWithDependencies::class ) );
-	}
-
-	/**
-	 * @testDox 'reset_replacement' treats LegacyProxy as an exception: it reverts is to MockableLegacyProxy.
-	 */
-	public function test_reset_replacement_resets_legacy_proxy_to_mockable_legacy_proxy() {
-		// For this test we need the original container that gets initialized in tests/legacy/bootstrap.php
-		// (where LegacyProxy is replaced with MockableLegacyProxy).
-		$sut = wc_get_container();
-
-		$some_other_proxy = new class() extends LegacyProxy {};
-		$sut->replace( LegacyProxy::class, $some_other_proxy );
-
-		$this->assertSame( $some_other_proxy, $sut->get( LegacyProxy::class ) );
-
-		$sut->reset_replacement( LegacyProxy::class );
-
-		$this->assertInstanceOf( MockableLegacyProxy::class, $sut->get( LegacyProxy::class ) );
-	}
-
-	/**
-	 * @testDox 'reset_all_replacements' treats LegacyProxy as an exception: it reverts is to MockableLegacyProxy.
-	 */
-	public function test_reset_all_replacements_resets_legacy_proxy_to_mockable_legacy_proxy() {
-		// For this test we need the original container that gets initialized in tests/legacy/bootstrap.php
-		// (where LegacyProxy is replaced with MockableLegacyProxy).
-		$sut = wc_get_container();
-
-		$some_other_proxy = new class() extends LegacyProxy {};
-		$sut->replace( LegacyProxy::class, $some_other_proxy );
-
-		$this->assertSame( $some_other_proxy, $sut->get( LegacyProxy::class ) );
-
-		$sut->reset_all_replacements();
-
-		$this->assertInstanceOf( MockableLegacyProxy::class, $sut->get( LegacyProxy::class ) );
-	}
-
-	/**
-	 * @testdox Classes implementing a given interface can be registered in different providers and they are all returned even if a 'get' by class name is executed first.
-	 *
-	 * Note: see the comment inside ExtendedContainer::get for a detailed explanation about the fix that is being tested here.
-	 */
-	public function test_all_classes_implementing_an_interface_are_registered_correctly() {
-		$this->sut->addServiceProvider( ProviderA::class );
-		$this->sut->addServiceProvider( ProviderB::class );
-
-		$this->sut->get( ClassA::class );
-
-		$actual   = array_map( 'get_class', $this->sut->get( TheInterface::class ) );
-		$expected = array(
-			ClassAWithInterface1::class,
-			ClassAWithInterface2::class,
-			ClassBWithInterface1::class,
-			ClassBWithInterface2::class,
-		);
-
-		$this->assertEquals( $expected, $actual );
-	}
-}
diff --git a/plugins/woocommerce/tests/php/src/Internal/DependencyManagement/RuntimeContainerTest.php b/plugins/woocommerce/tests/php/src/Internal/DependencyManagement/RuntimeContainerTest.php
index 8d88a8bca1..a4cd625624 100644
--- a/plugins/woocommerce/tests/php/src/Internal/DependencyManagement/RuntimeContainerTest.php
+++ b/plugins/woocommerce/tests/php/src/Internal/DependencyManagement/RuntimeContainerTest.php
@@ -7,7 +7,6 @@ namespace Automattic\WooCommerce\Tests\Internal\DependencyManagement;
 use Automattic\WooCommerce\Blocks\Assets\Api as BlocksAssetsApi;
 use Automattic\WooCommerce\Blocks\Package as BlocksPackage;
 use Automattic\WooCommerce\Internal\DependencyManagement\ContainerException;
-use Automattic\WooCommerce\Internal\DependencyManagement\ExtendedContainer;
 use Automattic\WooCommerce\Internal\DependencyManagement\RuntimeContainer;
 use Automattic\WooCommerce\StoreApi\Schemas\ExtendSchema;
 use Automattic\WooCommerce\StoreApi\StoreApi;
@@ -25,6 +24,7 @@ use Automattic\WooCommerce\Tests\Internal\DependencyManagement\ExampleClasses\De
 use Automattic\WooCommerce\Tests\Internal\DependencyManagement\ExampleClasses\InnerDependencyClass;
 use Automattic\WooCommerce\Tests\Internal\DependencyManagement\ExampleClasses\ClassThatThrowsOnInit;
 use Automattic\WooCommerce\Tests\Internal\DependencyManagement\ExampleClasses\ClassWithStoreApiDependency;
+use Automattic\WooCommerce\Internal\DependencyManagement\ExampleClasses\ClassWithConstructorWithOptionalParameters;

 /**
  * Tests for RuntimeContainer.
@@ -34,7 +34,7 @@ class RuntimeContainerTest extends \WC_Unit_Test_Case {
 	/**
 	 * The system under test.
 	 *
-	 * @var ExtendedContainer
+	 * @var RuntimeContainer
 	 */
 	private $sut;

@@ -67,6 +67,45 @@ class RuntimeContainerTest extends \WC_Unit_Test_Case {
 		$this->sut->get( 'Automattic\WooCommerce\Fizz\Buzz' );
 	}

+	/**
+	 * @testdox 'get' throws 'ContainerException' when trying to resolve a class that has a private or protected constructor.
+	 *
+	 * @testWith ["ClassWithPrivateConstructor"]
+	 *           ["ClassWithProtectedConstructor"]
+	 *
+	 * @param string $class_name The name of the class to try to instantiate, without the namespace.
+	 */
+	public function test_exception_when_trying_to_resolve_class_with_private_constructor( string $class_name ) {
+		$class_name = "Automattic\\WooCommerce\\Internal\\DependencyManagement\\ExampleClasses\\$class_name";
+		$this->expectException( ContainerException::class );
+		$this->expectExceptionMessage( "Error resolving '$class_name': the class doesn't have a public constructor." );
+
+		$this->sut->get( $class_name );
+	}
+
+	/**
+	 * @testdox 'get' throws 'ContainerException' when trying to resolve a class that has a constructor with non-optional arguments.
+	 *
+	 */
+	public function test_exception_when_trying_to_resolve_class_with_constructor_with_non_optional_arguments() {
+		$class_name = 'Automattic\\WooCommerce\\Internal\\DependencyManagement\\ExampleClasses\\ClassWithConstructorWithParameters';
+		$this->expectException( ContainerException::class );
+		$this->expectExceptionMessage( "Error resolving '$class_name': the class constructor has non-optional arguments." );
+
+		$this->sut->get( $class_name );
+	}
+
+	/**
+	 * @testdox 'get' can resolve classes with constructor arguments as long as all the arguments are optional.
+	 */
+	public function test_class_with_optional_constructor_arguments_can_be_resolved() {
+		$instance = $this->sut->get( ClassWithConstructorWithOptionalParameters::class );
+
+		$this->assertInstanceOf( ClassWithConstructorWithOptionalParameters::class, $instance );
+		$this->assertEquals( 34, $instance->the_num );
+		$this->assertNull( $instance->the_string );
+	}
+
 	/**
 	 * @testdox 'get' can resolve classes passed to the constructor in the initial resolve cache.
 	 */
diff --git a/plugins/woocommerce/tests/php/src/Proxies/ClassThatDependsOnLegacyCodeTest.php b/plugins/woocommerce/tests/php/src/Proxies/ClassThatDependsOnLegacyCodeTest.php
index 465bf4fd0f..cbdf20ce3a 100644
--- a/plugins/woocommerce/tests/php/src/Proxies/ClassThatDependsOnLegacyCodeTest.php
+++ b/plugins/woocommerce/tests/php/src/Proxies/ClassThatDependsOnLegacyCodeTest.php
@@ -5,7 +5,6 @@

 namespace Automattic\WooCommerce\Tests\Proxies;

-use Automattic\WooCommerce\Internal\DependencyManagement\ExtendedContainer;
 use Automattic\WooCommerce\Proxies\LegacyProxy;
 use Automattic\WooCommerce\Tests\Proxies\ExampleClasses\ClassThatDependsOnLegacyCode;
 use Automattic\WooCommerce\Tests\Internal\DependencyManagement\ExampleClasses\DependencyClass;
@@ -27,11 +26,6 @@ class ClassThatDependsOnLegacyCodeTest extends \WC_Unit_Test_Case {
 	public function setUp(): void {
 		$container = wc_get_container();

-		// TODO: Remove this in WooCommerce 10.0.
-		if ( $container instanceof ExtendedContainer ) {
-			$container->add( ClassThatDependsOnLegacyCode::class )->addArgument( LegacyProxy::class );
-		}
-
 		$this->sut = $container->get( ClassThatDependsOnLegacyCode::class );
 	}

diff --git a/plugins/woocommerce/tests/php/src/Proxies/LegacyProxyTest.php b/plugins/woocommerce/tests/php/src/Proxies/LegacyProxyTest.php
index 1975c7afce..a6e5e2f7f7 100644
--- a/plugins/woocommerce/tests/php/src/Proxies/LegacyProxyTest.php
+++ b/plugins/woocommerce/tests/php/src/Proxies/LegacyProxyTest.php
@@ -33,9 +33,9 @@ class LegacyProxyTest extends \WC_Unit_Test_Case {
 	 */
 	public function test_get_instance_of_throws_when_trying_to_get_a_woo_namespaced_class() {
 		$this->expectException( \Exception::class );
-		$this->expectExceptionMessage( 'The LegacyProxy class is not intended for getting instances of classes whose namespace starts with \'Automattic\\WooCommerce\', please use ' . Definition::INJECTION_METHOD . ' method injection or the instance of Automattic\WooCommerce\Vendor\Psr\Container\ContainerInterface for that.' );
+		$this->expectExceptionMessage( 'The LegacyProxy class is not intended for getting instances of classes whose namespace starts with \'Automattic\\WooCommerce\', please use \'init\' method injection or \'wc_get_container()->get()\' for that.' );

-		$this->sut->get_instance_of( DependencyClass::class );
+		$this->sut->get_instance_of( LegacyProxy::class );
 	}

 	/**