@@ -41,21 +41,21 @@ public function __construct(
41
41
/**
42
42
* Logs payment related information used for debug
43
43
*
44
- * @param array $debugData
45
- * @param array|null $debugReplaceKeys
46
- * @param bool|null $debugFlag
44
+ * @param array $data
45
+ * @param array|null $maskKeys
46
+ * @param bool|null $forceDebug
47
47
* @return void
48
48
*/
49
- public function debug (array $ debugData , array $ debugReplaceKeys = null , $ debugFlag = null )
49
+ public function debug (array $ data , array $ maskKeys = null , $ forceDebug = null )
50
50
{
51
- $ debugReplaceKeys = $ debugReplaceKeys !== null ? $ debugReplaceKeys : $ this ->getDebugReplaceFields ();
52
- $ debugFlag = $ debugFlag !== null ? $ debugFlag : $ this ->isDebugOn ();
53
- if ($ debugFlag === true && ! empty ( $ debugData ) && ! empty ( $ debugReplaceKeys ) ) {
54
- $ debugData = $ this ->filterDebugData (
55
- $ debugData ,
56
- $ debugReplaceKeys
51
+ $ maskKeys = $ maskKeys !== null ? $ maskKeys : $ this ->getDebugReplaceFields ();
52
+ $ debugOn = $ forceDebug !== null ? $ forceDebug : $ this ->isDebugOn ();
53
+ if ($ debugOn === true ) {
54
+ $ data = $ this ->filterDebugData (
55
+ $ data ,
56
+ $ maskKeys
57
57
);
58
- $ this ->logger ->debug (var_export ($ debugData , true ));
58
+ $ this ->logger ->debug (var_export ($ data , true ));
59
59
}
60
60
}
61
61
@@ -66,7 +66,7 @@ public function debug(array $debugData, array $debugReplaceKeys = null, $debugFl
66
66
*/
67
67
private function getDebugReplaceFields ()
68
68
{
69
- if ($ this ->config ->getValue ('debugReplaceKeys ' )) {
69
+ if ($ this ->config and $ this -> config ->getValue ('debugReplaceKeys ' )) {
70
70
return explode (', ' , $ this ->config ->getValue ('debugReplaceKeys ' ));
71
71
}
72
72
return [];
@@ -79,7 +79,7 @@ private function getDebugReplaceFields()
79
79
*/
80
80
private function isDebugOn ()
81
81
{
82
- return (bool )$ this ->config ->getValue ('debug ' );
82
+ return $ this -> config and (bool )$ this ->config ->getValue ('debug ' );
83
83
}
84
84
85
85
/**
0 commit comments