protected function preparePaths(string $folder, array $paths, string $fileNames = ''): string
    {
        foreach ($paths as $path) {
            if (dirname($path) != $folder) {
                return ''; // all source paths must be the same
            }
            if ($fileNames != '') {
                $fileNames .= ':';
            }
            $fileNames .= basename($path);
        }

        return $fileNames;
    }
protected function preparePaths(string $folder, array $paths, string $fileNames = ''): string
    {
        foreach ($paths as $path) {
            if (dirname($path) != $folder) {
                return ''; // all source paths must be the same
            }
            if ($fileNames != '') {
                $fileNames .= ':';
            }
            $fileNames .= basename($path);
        }

        return $fileNames;
    }
protected function preparePaths ( string $ folder , array $ paths , string $ fileNames = '' ) : string { foreach ( $ paths as $ path ) { if ( dirname ( $ path ) != $ folder ) { return '' ; // all source paths must be the same } if ( $ fileNames != '' ) { $ fileNames .= ':' ; } $ fileNames .= basename ( $ path ) ; } return $ fileNames ; }
check source folders paths and build the file_names string

@param string $folder    Folder path
@param array  $paths     Paths of files
@param string $fileNames Optional file names

@return string
check source folders paths and build the file_names string