<commit_before><?php

namespace SimpleSAML\Store;

use \SimpleSAML_Configuration as Configuration;
use \SimpleSAML\Store;

/**
 * A data store using Redis to keep the data.
 *
 * @package SimpleSAMLphp
 */
class Redis extends Store
{
    /**
     * Initialize the Redis data store.
     */
    public function __construct($redis = null)
    {
        assert('is_null($redis) || is_subclass_of($redis, "Predis\\Client")');

        if (!class_exists('\Predis\Client')) {
            throw new \SimpleSAML\Error\CriticalConfigurationError('predis/predis is not available.');
        }

        if (is_null($redis)) {
            $config = Configuration::getInstance();

            $host = $config->getString('store.redis.host', 'localhost');
            $port = $config->getInteger('store.redis.port', 6379);
            $prefix = $config->getString('store.redis.prefix', 'SimpleSAMLphp');

            $redis = new \Predis\Client(
                array(
                    'scheme' => 'tcp',
                    'host' => $host,
                    'post' => $port,
                ),
                array(
                    'prefix' => $prefix,
                )
            );
        }<commit_msg>Correct Redis store port argument string<commit_after><?php

namespace SimpleSAML\Store;

use \SimpleSAML_Configuration as Configuration;
use \SimpleSAML\Store;

/**
 * A data store using Redis to keep the data.
 *
 * @package SimpleSAMLphp
 */
class Redis extends Store
{
    /**
     * Initialize the Redis data store.
     */
    public function __construct($redis = null)
    {
        assert('is_null($redis) || is_subclass_of($redis, "Predis\\Client")');

        if (!class_exists('\Predis\Client')) {
            throw new \SimpleSAML\Error\CriticalConfigurationError('predis/predis is not available.');
        }

        if (is_null($redis)) {
            $config = Configuration::getInstance();

            $host = $config->getString('store.redis.host', 'localhost');
            $port = $config->getInteger('store.redis.port', 6379);
            $prefix = $config->getString('store.redis.prefix', 'SimpleSAMLphp');

            $redis = new \Predis\Client(
                array(
                    'scheme' => 'tcp',
                    'host' => $host,
                    'port' => $port,
                ),
                array(
                    'prefix' => $prefix,
                )
            );
        }
{'fraction_non_alphanumeric': 0.13798767967145792, 'fraction_numerical': 0.0032854209445585215, 'mean_word_length': 1.825986078886311, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 17, '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': '5875444', 'n_tokens_mistral': 714, 'n_tokens_neox': 673, 'n_words': 145}