<commit_before><?php
namespace errorapi\controllers;

class DefaultController extends \luya\rest\Controller
{
    public function userAuthClass()
    {
        return false;
    }

    /**
     * @param $_POST['error_json']
     *
     * @return string
     */
    public function actionCreate()
    {
        $model = new \errorapi\models\Data();
        $model->error_json = \yii::$app->request->post('error_json', null);
        if ($model->save()) {
            return true;
        } else {
            return $model->getErrors();
        }
    }

    /**
     * @todo see if the error request have changed based on a bug system.
     */
    public function actionResolve()
    {
    }
}<commit_msg>sendmail<commit_after><?php
namespace errorapi\controllers;

class DefaultController extends \luya\rest\Controller
{
    public function userAuthClass()
    {
        return false;
    }

    /**
     * @param $_POST['error_json']
     *
     * @return string
     */
    public function actionCreate()
    {
        $model = new \errorapi\models\Data();
        $model->error_json = \yii::$app->request->post('error_json', null);
        if ($model->save()) {
            /*
            \yii::$app->mail->compose('Subject', print_r(json_decode($model->error_json, true), true))->address('<EMAIL>')->send();
            */
            return true;
        } else {
            return $model->getErrors();
        }
    }

    /**
     * @todo see if the error request have changed based on a bug system.
     */
    public function actionResolve()
    {
    }
}
{'fraction_non_alphanumeric': 0.14249201277955273, 'fraction_numerical': 0.0, 'mean_word_length': 1.994263862332696, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 19, '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': '2489096', 'n_tokens_mistral': 458, 'n_tokens_neox': 457, 'n_words': 100}