<commit_before><?php

namespace Rudolf\Modules\Articles\One\Admin;

use Rudolf\Component\Forms\Form;
use Rudolf\Component\Html\Text;

class FormCheck extends Form
{
    /**
     */
    public function check()
    {
        $data = array_merge([
            'title' => '',
            'description' => '',
            'keywords' => '',
            'date' => '',
            'content' => '',
            'slug' => '',
            'author' => '',
            'category_ID' => '',
            'thumb' => '',
            'album' => '',
            'photos' => '',
            'homepage_hidden' => '',
            'published' => '',
        ], $this->data);

        $data = array_map(function ($a) {
            return trim($a);
        }, $data);

        if (empty($data['date'])) {
            $data['date'] = date('Y-m-d H:i:s');
        }
        if (empty($data['slug'])) {
            $data['slug'] = Text::sluger($data['title']);
        } else {
            $data['slug'] = Text::sluger($data['slug']);
        }
<commit_msg>Fix adding articles, when theme not support categories<commit_after><?php

namespace Rudolf\Modules\Articles\One\Admin;

use Rudolf\Component\Forms\Form;
use Rudolf\Component\Html\Text;

class FormCheck extends Form
{
    /**
     */
    public function check()
    {
        $data = array_merge([
            'title' => '',
            'description' => '',
            'keywords' => '',
            'date' => '',
            'content' => '',
            'slug' => '',
            'author' => '',
            'category_ID' => 0,
            'thumb' => '',
            'album' => '',
            'photos' => '',
            'homepage_hidden' => '',
            'published' => '',
        ], $this->data);

        $data = array_map(function ($a) {
            return trim($a);
        }, $data);

        if (empty($data['date'])) {
            $data['date'] = date('Y-m-d H:i:s');
        }
        if (empty($data['slug'])) {
            $data['slug'] = Text::sluger($data['title']);
        } else {
            $data['slug'] = Text::sluger($data['slug']);
        }

{'fraction_non_alphanumeric': 0.20543374642516682, 'fraction_numerical': 0.00047664442326024784, 'mean_word_length': 1.5660146699266504, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 31, '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': '927022', 'n_tokens_mistral': 619, 'n_tokens_neox': 631, 'n_words': 104}