Add return types in FileystemLoader

This commit is contained in:
Ruud Kamphuis
2024-09-23 09:41:35 +02:00
parent 49b699b25e
commit 15279ca8ee
+9 -2
View File
@@ -24,6 +24,9 @@ class FilesystemLoader implements LoaderInterface
/** Identifier of the main namespace. */
public const MAIN_NAMESPACE = '__main__';
/**
* @var array<string, list<string>>
*/
protected $paths = [];
protected $cache = [];
protected $errorCache = [];
@@ -31,7 +34,7 @@ class FilesystemLoader implements LoaderInterface
private $rootPath;
/**
* @param string|array $paths A path or an array of paths where to look for templates
* @param string|string[] $paths A path or an array of paths where to look for templates
* @param string|null $rootPath The root path common to all relative paths (null for getcwd())
*/
public function __construct($paths = [], ?string $rootPath = null)
@@ -48,6 +51,8 @@ class FilesystemLoader implements LoaderInterface
/**
* Returns the paths to the templates.
*
* @return list<string>
*/
public function getPaths(string $namespace = self::MAIN_NAMESPACE): array
{
@@ -58,6 +63,8 @@ class FilesystemLoader implements LoaderInterface
* Returns the path namespaces.
*
* The main namespace is always defined.
*
* @return list<string>
*/
public function getNamespaces(): array
{
@@ -65,7 +72,7 @@ class FilesystemLoader implements LoaderInterface
}
/**
* @param string|array $paths A path or an array of paths where to look for templates
* @param string|string[] $paths A path or an array of paths where to look for templates
*/
public function setPaths($paths, string $namespace = self::MAIN_NAMESPACE): void
{