1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00

[ticket/12631] Some more cleanup and type hints for new finder files

PHPBB3-12631
This commit is contained in:
Marc Alexander
2021-10-10 11:52:47 +02:00
parent ed1566d217
commit cdd1e7849a
3 changed files with 16 additions and 10 deletions

View File

@@ -13,6 +13,8 @@
namespace phpbb\finder;
use phpbb\cache\service;
/**
* The finder provides a simple way to locate files in the core and a set of extensions
*/
@@ -26,12 +28,12 @@ class factory
/**
* Creates a new finder instance with its dependencies
*
* @param \phpbb\cache\service $cache A cache instance or null
* @param service|null $cache A cache instance or null
* @param bool $use_cache Use cache or not
* @param string $phpbb_root_path Path to the phpbb root directory
* @param string $php_ext php file extension
*/
public function __construct(/*\phpbb\cache\service */ $cache, $use_cache, $phpbb_root_path, $php_ext)
public function __construct(?service $cache, bool $use_cache, string $phpbb_root_path, string $php_ext)
{
$this->cache = $cache;
$this->use_cache = $use_cache;
@@ -44,10 +46,10 @@ class factory
*
* Allows the use of multiple differently configured finders with the same cache.
*
* @param string $cache_name The name of the cache variable, defaults to
* _ext_finder
* @param string $cache_name The name of the cache variable, defaults to _ext_finder
* @return finder New instance of finder
*/
public function get($cache_name = '_ext_finder')
public function get(string $cache_name = '_ext_finder'): finder
{
return new finder($this->cache, $this->use_cache, $this->phpbb_root_path, $this->php_ext, $cache_name);
}