public function contract(
        FileNodeCollectionInterface $files,
        FileNodeInterface $target,
        array $options = []
    ) {
        $this->options = $options;
        if (!$this->canContract($files, $target)) {
            throw new \InvalidArgumentException("The supplied files are not valid");
        }

        $this->log(LogLevel::INFO, "Merging files in collection $files into: {$target}");

        $filePaths = $files->map(function (LocalFile $item) {
            return $item->getPath();
        });

        $cmd = sprintf(
            'cat %s > %s',
            implode(' ', $filePaths),
            $target->getPath()
        );

        return $this->runCommand($files, $target, $cmd, $this->getOption('keepOldFiles', true));
    }