Skip to content
Permalink
Browse files

Prevent unnecessary warnings

  • Loading branch information...
muglug committed Jul 11, 2019
1 parent 976d3bf commit 7268558aa74d39e5627d8e71d464274a358020ae
@@ -1746,6 +1746,7 @@ private function checkTemplateParams(
&& ($local_offset
= array_search($t->param_name, array_keys($storage->template_types)))
!== false
&& isset($storage->template_covariants[$local_offset])
&& $storage->template_covariants[$local_offset]
) {
if (IssueBuffer::accepts(
@@ -247,6 +247,13 @@ public function analyzeFiles(ProjectAnalyzer $project_analyzer, $pool_size, $alt
$project_analyzer->interpretRefactors();
}
$this->files_to_analyze = array_filter(
$this->files_to_analyze,
function (string $file_path) : bool {
return $this->file_provider->fileExists($file_path);
}
);
$analysis_worker =
/**
* @param int $_
@@ -358,8 +358,9 @@ private function scanFilePaths(int $pool_size) : bool
$files_to_scan = array_filter(
$this->files_to_scan,
function (string $file_path) : bool {
return !isset($this->scanned_files[$file_path])
|| (isset($this->files_to_deep_scan[$file_path]) && !$this->scanned_files[$file_path]);
return $this->file_provider->fileExists($file_path)
&& (!isset($this->scanned_files[$file_path])
|| (isset($this->files_to_deep_scan[$file_path]) && !$this->scanned_files[$file_path]));
}
);
@@ -35,6 +35,10 @@ public function getContents($file_path, bool $go_to_source = false)
return $this->open_files[strtolower($file_path)];
}
if (!file_exists($file_path)) {
throw new \UnexpectedValueException('File ' . $file_path . ' should exist to get contents');
}
return (string)file_get_contents($file_path);
}
@@ -77,6 +81,10 @@ public function setOpenContents($file_path, $file_contents)
*/
public function getModifiedTime($file_path)
{
if (!file_exists($file_path)) {
throw new \UnexpectedValueException('File should exist to get modified time');
}
return (int)filemtime($file_path);
}
@@ -649,8 +649,8 @@ public function setConfigHashCache(string $hash)
$cache_directory = Config::getInstance()->getCacheDirectory();
if ($cache_directory) {
if (file_exists($cache_directory)) {
mkdir($cache_directory, 0777, true);
if (!file_exists($cache_directory)) {
\mkdir($cache_directory, 0777, true);
}
$config_hash_cache_location = $cache_directory . DIRECTORY_SEPARATOR . self::CONFIG_HASH_CACHE_NAME;

0 comments on commit 7268558

Please sign in to comment.
You can’t perform that action at this time.