<commit_before><?php

namespace Picon\Lib;

class Model{

    static protected $db;

    public function __construct(){
        $this->setConnection();
    }

    protected function setConnection($force = false){
        $connectionInfos    =   Config::get_value("db");
        $connectionString   =   "mysql:host=localhost;dbname=" . $connectionInfos["name"];
        if(!isset($db) || $force){
            try{
                self::$db   =   new PDO($connectionString, $connectionInfos["user"], $connectionInfos["pass"]);
            } catch (PDOException $e){
                throw new HttpException(500, $e->getMessage());
            }
        }
        return self::db;

    }

    protected function getConnection(){
        if(!isset(self::$db)){
            $this->setConnection();
        }
        return self::$db;
    }

}<commit_msg>[wip] Minor fixes on model (PDO namespace)<commit_after><?php

namespace Picon\Lib;

class Model{

    static protected $db;

    public function __construct(){
        $this->setConnection();
    }

    protected function setConnection($force = false){
        $connectionInfos    =   Config::get_value("db");
        $connectionString   =   "mysql:host=localhost;dbname=" . $connectionInfos["name"];
        if(!isset(self::$db) || $force){
            try{
                self::$db   =   new \PDO($connectionString, $connectionInfos["user"], $connectionInfos["pass"]);
            } catch (PDOException $e){
                throw new HttpException(500, $e->getMessage());
            }
        }
        return self::$db;

    }

    protected function getConnection(){
        if(!isset(self::$db)){
            $this->setConnection();
        }
        return self::$db;
    }

}
{'fraction_non_alphanumeric': 0.1488747836122331, 'fraction_numerical': 0.003462204270051933, 'mean_word_length': 2.235074626865672, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '7607676', 'n_tokens_mistral': 493, 'n_tokens_neox': 482, 'n_words': 96}