rebase on oct-10-2023
This commit is contained in:
@@ -2,7 +2,6 @@
|
||||
|
||||
namespace Yoast\WP\SEO;
|
||||
|
||||
use Exception;
|
||||
use Throwable;
|
||||
use WP_CLI;
|
||||
use YoastSEO_Vendor\Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
@@ -279,16 +278,15 @@ class Loader {
|
||||
/**
|
||||
* Gets a class from the container.
|
||||
*
|
||||
* @param string $class The class name.
|
||||
* @param string $class_name The class name.
|
||||
*
|
||||
* @return object|null The class or, in production environments, null if it does not exist.
|
||||
*
|
||||
* @throws Throwable If the class does not exist in development environments.
|
||||
* @throws Exception If the class does not exist in development environments.
|
||||
*/
|
||||
protected function get_class( $class ) {
|
||||
protected function get_class( $class_name ) {
|
||||
try {
|
||||
return $this->container->get( $class );
|
||||
return $this->container->get( $class_name );
|
||||
} catch ( Throwable $e ) {
|
||||
// In production environments do not fatal if the class could not be constructed but log and fail gracefully.
|
||||
if ( \YOAST_ENVIRONMENT === 'production' ) {
|
||||
|
||||
Reference in New Issue
Block a user