From f7811b927e9850cb0b922a325ee9b8d95377b54d Mon Sep 17 00:00:00 2001 From: Marco van 't Wout Date: Wed, 19 May 2021 11:12:21 +0200 Subject: [PATCH] Fix notice when handling c3 error before C3_CODECOVERAGE_MEDIATE_STORAGE is defined --- c3.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/c3.php b/c3.php index 3c59a62..3116d44 100644 --- a/c3.php +++ b/c3.php @@ -38,9 +38,13 @@ if (!function_exists('__c3_error')) { function __c3_error($message) { - $errorLogFile = defined('C3_CODECOVERAGE_ERROR_LOG_FILE') ? - C3_CODECOVERAGE_ERROR_LOG_FILE : - C3_CODECOVERAGE_MEDIATE_STORAGE . DIRECTORY_SEPARATOR . 'error.txt'; + if (defined('C3_CODECOVERAGE_ERROR_LOG_FILE')) { + $errorLogFile = C3_CODECOVERAGE_ERROR_LOG_FILE; + } elseif (defined('C3_CODECOVERAGE_MEDIATE_STORAGE')) { + $errorLogFile = C3_CODECOVERAGE_MEDIATE_STORAGE . DIRECTORY_SEPARATOR . 'error.txt'; + } else { + $errorLogFile = null; + } if (is_writable($errorLogFile)) { file_put_contents($errorLogFile, $message); } else {