DiskResourceProvider: add @var for type that PHPStan can't infer

This commit is contained in:
Dylan K. Taylor 2022-03-09 17:18:40 +00:00
parent b4e1edaa64
commit 581bbfe255
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D

View File

@ -71,6 +71,7 @@ class DiskResourceProvider implements ResourceProvider{
public function getResources() : array{
$resources = [];
if(is_dir($this->file)){
/** @var \SplFileInfo $resource */
foreach(new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($this->file)) as $resource){
if($resource->isFile()){
$path = str_replace(DIRECTORY_SEPARATOR, "/", substr((string) $resource, strlen($this->file)));