src/GitWrapper.php
public function cloneRepository(string $repository, ?string $directory = null, array $options = []): GitWorkingCopy
    {
        if ($directory === null) {
            $directory = self::parseRepositoryName($repository);
        }

        $git = $this->workingCopy($directory);
        $git->cloneRepository($repository, $options);
        $git->setCloned(true);
        return $git;
    }
public function cloneRepository(string $repository, ?string $directory = null, array $options = []): GitWorkingCopy
    {
        if ($directory === null) {
            $directory = self::parseRepositoryName($repository);
        }

        $git = $this->workingCopy($directory);
        $git->cloneRepository($repository, $options);
        $git->setCloned(true);
        return $git;
    }
Executes a `git clone` command and returns a working copy object.

Clone a repository into a new directory. Use @see GitWorkingCopy::cloneRepository()
instead for more readable code.

@param string $repository The Git URL of the repository being cloned.
@param string $directory The directory that the repository will be cloned into. If null is
passed, the directory will automatically be generated from the URL via
the GitWrapper::parseRepositoryName() method.
@param mixed[] $options An associative array of command line options.