Skip to content

Commit

Permalink
use error_log
Browse files Browse the repository at this point in the history
  • Loading branch information
kkmuffme committed Jul 10, 2022
1 parent ce7d4ee commit a77f6fc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
5 changes: 2 additions & 3 deletions src/Psalm/Config.php
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down
4 changes: 1 addition & 3 deletions src/Psalm/Internal/Provider/ParserCacheProvider.php
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
}
}
Expand Down

0 comments on commit a77f6fc

Please sign in to comment.