basePath($media).'/'; } public function getPathForConversions(Media $media): string { return $this->basePath($media).'/conversions/'; } public function getPathForResponsiveImages(Media $media): string { return $this->basePath($media).'/responsive-images/'; } private function basePath(Media $media): string { $scope = trim((string) $media->getCustomProperty('path_scope', '')); $key = (string) $media->getKey(); return $scope !== '' ? $scope.'/'.$key : $key; } }