* @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?" ); } 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' ); } }
Fatal error: Uncaught Error: Class "Automattic\WooCommerce\Internal\DependencyManagement\ExtendedContainer" not found in /htdocs/wp-content/plugins/woocommerce/src/Container.php:83 Stack trace: #0 /htdocs/wp-content/plugins/woocommerce/woocommerce.php(38): Automattic\WooCommerce\Container->__construct() #1 /htdocs/wp-settings.php(462): include_once('/htdocs/wp-cont...') #2 /htdocs/wp-config.php(96): require_once('/htdocs/wp-sett...') #3 /htdocs/wp-load.php(50): require_once('/htdocs/wp-conf...') #4 /htdocs/wp-blog-header.php(13): require_once('/htdocs/wp-load...') #5 /htdocs/index.php(17): require('/htdocs/wp-blog...') #6 {main} thrown in /htdocs/wp-content/plugins/woocommerce/src/Container.php on line 83