<commit_before><?php

namespace li3_jwt\extensions\adapter\storage\session;

/**
 * A minimal adapter to interface with token sessions.
 *
 * This adapter provides basic support for `write`, `read` and `delete`
 * session handling, as well as allowing these three methods to be filtered as
 * per the Lithium filtering system.
 */
class Token extends \lithium\core\Object {

	/**
	 * Default configuration.
	 *
	 * @var array
	 */
	protected $_defaults = [
		'header' => 'Authorization',
		'prefix' => 'Bearer '
	];

	/**
	 * Stores the token.
	 *
	 * @var null|string
	 */
	public static $_token = null;

	/**
	 * Constructor.
	 *
	 * @param array $config Optional configuration parameters.
	 * @return void
	 */
	public function __construct(array $config = []) {
		parent::__construct($config + $this->_defaults);
	}

	/**
	 * Checks for the token header in the request and initiates the session if the header is set.
	 *
	 * @return void<commit_msg>Requires a header in the config<commit_after><?php

namespace li3_jwt\extensions\adapter\storage\session;

use lithium\core\ConfigException;

/**
 * A minimal adapter to interface with token sessions.
 *
 * This adapter provides basic support for `write`, `read` and `delete`
 * session handling, as well as allowing these three methods to be filtered as
 * per the Lithium filtering system.
 */
class Token extends \lithium\core\Object {

	/**
	 * Default configuration.
	 *
	 * @var array
	 */
	protected $_defaults = ['prefix' => ''];

	/**
	 * Stores the token.
	 *
	 * @var null|string
	 */
	public static $_token = null;

	/**
	 * Constructor.
	 *
	 * @param array $config Optional configuration parameters.
	 * @return void
	 */
	public function __construct(array $config = []) {
		if (!isset($config['header'])) {
			throw new ConfigException('Token adapter requires a header.');
		}
		parent::__construct($config + $this->_defaults);
	}

	/**
	 * Checks for the token header in the request and initiates the session if the header is set.
	 *
	 * @return void
{'fraction_non_alphanumeric': 0.12184249628528974, 'fraction_numerical': 0.0009905894006934125, 'mean_word_length': 3.4395604395604398, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 8, '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': '1074665', 'n_tokens_mistral': 616, 'n_tokens_neox': 562, 'n_words': 204}