Automattic\WooCommerce

Autoloader::log_fallback_declinedprivate staticWC 11.0.0

Log, under WP_DEBUG only, why the PSR-4 fallback declined to register.

When the fallback bails to "no fallback", the downstream "class not found" fatal an operator eventually sees during an in-place upgrade carries no breadcrumb back to this decision — yet that breadcrumb is the most useful signal in the system, since the fallback exists precisely to prevent that fatal. Mirrors the WP_DEBUG error_log the registered handler already emits for a caught autoload error.

Метод класса: Autoloader{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

$result = Autoloader::log_fallback_declined( $reason ): void;
$reason(строка) (обязательный)
Human-readable reason the fallback was not registered.

Список изменений

С версии 11.0.0 Введена.

Код Autoloader::log_fallback_declined() WC 11.0.1

private static function log_fallback_declined( string $reason ): void {
	if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
		error_log( // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log
			'WooCommerce PSR-4 fallback not registered: ' . $reason
		);
	}
}