<commit_before><?php
/**
 * @author rugk
 * @copyright Copyright (c) 2015-2016 rugk
 * @license MIT
 */

use Threema\MsgApi\Connection;
use Threema\MsgApi\ConnectionSettings;

/**
 * Creates a connection.
 *
 * Automatically calls CreateConnectionSettings and InitiateConnection.
 *
 * @param string $keystorePath  file for public key store
 * @param bool   $useTlsOptions whether to use advanced options or not
 *
 * @return Connection $connector
 */
function CreateConnection($keystorePath = __DIR__ . '/../keystore.php', $useTlsOptions = true)
{
    $publicKeyStore = CreatePublicKeyStore($keystorePath);
    $settings       = CreateConnectionSettings($useTlsOptions);
    $connector      = InitiateConnection($settings, $publicKeyStore);

    return $connector;
}

/**
 * Createa a PHP public key store.
 *
 * @param string $keystorePath Path public key store file (PHP)
 *
 * @return PhpFile public key store
 */
function CreatePublicKeyStore($keystorePath)
{
    if (!file_exists($keystorePath)) {
        if (!touch($keystorePath)) {
            throw new Exception('PHP keystore could not be created.');
        }
    }<commit_msg>Scrutinizer Auto-Fixes<commit_after><?php
/**
 * @author rugk
 * @copyright Copyright (c) 2015-2016 rugk
 * @license MIT
 */

use Threema\MsgApi\Connection;
use Threema\MsgApi\ConnectionSettings;

/**
 * Creates a connection.
 *
 * Automatically calls CreateConnectionSettings and InitiateConnection.
 *
 * @param string $keystorePath  file for public key store
 * @param bool   $useTlsOptions whether to use advanced options or not
 *
 * @return Connection $connector
 */
function CreateConnection($keystorePath = __DIR__ . '/../keystore.php', $useTlsOptions = true)
{
    $publicKeyStore = CreatePublicKeyStore($keystorePath);
    $settings       = CreateConnectionSettings($useTlsOptions);
    $connector      = InitiateConnection($settings, $publicKeyStore);

    return $connector;
}

/**
 * Createa a PHP public key store.
 *
 * @param string $keystorePath Path public key store file (PHP)
 *
 * @return Threema\MsgApi\PublicKeyStores\PhpFile public key store
 */
function CreatePublicKeyStore($keystorePath)
{
    if (!file_exists($keystorePath)) {
        if (!touch($keystorePath)) {
            throw new Exception('PHP keystore could not be created.');
        }
    }
{'fraction_non_alphanumeric': 0.11130284728213978, 'fraction_numerical': 0.006902502157031924, 'mean_word_length': 3.8514644351464433, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '199508', 'n_tokens_mistral': 696, 'n_tokens_neox': 662, 'n_words': 185}