src/Viserio/Component/Filesystem/Traits/FilesystemHelperTrait.php
public function link(string $target, string $link): ?bool
    {
        $target = $this->getTransformedPath($target);
        $link   = $this->getTransformedPath($link);

        if (! $this->isWindows()) {
            return \symlink($target, $link);
        }

        $mode   = $this->isDirectory($target) ? 'J' : 'H';
        $output = $return = false;

        \exec("mklink /{$mode} \"{$link}\" \"{$target}\"", $output, $return);

        return $return;
    }
public function link(string $target, string $link): ?bool
    {
        $target = $this->getTransformedPath($target);
        $link   = $this->getTransformedPath($link);

        if (! $this->isWindows()) {
            return \symlink($target, $link);
        }

        $mode   = $this->isDirectory($target) ? 'J' : 'H';
        $output = $return = false;

        \exec("mklink /{$mode} \"{$link}\" \"{$target}\"", $output, $return);

        return $return;
    }
Create a hard link to the target file or directory.

@param string $target
@param string $link

@return null|bool

@codeCoverageIgnore