<commit_before><?php
/**
 * Class TestDBStorage
 *
 * @filesource   TestDBStorage.php
 * @created      01.11.2017
 * @package      chillerlan\OAuthTest\Storage
 * @author       Smiley <<EMAIL>>
 * @copyright    2017 Smiley
 * @license      MIT
 */

namespace chillerlan\OAuthTest\Storage;

use chillerlan\Database\{
	Connection, Drivers\PDO\PDOMySQLDriver, Options, Query\Dialects\MySQLQueryBuilder
};
use chillerlan\OAuth\{
	OAuthOptions, Token
};
use chillerlan\OAuth\Storage\{
	DBTokenStorage, TokenStorageAbstract, TokenStorageInterface
};
use chillerlan\Traits\DotEnv;

class TestDBStorage extends TokenStorageAbstract{

	const CFGDIR         = __DIR__.'/../../config';
	const TABLE_TOKEN    = '<PASSWORD>';
	const TABLE_PROVIDER = 'storagetest_providers';

	/**
	 * @var \chillerlan\OAuth\Storage\TokenStorageInterface
	 */
	protected $storage;

	public function __construct(){

		$options                   = new OAuthOptions;
		$options->dbTokenTable     = self::TABLE_TOKEN;
		$options->dbProviderTable  = self::TABLE_PROVIDER;
		$options->storageCryptoKey = '<KEY>';
		$options->dbUserID         = 1;

		parent::__construct($options);

		$env = (new DotEnv(self::CFGDIR, file_exists(self::CFGDIR.'/.env') ? '.env' : '.env_travis'))->load();

		$db = new Connection(new Options([
			'driver'       => PDOMySQLDriver::class,
			'querybuilder' => MySQLQueryBuilder::class,
			'host'         => $env->get('MYSQL_HOST'),
			'port'         => $env->get('MYSQL_PORT'),<commit_msg>:octocat: PDO is shady<commit_after><?php
/**
 * Class TestDBStorage
 *
 * @filesource   TestDBStorage.php
 * @created      01.11.2017
 * @package      chillerlan\OAuthTest\Storage
 * @author       Smiley <<EMAIL>>
 * @copyright    2017 Smiley
 * @license      MIT
 */

namespace chillerlan\OAuthTest\Storage;

use chillerlan\Database\{
	Connection, Drivers\Native\MySQLiDriver, Drivers\PDO\PDOMySQLDriver, Options, Query\Dialects\MySQLQueryBuilder
};
use chillerlan\OAuth\{
	OAuthOptions, Token
};
use chillerlan\OAuth\Storage\{
	DBTokenStorage, TokenStorageAbstract, TokenStorageInterface
};
use chillerlan\Traits\DotEnv;

class TestDBStorage extends TokenStorageAbstract{

	const CFGDIR         = __DIR__.'/../../config';
	const TABLE_TOKEN    = '<PASSWORD>';
	const TABLE_PROVIDER = 'storagetest_providers';

	/**
	 * @var \chillerlan\OAuth\Storage\TokenStorageInterface
	 */
	protected $storage;

	public function __construct(){

		$options                   = new OAuthOptions;
		$options->dbTokenTable     = self::TABLE_TOKEN;
		$options->dbProviderTable  = self::TABLE_PROVIDER;
		$options->storageCryptoKey = '<KEY>';
		$options->dbUserID         = 1;

		parent::__construct($options);

		$env = (new DotEnv(self::CFGDIR, file_exists(self::CFGDIR.'/.env') ? '.env' : '.env_travis'))->load();

		$db = new Connection(new Options([
			'driver'       => MySQLiDriver::class,
			'querybuilder' => MySQLQueryBuilder::class,
			'host'         => $env->get('MYSQL_HOST'),
			'port'         => $env->get('MYSQL_PORT'),
{'fraction_non_alphanumeric': 0.14490339773484343, 'fraction_numerical': 0.008660892738174551, 'mean_word_length': 3.7142857142857144, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 33, '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': '4915898', 'n_tokens_mistral': 1047, 'n_tokens_neox': 980, 'n_words': 175}