<commit_before><?php

namespace Synful\DataManagement\Models;

use Synful\Synful;

/**
 * Class used for handling API Permissions in database
 */
class APIKeyPermissions
{

    /**
     * The API Key associated associated with the permissions
     *
     * @var int
     */
    public $api_key_id = -1;

    /**
     * Put data permission
     *
     * @var int
     */
    public $put_data = 0;

    /**
     * Get data permission
     *
     * @var int
     */
    public $get_data = 0;

    /**
     * Modify data permission
     *
     * @var int
     */
    public $mod_data = 0;


    /**
     * Create a new instance of APIPermissions
     *
     * @param int $id
     * @param int $put_data
     * @param int $get_data
     * @param int $mod_data
     */
    public function __construct($id, $put_data = 0, $get_data = 0, $mod_data = 0)
    {
        $this->api_key_id = $id;

        $res = Synful::$sql->executeSql(
            'SELECT * FROM `api_perms` WHERE `api_key_id` = ?',
            [
             's',
             $this->api_key_id,
            ],
            true
        );

        if ($res->num_rows > 0) {
            $res           = mysqli_fetch_assoc($res);
            $this->put_data = $res['put_data'];
            $this->get_data = $res['get_data'];
            $this->mod_data = $res['mod_data'];
        } else {
            $this->put_data = $put_data;
            $this->get_data = $get_data;
            $this->mod_data = $mod_data;
            $this->save();
        }
    }


    /**
     * Save changes made to the permissions
     */
    public function save()
    {
        Synful::$sql->executeSql(
            'INSERT INTO `api_perms` (`api_key_id`, `put_data`, `get_data`,'.
            ' `mod_data`) VALUES (?, ?, ?, ?) ON DUPLICATE KEY UPDATE '.
            '`put_data` = ?, `get_data` = ?, `mod_data` = ?',
            [
             'iiiiiii',
             (int) $this->api_key_id,
             (int) $this->put_data,
             (int) $this->get_data,
             (int) $this->mod_data,
             (int) $this->put_data,
             (int) $this->get_data,
             (int) $this->mod_data,
            ]
        );
    }


    /**
     * Delete the permissions
     */
    public function delete()
    {
        Synful::$sql->executeSql(
            'DELETE FROM `api_perms` WHERE `api_key_id` = ?',
            [
             's',
             (int) $this->api_key_id,
            ]
        );
    }
}<commit_msg>Fixed more Style CI Issues<commit_after><?php

namespace Synful\DataManagement\Models;

use Synful\Synful;

/**
 * Class used for handling API Permissions in database.
 */
class APIKeyPermissions
{

    /**
     * The API Key associated associated with the permissions.
     *
     * @var int
     */
    public $api_key_id = -1;

    /**
     * Put data permission.
     *
     * @var int
     */
    public $put_data = 0;

    /**
     * Get data permission.
     *
     * @var int
     */
    public $get_data = 0;

    /**
     * Modify data permission.
     *
     * @var int
     */
    public $mod_data = 0;


    /**
     * Create a new instance of APIPermissions.
     *
     * @param int $id
     * @param int $put_data
     * @param int $get_data
     * @param int $mod_data
     */
    public function __construct($id, $put_data = 0, $get_data = 0, $mod_data = 0)
    {
        $this->api_key_id = $id;

        $res = Synful::$sql->executeSql(
            'SELECT * FROM `api_perms` WHERE `api_key_id` = ?',
            [
             's',
             $this->api_key_id,
            ],
            true
        );

        if ($res->num_rows > 0) {
            $res           = mysqli_fetch_assoc($res);
            $this->put_data = $res['put_data'];
            $this->get_data = $res['get_data'];
            $this->mod_data = $res['mod_data'];
        } else {
            $this->put_data = $put_data;
            $this->get_data = $get_data;
            $this->mod_data = $mod_data;
            $this->save();
        }
    }


    /**
     * Save changes made to the permissions.
     */
    public function save()
    {
        Synful::$sql->executeSql(
            'INSERT INTO `api_perms` (`api_key_id`, `put_data`, `get_data`,'.
            ' `mod_data`) VALUES (?, ?, ?, ?) ON DUPLICATE KEY UPDATE '.
            '`put_data` = ?, `get_data` = ?, `mod_data` = ?',
            [
             'iiiiiii',
             (int) $this->api_key_id,
             (int) $this->put_data,
             (int) $this->get_data,
             (int) $this->mod_data,
             (int) $this->put_data,
             (int) $this->get_data,
             (int) $this->mod_data,
            ]
        );
    }


    /**
     * Delete the permissions.
     */
    public function delete()
    {
        Synful::$sql->executeSql(
            'DELETE FROM `api_perms` WHERE `api_key_id` = ?',
            [
             's',
             (int) $this->api_key_id,
            ]
        );
    }
}
{'fraction_non_alphanumeric': 0.14501510574018128, 'fraction_numerical': 0.0032225579053373615, 'mean_word_length': 1.4259892525647289, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 47, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, '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': '7245507', 'n_tokens_mistral': 1665, 'n_tokens_neox': 1615, 'n_words': 334}