<?php

namespace Velis\Filesystem;

/**
 * @author Jan Małysiak <jan.malysiak@velis.pl>
 */
trait SymlinkTrait
{
    /**
     * {@inheritDoc}
     */
    public function symlink($sourceKey, $targetKey)
    {
        $functionName = function_exists('symlink') ? 'symlink' : 'copy';

        return call_user_func($functionName, $this->basePath . $sourceKey, $this->basePath . $targetKey);
    }
}
