Skip to content

Commit

Permalink
fix tests/internal code
Browse files Browse the repository at this point in the history
@var comments needed due to vimeo#9754 and vimeo#9753
  • Loading branch information
kkmuffme committed May 6, 2023
1 parent 5d0b05a commit ad7be63
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/Psalm/Config/FileFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
5 changes: 4 additions & 1 deletion tests/CallableTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1365,7 +1365,10 @@ function f(callable $p): void {}',
],
'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),
Expand Down

0 comments on commit ad7be63

Please sign in to comment.