<commit_before><?php

namespace filsh\yii2\oauth2server\storage;

use Yii;

class Pdo extends \OAuth2\Storage\Pdo
{
    public $dsn;
    
    public $username;
    
    public $password;
    
    public $connection = 'db';
    
    public function __construct($connection = null, $config = array())
    {
        if($connection === null) {
            if($this->connection !== null && \Yii::$app->has($this->connection)) {
                $db = \Yii::$app->get($this->connection);
                if(!($db instanceof \yii\db\Connection)) {
                    throw new \yii\base\InvalidConfigException;
                }
                
                if(!$db->getIsActive()) {
                    $db->open();
                }
                
                $connection = $db->pdo;
                $config = array_merge(array(
                    'client_table' => $db->tablePrefix . 'oauth_clients',
                    'access_token_table' => $db->tablePrefix . 'oauth_access_tokens',
                    'refresh_token_table' => $db->tablePrefix . 'oauth_refresh_tokens',
                    'code_table' => $db->tablePrefix . 'oauth_authorization_codes',
                    'user_table' => $db->tablePrefix . 'oauth_users',
                    'jwt_table'  => $db->tablePrefix . 'oauth_jwt',
                    'jti_table'  => $db->tablePrefix . 'oauth_jti',
                    'scope_table'  => $db->tablePrefix . 'oauth_scopes',
                    'public_key_table'  => $db->tablePrefix . 'oauth_public_keys',
                ), $config);
                
            } else {
                $connection = [
                    'dsn' => $this->dsn,
                    'username' => $this->username,
                    'password' => $this->password
                ];
            }
        }
        
        parent::__construct($connection, $config);
    }
}
<commit_msg>Prefixes table is not set in filsh\yii2\oauth2server\storage\Pdo<commit_after><?php

namespace filsh\yii2\oauth2server\storage;

class Pdo extends \OAuth2\Storage\Pdo
{
    public $dsn;
    
    public $username;
    
    public $password;
    
    public $connection = 'db';
    
    public function __construct($connection = null, $config = array())
    {
        if($connection === null) {
            if($this->connection !== null && \Yii::$app->has($this->connection)) {
                $db = \Yii::$app->get($this->connection);
                if(!($db instanceof \yii\db\Connection)) {
                    throw new \yii\base\InvalidConfigException('Connection component must implement \yii\db\Connection.');
                }
                
                if(!$db->getIsActive()) {
                    $db->open();
                }
                
                $connection = $db->pdo;
                $config = array_merge(array(
                    'client_table' => $db->tablePrefix . 'oauth_clients',
                    'access_token_table' => $db->tablePrefix . 'oauth_access_tokens',
                    'refresh_token_table' => $db->tablePrefix . 'oauth_refresh_tokens',
                    'code_table' => $db->tablePrefix . 'oauth_authorization_codes',
                    'user_table' => $db->tablePrefix . 'oauth_users',
                    'jwt_table'  => $db->tablePrefix . 'oauth_jwt',
                    'jti_table'  => $db->tablePrefix . 'oauth_jti',
                    'scope_table'  => $db->tablePrefix . 'oauth_scopes',
                    'public_key_table'  => $db->tablePrefix . 'oauth_public_keys',
                ), $config);
                
            } else {
                $connection = [
                    'dsn' => $this->dsn,
                    'username' => $this->username,
                    'password' => $this->password
                ];
            }
        }
        
        parent::__construct($connection, $config);
    }
}

{'fraction_non_alphanumeric': 0.13928939237899074, 'fraction_numerical': 0.0020597322348094747, 'mean_word_length': 1.4433962264150944, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 67, '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': '3573979', 'n_tokens_mistral': 1119, 'n_tokens_neox': 1077, 'n_words': 170}