Skip to content
Snippets Groups Projects
Commit b785c83e authored by Marcin Kolanko's avatar Marcin Kolanko
Browse files

fixed: deprecated error

parent f66adf01
No related branches found
No related tags found
No related merge requests found
Pipeline #129208 failed
## [1.10.2] - 2022-11-14
### Fixed
- Deprecated error in PHP 8.X
## [1.10.1] - 2022-10-01
### Fixed
- WC logger initialisation
......
......@@ -42,7 +42,7 @@ if ( ! class_exists( 'WPDesk_Logger_Factory' ) ) {
*
* @see http://php.net/manual/en/function.debug-backtrace.php
*/
public static function log_wp_error( WP_Error $e, array $backtrace ) {
public static function log_wp_error( WP_Error $e, array $backtrace = array() ) {
$message = 'Error: ' . get_class( $e ) . ' Code: ' . $e->get_error_code() . ' Message: ' . $e->get_error_message();
self::log_message_backtrace( $message, WPDesk_Logger::ERROR, $backtrace );
......@@ -79,7 +79,7 @@ if ( ! class_exists( 'WPDesk_Logger_Factory' ) ) {
* @param string $level Level of error.
* @param array $backtrace Backtrace information with snapshot of error env.
*/
public static function log_message_backtrace( $message, $level = WPDesk_Logger::DEBUG, array $backtrace ) {
public static function log_message_backtrace( $message, $level = WPDesk_Logger::DEBUG, array $backtrace = array() ) {
$message .= ' Backtrace: ' . json_encode( $backtrace );
if (isset($backtrace[ self::BACKTRACE_FILENAME_KEY ])) {
$filename = $backtrace[ self::BACKTRACE_FILENAME_KEY ];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment