<commit_before><?php

declare(strict_types=1);

namespace App\Orchid\Layouts\Category;

use Orchid\Screen\Field;
use Orchid\Screen\Layouts\Rows;

class CategoryEditLayout extends Rows
{
    /**
     * Views.
     *
     * @return array
     * @throws \Throwable
     */
    public function fields(): array
    {
        return [
            Field::tag('input')
                ->type('text')
                ->name('category.content.name')
                ->modifyValue(function () {
                    if ($this->query->getContent('category')->exists) {
                        return $this->query->getContent('category')->term->GetContent('name');
                    }
                })
                ->max(255)
                ->require()
                ->title(__('Category name'))
                ->placeholder(__('Category name'))
                ->help(__('Category title')),

            Field::tag('input')
                ->type('text')
                ->name('category.slug')
                ->max(255)
                ->require()
                ->title(__('Slug')),

            Field::tag('select')
                ->options(function () {
                    $options = $this->query->getContent('catselect');
                    
                    return array_replace([0=> __('Without parent')],$options);
                })
                ->name('category.parent_id')
                ->title(__('Parent Category')),

            Field::tag('wysiwyg')
                ->name('category.content.body')
                ->modifyValue(function () {
                    if ($this->query->getContent('category')->exists) {
                        return $this->query->getContent('category')->term->GetContent('body');
                    }<commit_msg>Apply fixes from StyleCI<commit_after><?php

declare(strict_types=1);

namespace App\Orchid\Layouts\Category;

use Orchid\Screen\Field;
use Orchid\Screen\Layouts\Rows;

class CategoryEditLayout extends Rows
{
    /**
     * Views.
     *
     * @return array
     * @throws \Throwable
     */
    public function fields(): array
    {
        return [
            Field::tag('input')
                ->type('text')
                ->name('category.content.name')
                ->modifyValue(function () {
                    if ($this->query->getContent('category')->exists) {
                        return $this->query->getContent('category')->term->GetContent('name');
                    }
                })
                ->max(255)
                ->require()
                ->title(__('Category name'))
                ->placeholder(__('Category name'))
                ->help(__('Category title')),

            Field::tag('input')
                ->type('text')
                ->name('category.slug')
                ->max(255)
                ->require()
                ->title(__('Slug')),

            Field::tag('select')
                ->options(function () {
                    $options = $this->query->getContent('catselect');

                    return array_replace([0=> __('Without parent')], $options);
                })
                ->name('category.parent_id')
                ->title(__('Parent Category')),

            Field::tag('wysiwyg')
                ->name('category.content.body')
                ->modifyValue(function () {
                    if ($this->query->getContent('category')->exists) {
                        return $this->query->getContent('category')->term->GetContent('body');
                    }
{'fraction_non_alphanumeric': 0.15702947845804988, 'fraction_numerical': 0.0045351473922902496, 'mean_word_length': 1.3957909029192126, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 73, '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': '1370421', 'n_tokens_mistral': 922, 'n_tokens_neox': 841, 'n_words': 128}