<commit_before><?php

namespace Backup\Tools;

use Backup\Binary;

/**
 * Class wrapper for duplicity command.
 * Currently only support backup to a directory(file://).
 *
 * @author <NAME>
 * @date 23/9/2016
 * @version: Duplicity.php 8:26 pm
 * @since 23/9/2016
 */
class Duplicity implements Command
{
    /**
     * @var array options of duplicity command.
     */
    private $_options = array(
        '--no-encryption' => array(
            'since' => '0.1',
            'use' => true,
        ),
        '--dry-run' => array(
            'since' => '0.1',
            'use' => false,
        ),
    );

    /**
     * @var string optional passphrase specified.
     */
    private $_passphrase;
    /**
     * @var \Backup\FileSystem\Source the main directory to backup.
     */
    private $_main_directory;
    /**
     * @var string[] subdirectories of the main directory we want to exclude, eg cache, temp.
     */
    private $_excluded_directories;

    private $_destination;

    /**
     * @var Binary
     */
    private $_binary;

    private static $_version;

    private $_output;

    /**
     * Duplicity constructor.
     *
     * @param string $directory the path to the directory to backup.
     * @param string $destination the path to the directory to keep the backup files.
     * @param Binary $binary
     */
    public function __construct(
        \Backup\FileSystem\Source $directory,
        \Backup\Destination\Base $destination,
        Binary $binary
    ) {
        $this->_binary = $binary;
        if (!$directory->exists()) {
            throw new \Backup\Exception\InvalidArgumentException('Directory path is invalid');
        }
        $this->_main_directory = $directory;
        $this->_destination = $destination;
    }

    /**
     * @param string $directory
     * @return bool
     */
    protected function directoryExists($directory)
    {
        return is_dir($directory);
    }

    /**
     * Check if duplicity is installed.
     * @return bool
     */
    public function isInstalled()
    {
        $exitCode = $this->_binary->run(' -V');
        if ($exitCode) {
            return false;
        }
        return true;
    }
<commit_msg>Removed uneccessary function.<commit_after><?php

namespace Backup\Tools;

use Backup\Binary;

/**
 * Class wrapper for duplicity command.
 * Currently only support backup to a directory(file://).
 *
 * @author <NAME>
 * @date 23/9/2016
 * @version: Duplicity.php 8:26 pm
 * @since 23/9/2016
 */
class Duplicity implements Command
{
    /**
     * @var array options of duplicity command.
     */
    private $_options = array(
        '--no-encryption' => array(
            'since' => '0.1',
            'use' => true,
        ),
        '--dry-run' => array(
            'since' => '0.1',
            'use' => false,
        ),
    );

    /**
     * @var string optional passphrase specified.
     */
    private $_passphrase;
    /**
     * @var \Backup\FileSystem\Source the main directory to backup.
     */
    private $_main_directory;
    /**
     * @var string[] subdirectories of the main directory we want to exclude, eg cache, temp.
     */
    private $_excluded_directories;

    private $_destination;

    /**
     * @var Binary
     */
    private $_binary;

    private static $_version;

    private $_output;

    /**
     * Duplicity constructor.
     *
     * @param string $directory the path to the directory to backup.
     * @param string $destination the path to the directory to keep the backup files.
     * @param Binary $binary
     */
    public function __construct(
        \Backup\FileSystem\Source $directory,
        \Backup\Destination\Base $destination,
        Binary $binary
    ) {
        $this->_binary = $binary;
        if (!$directory->exists()) {
            throw new \Backup\Exception\InvalidArgumentException('Directory path is invalid');
        }
        $this->_main_directory = $directory;
        $this->_destination = $destination;
    }

    /**
     * Check if duplicity is installed.
     * @return bool
     */
    public function isInstalled()
    {
        $exitCode = $this->_binary->run(' -V');
        if ($exitCode) {
            return false;
        }
        return true;
    }

{'fraction_non_alphanumeric': 0.12514702422959303, 'fraction_numerical': 0.009880028228652082, 'mean_word_length': 1.9610027855153203, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6621606', 'n_tokens_mistral': 1229, 'n_tokens_neox': 1193, 'n_words': 342}