mirror of
https://github.com/danog/psalm.git
synced 2024-11-26 20:34:47 +01:00
fix tests/internal code
@var comments needed due to https://github.com/vimeo/psalm/issues/9754 and https://github.com/vimeo/psalm/issues/9753
This commit is contained in:
parent
5d0b05addf
commit
ad7be63c0b
@ -122,6 +122,7 @@ class FileFilter
|
||||
$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 @@ class FileFilter
|
||||
$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;
|
||||
|
@ -1365,7 +1365,10 @@ class CallableTest extends TestCase
|
||||
],
|
||||
'fileExistsCallable' => [
|
||||
'code' => '<?php
|
||||
/** @return string[] */
|
||||
/**
|
||||
* @param non-empty-string $prospective_file_path
|
||||
* @return non-empty-string[]
|
||||
*/
|
||||
function foo(string $prospective_file_path) : array {
|
||||
return array_filter(
|
||||
glob($prospective_file_path),
|
||||
|
Loading…
Reference in New Issue
Block a user