<commit_before><?php
class Application {

	#===============================================================================
	# Singleton instances
	#===============================================================================
	private static $Database;
	private static $Language;
	private static $Migrator;
	private static $repositories = [];

	#===============================================================================
	# Configuration array
	#===============================================================================
	private static $configuration = [];

	#===============================================================================
	# Set configuration value
	#===============================================================================
	public static function set($config, $value) {
		return self::$configuration[$config] = $value;
	}

	#===============================================================================
	# Get configuration value
	#===============================================================================
	public static function get($config) {
		return self::$configuration[$config] ?? "{$config}";
	}

	#===============================================================================
	# Get configuration
	#===============================================================================
	public static function getConfiguration(): array {
		return self::$configuration;
	}

	#===============================================================================
	# Return singleton Database instance
	#===============================================================================
	public static function getDatabase($force = FALSE): Database {
		if(!self::$Database instanceof Database OR $force === TRUE) {
			$hostname = self::get('DATABASE.HOSTNAME');
			$basename = self::get('DATABASE.BASENAME');
			$username = self::get('DATABASE.USERNAME');
			$password = self::get('<PASSWORD>');

			$Database = new Database($hostname, $basename, $username, $password);

			$Database->setAttribute(
				$Database::ATTR_DEFAULT_FETCH_MODE,
				$Database::FETCH_ASSOC
			);

			$Database->setAttribute(
				$Database::ATTR_ERRMODE,
				$Database::ERRMODE_EXCEPTION
			);
<commit_msg>Return NULL instead of config string if unset<commit_after><?php
class Application {

	#===============================================================================
	# Singleton instances
	#===============================================================================
	private static $Database;
	private static $Language;
	private static $Migrator;
	private static $repositories = [];

	#===============================================================================
	# Configuration array
	#===============================================================================
	private static $configuration = [];

	#===============================================================================
	# Set configuration value
	#===============================================================================
	public static function set($config, $value) {
		return self::$configuration[$config] = $value;
	}

	#===============================================================================
	# Get configuration value
	#===============================================================================
	public static function get($config) {
		return self::$configuration[$config] ?? NULL;
	}

	#===============================================================================
	# Get configuration
	#===============================================================================
	public static function getConfiguration(): array {
		return self::$configuration;
	}

	#===============================================================================
	# Return singleton Database instance
	#===============================================================================
	public static function getDatabase($force = FALSE): Database {
		if(!self::$Database instanceof Database OR $force === TRUE) {
			$hostname = self::get('DATABASE.HOSTNAME');
			$basename = self::get('DATABASE.BASENAME');
			$username = self::get('DATABASE.USERNAME');
			$password = self::get('DATABASE.PASSWORD');

			$Database = new Database($hostname, $basename, $username, $password);

			$Database->setAttribute(
				$Database::ATTR_DEFAULT_FETCH_MODE,
				$Database::FETCH_ASSOC
			);

			$Database->setAttribute(
				$Database::ATTR_ERRMODE,
				$Database::ERRMODE_EXCEPTION
			);

{'fraction_non_alphanumeric': 0.5031305903398927, 'fraction_numerical': 0.0, 'mean_word_length': 8.745098039215685, 'pattern_counts': {'":': 0, '<': 6, '<?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': '99529', 'n_tokens_mistral': 1008, 'n_tokens_neox': 830, 'n_words': 183}