$file) { // It can be possible, that the "handle"-key is a filepath. $handle = pathinfo($handle, PATHINFO_FILENAME); $sanitizedFile = $this->sanitizeFileName($file); $fileUrl = (! $this->directoryUrl) ? $file : $this->directoryUrl . $sanitizedFile; $filePath = $directory . $sanitizedFile; $asset = $this->buildAsset($handle, $fileUrl, $filePath); if ($asset !== null) { $assets[] = $asset; } } return $assets; } }