mirror of
https://github.com/twigphp/Twig.git
synced 2026-08-25 02:36:26 +00:00
Add return types in FileystemLoader
This commit is contained in:
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user