Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use error_log instead of trigger_error #8243

Merged
merged 1 commit into from Jul 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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