diff --git a/dictionaries/CallMap.php b/dictionaries/CallMap.php index ebe83286816..b6436c18be7 100644 --- a/dictionaries/CallMap.php +++ b/dictionaries/CallMap.php @@ -3329,7 +3329,7 @@ 'gettimeofday' => ['array'], 'gettimeofday\'1' => ['float', 'as_float='=>'true'], 'gettype' => ['string', 'value'=>'mixed'], -'glob' => ['list|false', 'pattern'=>'string', 'flags='=>'int'], +'glob' => ['list|false', 'pattern'=>'non-empty-string', 'flags='=>'int<1, max>'], 'GlobIterator::__construct' => ['void', 'pattern'=>'string', 'flags='=>'int'], 'GlobIterator::count' => ['int'], 'GlobIterator::current' => ['FilesystemIterator|SplFileInfo|string'], diff --git a/dictionaries/CallMap_historical.php b/dictionaries/CallMap_historical.php index dfdde0f5c86..28b1cbb6fc6 100644 --- a/dictionaries/CallMap_historical.php +++ b/dictionaries/CallMap_historical.php @@ -10727,7 +10727,7 @@ 'gettimeofday' => ['array'], 'gettimeofday\'1' => ['float', 'as_float='=>'true'], 'gettype' => ['string', 'value'=>'mixed'], - 'glob' => ['list|false', 'pattern'=>'string', 'flags='=>'int'], + 'glob' => ['list|false', 'pattern'=>'non-empty-string', 'flags='=>'int<1, max>'], 'gmdate' => ['string', 'format'=>'string', 'timestamp='=>'int'], 'gmmktime' => ['int|false', 'hour='=>'int', 'minute='=>'int', 'second='=>'int', 'month='=>'int', 'day='=>'int', 'year='=>'int'], 'gmp_abs' => ['GMP', 'num'=>'GMP|string|int'], diff --git a/src/Psalm/Config/FileFilter.php b/src/Psalm/Config/FileFilter.php index 01b1656e6c5..cefa55b0ce0 100644 --- a/src/Psalm/Config/FileFilter.php +++ b/src/Psalm/Config/FileFilter.php @@ -122,6 +122,7 @@ public static function loadFromArray( $declare_strict_types = (bool) ($directory['useStrictTypes'] ?? false); if ($directory_path[0] === '/' && DIRECTORY_SEPARATOR === '/') { + /** @var non-empty-string */ $prospective_directory_path = $directory_path; } else { $prospective_directory_path = $base_dir . DIRECTORY_SEPARATOR . $directory_path; @@ -238,6 +239,7 @@ public static function loadFromArray( $file_path = (string) ($file['name'] ?? ''); if ($file_path[0] === '/' && DIRECTORY_SEPARATOR === '/') { + /** @var non-empty-string */ $prospective_file_path = $file_path; } else { $prospective_file_path = $base_dir . DIRECTORY_SEPARATOR . $file_path; diff --git a/tests/CallableTest.php b/tests/CallableTest.php index e2e860513c4..0e5a799161e 100644 --- a/tests/CallableTest.php +++ b/tests/CallableTest.php @@ -1365,7 +1365,10 @@ function f(callable $p): void {}', ], 'fileExistsCallable' => [ 'code' => '