Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit b2afd32

Browse filesBrowse files
Provide more precise phpdoc for FileLocatorInterface::locate
1 parent 0294563 commit b2afd32
Copy full SHA for b2afd32

File tree

2 files changed

+6
-2
lines changed
Filter options

2 files changed

+6
-2
lines changed

‎src/Symfony/Component/Config/FileLocator.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Config/FileLocator.php
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ public function __construct(string|array $paths = [])
3131
}
3232

3333
/**
34-
* @return string|array
34+
* @return string|string[]
35+
*
36+
* @psalm-return ($first is true ? string : string[])
3537
*/
3638
public function locate(string $name, ?string $currentPath = null, bool $first = true)
3739
{

‎src/Symfony/Component/Config/FileLocatorInterface.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Config/FileLocatorInterface.php
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,12 @@ interface FileLocatorInterface
2525
* @param string|null $currentPath The current path
2626
* @param bool $first Whether to return the first occurrence or an array of filenames
2727
*
28-
* @return string|array The full path to the file or an array of file paths
28+
* @return string|string[] The full path to the file or an array of file paths
2929
*
3030
* @throws \InvalidArgumentException If $name is empty
3131
* @throws FileLocatorFileNotFoundException If a file is not found
32+
*
33+
* @psalm-return ($first is true ? string : string[])
3234
*/
3335
public function locate(string $name, ?string $currentPath = null, bool $first = true);
3436
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.