From a77f6fca12df7260c123d5b11c597de7fcdaa83a Mon Sep 17 00:00:00 2001 From: kkmuffme <11071985+kkmuffme@users.noreply.github.com> Date: Sun, 10 Jul 2022 12:01:45 +0200 Subject: [PATCH] use error_log --- src/Psalm/Config.php | 5 ++--- src/Psalm/Internal/Provider/ParserCacheProvider.php | 4 +--- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/Psalm/Config.php b/src/Psalm/Config.php index 5748f15953e..08bc9604f2e 100644 --- a/src/Psalm/Config.php +++ b/src/Psalm/Config.php @@ -54,6 +54,7 @@ use function class_exists; use function count; use function dirname; +use function error_log; use function explode; use function extension_loaded; use function file_exists; @@ -94,12 +95,10 @@ use function substr; use function substr_count; use function sys_get_temp_dir; -use function trigger_error; use function unlink; use function version_compare; use const DIRECTORY_SEPARATOR; -use const E_USER_ERROR; use const GLOB_NOSORT; use const LIBXML_ERR_ERROR; use const LIBXML_ERR_FATAL; @@ -1016,7 +1015,7 @@ private static function fromXmlAndPaths( } if (is_dir($config->cache_directory) === false && @mkdir($config->cache_directory, 0777, true) === false) { - trigger_error('Could not create cache directory: ' . $config->cache_directory, E_USER_ERROR); + error_log('Could not create cache directory: ' . $config->cache_directory); } if ($cwd) { diff --git a/src/Psalm/Internal/Provider/ParserCacheProvider.php b/src/Psalm/Internal/Provider/ParserCacheProvider.php index 755a064a807..893844e2eee 100644 --- a/src/Psalm/Internal/Provider/ParserCacheProvider.php +++ b/src/Psalm/Internal/Provider/ParserCacheProvider.php @@ -30,13 +30,11 @@ use function scandir; use function serialize; use function touch; -use function trigger_error; use function unlink; use function unserialize; use function usleep; use const DIRECTORY_SEPARATOR; -use const E_USER_ERROR; use const LOCK_EX; use const LOCK_SH; use const SCANDIR_SORT_NONE; @@ -385,7 +383,7 @@ private function createCacheDirectory(string $parser_cache_directory): void } catch (RuntimeException $e) { // Race condition (#4483) if (!is_dir($parser_cache_directory)) { - trigger_error('Could not create parser cache directory: ' . $parser_cache_directory, E_USER_ERROR); + error_log('Could not create parser cache directory: ' . $parser_cache_directory); } } }