<commit_before><?php namespace S36DataObject;

use DB, S36Auth, Config;
use Exception;

abstract class S36DataObject { 

    public $dbh, $user_id, $company_id, $company_name, $email, $username;
    public $db_name = 'master';

    public function __construct() { 
        $this->dbh = DB::connection($this->db_name)->pdo;       
        $this->company_name = Config::get('application.subdomain');
        //TODO: Take note if no login cookie you cannot test inbox specific data retrieval
        if(S36Auth::check()) {
            $this->user_id = S36Auth::user()->userid;             
            $this->company_id = S36Auth::user()->companyid;             
            $this->username = S36Auth::user()->username;             
            $this->email = S36Auth::user()->email;             
        } 
    }

    public function escape($string) {
        $return = '';

        for($i = 0; $i < strlen($string); ++$i) {
            $char = $string[$i];
            $ord = ord($char);<commit_msg>got this drink in my cup<commit_after><?php namespace S36DataObject;

use DB, S36Auth, Config;
use Exception;

abstract class S36DataObject { 

    public $dbh, $user_id, $company_id, $company_name, $email, $username;
    public $db_name = 'master';

    public function __construct() { 
        $this->dbh = DB::connection($this->db_name)->pdo;       
        $this->company_name = $this->_is_valid_company(Config::get('application.subdomain'));
        //TODO: Take note if no login cookie you cannot test inbox specific data retrieval
        if(S36Auth::check()) {
            $this->user_id = S36Auth::user()->userid;             
            $this->company_id = S36Auth::user()->companyid;             
            $this->username = S36Auth::user()->username;             
            $this->email = S36Auth::user()->email;             
        } 
    }

    private function _is_valid_company($company_name) {
        $sql = "SELECT * FROM Company WHERE Company.name = :company_name LIMIT 1";
        $sth = $this->dbh->prepare($sql);
        $sth->bindParam(":company_name", $company_name); 
        $sth->execute();
        $result = $sth->fetch(PDO::FETCH_OBJ);
        if(!$result)  
            throw new Exception("Company ".$this->company_name." does not exists!");
    }

    public function escape($string) {
        $return = '';

        for($i = 0; $i < strlen($string); ++$i) {
            $char = $string[$i];
            $ord = ord($char);
{'fraction_non_alphanumeric': 0.15209434729564864, 'fraction_numerical': 0.014233428222854819, 'mean_word_length': 2.271276595744681, 'pattern_counts': {'":': 1, '<': 7, '<?xml version=': 0, '>': 34, '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': '4665109', 'n_tokens_mistral': 758, 'n_tokens_neox': 719, 'n_words': 163}