src/Viserio/Component/Filesystem/FilesystemAdapter.php
public function copyDirectory(string $directory, string $destination, array $options = []): bool
    {
        if (! $this->isDirectory($directory)) {
            return false;
        }

        if (! \is_dir($destination)) {
            $this->createDirectory($destination, ['visibility' => 'public']);
        }

        $recursive = $options['recursive'] ?? true;

        $contents = $this->driver->listContents($directory, $recursive);

        foreach ($contents as $item) {
            if ($item['type'] === 'dir') {
                $this->createDirectory(
                    $destination . \str_replace($directory, '', $item['path']),
                    ['visibility' => $this->getVisibility($item['path'])]
                );
            }

            if ($item['type'] === 'file') {
                $this->copy(
                    $item['path'],
                    $destination . \str_replace($directory, '', $item['path'])
                );
            }
        }

        return true;
    }
public function copyDirectory(string $directory, string $destination, array $options = []): bool
    {
        if (! $this->isDirectory($directory)) {
            return false;
        }

        if (! \is_dir($destination)) {
            $this->createDirectory($destination, ['visibility' => 'public']);
        }

        $recursive = $options['recursive'] ?? true;

        $contents = $this->driver->listContents($directory, $recursive);

        foreach ($contents as $item) {
            if ($item['type'] === 'dir') {
                $this->createDirectory(
                    $destination . \str_replace($directory, '', $item['path']),
                    ['visibility' => $this->getVisibility($item['path'])]
                );
            }

            if ($item['type'] === 'file') {
                $this->copy(
                    $item['path'],
                    $destination . \str_replace($directory, '', $item['path'])
                );
            }
        }

        return true;
    }
{@inheritdoc}