<commit_before><?php
/**
 * @title            Db (Database) Class
 * @desc             PDO Singleton Class
 *
 * @author           <NAME> <<EMAIL>>
 * @copyright        (c) 2011-2018, <NAME>. All Rights Reserved.
 * @license          GNU General Public License; See PH7.LICENSE.txt and PH7.COPYRIGHT.txt in the root directory.
 * @package          PH7 / Framework / Mvc / Model / Engine
 * @version          1.6
 */

namespace PH7\Framework\Mvc\Model\Engine;

defined('PH7') or exit('Restricted access');

use PDO;
use PDOStatement;

/**
 * @class Singleton Class
 */
class Db
{
    const ASC = 'ASC';
    const DESC = 'DESC';
    const RAND = 'RAND()';
    
    /** @var  string */
    private static $sDsn;

    /** @var string */
    private static $sUsername;

    /** @var string */
    private static $sPassword;

    /** @var string */
    private static $sPrefix;

    /** @var array */
    private static $aDriverOptions;

    /** @var int */
    private static $iCount = 0;

    /** @var float */
    private static $fTime = 0.0;

    /** @var self|null */
    private static $oInstance = null;

    /** @var PDO */
    private static $oDb;

    /**
     * The constructor is set to private, so nobody can create a new instance using new.
     */
    private function __construct()
    {
    }

    /**
     * @return Db Returns the PDO instance class or create initial connection.
     */
    public static function getInstance($sDsn = NULL, $sUsername = NULL, $sPassword = NULL, $aDriverOptions = NULL, $sPrefix = NULL)
    {
        if (NULL === self::$oInstance) {
            if (!empty($sDsn)) {
                self::$sDsn = $sDsn;
            }

            if (!empty($sUsername)) {
                self::$sUsername = $sUsername;
            }

            if (!empty($sPassword)) {
                self::$sPassword = $sPassword;
            }

            if (!empty($aDriverOptions)) {
                self::$aDriverOptions = $aDriverOptions;
            }

            if (!empty($sPrefix)) {
                self::$sPrefix = $sPrefix;
            }

            self::$oInstance = new static;<commit_msg>Add missing docBlock + use "null" val lowercase<commit_after><?php
/**
 * @title            Db (Database) Class
 * @desc             PDO Singleton Class
 *
 * @author           <NAME> <<EMAIL>>
 * @copyright        (c) 2011-2018, <NAME>. All Rights Reserved.
 * @license          GNU General Public License; See PH7.LICENSE.txt and PH7.COPYRIGHT.txt in the root directory.
 * @package          PH7 / Framework / Mvc / Model / Engine
 * @version          1.6
 */

namespace PH7\Framework\Mvc\Model\Engine;

defined('PH7') or exit('Restricted access');

use PDO;
use PDOStatement;

/**
 * @class Singleton Class
 */
class Db
{
    const ASC = 'ASC';
    const DESC = 'DESC';
    const RAND = 'RAND()';

    /** @var  string */
    private static $sDsn;

    /** @var string */
    private static $sUsername;

    /** @var string */
    private static $sPassword;

    /** @var string */
    private static $sPrefix;

    /** @var array */
    private static $aDriverOptions;

    /** @var int */
    private static $iCount = 0;

    /** @var float */
    private static $fTime = 0.0;

    /** @var self|null */
    private static $oInstance = null;

    /** @var PDO */
    private static $oDb;

    /**
     * The constructor is set to private, so nobody can create a new instance using new.
     */
    private function __construct()
    {
    }

    /**
     * @param string|null $sDsn
     * @param string|null $sUsername
     * @param string|null $sPassword
     * @param array|null $aDriverOptions
     * @param string|null $sPrefix
     *
     * @return self Returns the PDO instance class or create initial connection.
     */
    public static function getInstance($sDsn = null, $sUsername = null, $sPassword = null, $aDriverOptions = null, $sPrefix = null)
    {
        if (self::$oInstance === null) {
            if (!empty($sDsn)) {
                self::$sDsn = $sDsn;
            }

            if (!empty($sUsername)) {
                self::$sUsername = $sUsername;
            }

            if (!empty($sPassword)) {
                self::$sPassword = $sPassword;
            }

            if (!empty($aDriverOptions)) {
                self::$aDriverOptions = $aDriverOptions;
            }

            if (!empty($sPrefix)) {
                self::$sPrefix = $sPrefix;
            }

            self::$oInstance = new static;
{'fraction_non_alphanumeric': 0.1340782122905028, 'fraction_numerical': 0.008044692737430168, 'mean_word_length': 1.8637236084452975, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 11, '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': '3220150', 'n_tokens_mistral': 1358, 'n_tokens_neox': 1302, 'n_words': 380}