| @@ -17,9 +17,9 @@ | ||
| 17 | 17 | |
| 18 | 18 | /** |
| 19 | 19 | * Returns logger description |
| 20 | 20 | * |
| 21 | - * @return string|void | |
| 21 | + * @return string | |
| 22 | 22 | */ |
| 23 | 23 | public function get_description() { |
| 24 | 24 | return __('Log events into the PHP error log', 'wp-optimize'); |
| 25 | 25 | } |
| @@ -28,11 +28,11 @@ | ||
| 28 | 28 | * Emergency message |
| 29 | 29 | * |
| 30 | 30 | * @param string $message |
| 31 | 31 | * @param array $context |
| 32 | - * @return null|void | |
| 32 | + * @return void | |
| 33 | 33 | */ |
| 34 | - public function emergency($message, array $context = array()) { | |
| 34 | + public function emergency($message, $context = array()) { | |
| 35 | 35 | $this->log($message, Updraft_Log_Levels::EMERGENCY, $context); |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | /** |
| @@ -39,11 +39,11 @@ | ||
| 39 | 39 | * Alert message |
| 40 | 40 | * |
| 41 | 41 | * @param string $message |
| 42 | 42 | * @param array $context |
| 43 | - * @return null|void | |
| 43 | + * @return void | |
| 44 | 44 | */ |
| 45 | - public function alert($message, array $context = array()) { | |
| 45 | + public function alert($message, $context = array()) { | |
| 46 | 46 | $this->log($message, Updraft_Log_Levels::ALERT, $context); |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | /** |
| @@ -50,11 +50,11 @@ | ||
| 50 | 50 | * Critical message |
| 51 | 51 | * |
| 52 | 52 | * @param string $message |
| 53 | 53 | * @param array $context |
| 54 | - * @return null|void | |
| 54 | + * @return void | |
| 55 | 55 | */ |
| 56 | - public function critical($message, array $context = array()) { | |
| 56 | + public function critical($message, $context = array()) { | |
| 57 | 57 | $this->log($message, Updraft_Log_Levels::CRITICAL, $context); |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | /** |
| @@ -61,11 +61,11 @@ | ||
| 61 | 61 | * Error message |
| 62 | 62 | * |
| 63 | 63 | * @param string $message |
| 64 | 64 | * @param array $context |
| 65 | - * @return null|void | |
| 65 | + * @return void | |
| 66 | 66 | */ |
| 67 | - public function error($message, array $context = array()) { | |
| 67 | + public function error($message, $context = array()) { | |
| 68 | 68 | $this->log($message, Updraft_Log_Levels::ERROR, $context); |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | /** |
| @@ -72,11 +72,11 @@ | ||
| 72 | 72 | * Warning message |
| 73 | 73 | * |
| 74 | 74 | * @param string $message |
| 75 | 75 | * @param array $context |
| 76 | - * @return null|void | |
| 76 | + * @return void | |
| 77 | 77 | */ |
| 78 | - public function warning($message, array $context = array()) { | |
| 78 | + public function warning($message, $context = array()) { | |
| 79 | 79 | $this->log($message, Updraft_Log_Levels::WARNING, $context); |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | /** |
| @@ -83,11 +83,11 @@ | ||
| 83 | 83 | * Notice message |
| 84 | 84 | * |
| 85 | 85 | * @param string $message |
| 86 | 86 | * @param array $context |
| 87 | - * @return null|void | |
| 87 | + * @return void | |
| 88 | 88 | */ |
| 89 | - public function notice($message, array $context = array()) { | |
| 89 | + public function notice($message, $context = array()) { | |
| 90 | 90 | $this->log($message, Updraft_Log_Levels::NOTICE, $context); |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | /** |
| @@ -94,11 +94,11 @@ | ||
| 94 | 94 | * Info message |
| 95 | 95 | * |
| 96 | 96 | * @param string $message |
| 97 | 97 | * @param array $context |
| 98 | - * @return null|void | |
| 98 | + * @return void | |
| 99 | 99 | */ |
| 100 | - public function info($message, array $context = array()) { | |
| 100 | + public function info($message, $context = array()) { | |
| 101 | 101 | $this->log($message, Updraft_Log_Levels::INFO, $context); |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | /** |
| @@ -105,11 +105,11 @@ | ||
| 105 | 105 | * Debug message |
| 106 | 106 | * |
| 107 | 107 | * @param string $message |
| 108 | 108 | * @param array $context |
| 109 | - * @return null|void | |
| 109 | + * @return void | |
| 110 | 110 | */ |
| 111 | - public function debug($message, array $context = array()) { | |
| 111 | + public function debug($message, $context = array()) { | |
| 112 | 112 | $this->log($message, Updraft_Log_Levels::DEBUG, $context); |
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | /** |
| @@ -117,14 +117,14 @@ | ||
| 117 | 117 | * |
| 118 | 118 | * @param string $message |
| 119 | 119 | * @param mixed $level |
| 120 | 120 | * @param array $context |
| 121 | - * @return null|void | |
| 121 | + * @return void | |
| 122 | 122 | */ |
| 123 | - public function log($message, $level, array $context = array()) { | |
| 123 | + public function log($message, $level, $context = array()) { | |
| 124 | 124 | |
| 125 | - if (!$this->is_enabled()) return false; | |
| 125 | + if (!$this->is_enabled()) return; | |
| 126 | 126 | |
| 127 | 127 | $message = '['.Updraft_Log_Levels::to_text($level).'] : '.$this->interpolate($message, $context); |
| 128 | - error_log($message); | |
| 128 | + error_log($message); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log -- Using for debugging purpose | |
| 129 | 129 | } |
| 130 | 130 | } |