<commit_before><?php

namespace Gizburdt\Cuztom\Fields;

use Gizburdt\Cuztom\Support\Guard;

Guard::directAccess();

class Tabs extends Field
{
    /**
     * Tabs.
     *
     * @var array
     */
    public $tabs = array();

    /**
     * Output row.
     *
     * @param string|array $value
     *
     * @return string
     *
     * @since  3.0
     */
    public function output_row($value = null)
    {
        ?>

        <tr class="cuztom-tabs">
            <td class="cuztom-field" id="<?php echo $this->get_id() ?>" colspan="2">
                <?php
                    echo $this->output();
                ?>
            </td>
        </tr>

        <?php
    }

    /**
     * Output.
     *
     * @param array $args
     *
     * @return string
     *
     * @since  3.0
     */
    public function output($args = array())
    {
        $args['type'] = 'tabs';

        ?>

        <div class="js-cuztom-tabs">
            <ul>
                <?php foreach ($this->tabs as $title => $tab) : ?>
                    <li>
                        <a href="#<?php echo $tab->get_id(); ?>">
                            <?php
                                echo $tab->title;
                            ?>
                        </a>
                    </li>
                <?php endforeach; ?>
            </ul>

            <?php foreach ($this->tabs as $title => $tab) : ?>
                <?php
                    echo $tab->output($args);
                ?>
            <?php endforeach; ?>
        </div>

        <?php
    }

    /**
     * Save.
     *
     * @param int   $object
     * @param array $values
     *
     * @return void
     *
     * @since  3.0
     */
    public function save($object, $values)
    {
        foreach ($this->tabs as $tab) {
            $tab->save($object, $values);
        }
    }

    /**
     * Build.
     *
     * @param array        $data
     * @param string|array $value
     *
     * @return void
     *
     * @since  3.0
     */
    public function build($data, $value)
    {
        foreach ($data as $title => $field) {
            $args = array_merge(array('title' => $title, 'meta_type' => $this->meta_type, 'object' => $this->object));
            $tab  = new Tab($args);

            $tab->build($field['fields'], $value);

            $this->tabs[$title] = $tab;
        }
    }
}<commit_msg>PHPdoc style<commit_after><?php

namespace Gizburdt\Cuztom\Fields;

use Gizburdt\Cuztom\Support\Guard;

Guard::directAccess();

class Tabs extends Field
{
    /**
     * Tabs.
     * @var array
     */
    public $tabs = array();

    /**
     * Output row.
     *
     * @param string|array $value
     * @return string
     * @since  3.0
     */
    public function output_row($value = null)
    {
        ?>

        <tr class="cuztom-tabs">
            <td class="cuztom-field" id="<?php echo $this->get_id() ?>" colspan="2">
                <?php
                    echo $this->output();
                ?>
            </td>
        </tr>

        <?php
    }

    /**
     * Output.
     *
     * @param array $args
     * @return string
     * @since  3.0
     */
    public function output($args = array())
    {
        $args['type'] = 'tabs';

        ?>

        <div class="js-cuztom-tabs">
            <ul>
                <?php foreach ($this->tabs as $title => $tab) : ?>
                    <li>
                        <a href="#<?php echo $tab->get_id(); ?>">
                            <?php
                                echo $tab->title;
                            ?>
                        </a>
                    </li>
                <?php endforeach; ?>
            </ul>

            <?php foreach ($this->tabs as $title => $tab) : ?>
                <?php
                    echo $tab->output($args);
                ?>
            <?php endforeach; ?>
        </div>

        <?php
    }

    /**
     * Save.
     *
     * @param int   $object
     * @param array $values
     * @return void
     * @since  3.0
     */
    public function save($object, $values)
    {
        foreach ($this->tabs as $tab) {
            $tab->save($object, $values);
        }
    }

    /**
     * Build.
     *
     * @param array        $data
     * @param string|array $value
     * @return void
     * @since  3.0
     */
    public function build($data, $value)
    {
        foreach ($data as $title => $field) {
            $args = array_merge(array('title' => $title, 'meta_type' => $this->meta_type, 'object' => $this->object));
            $tab  = new Tab($args);

            $tab->build($field['fields'], $value);

            $this->tabs[$title] = $tab;
        }
    }
}
{'fraction_non_alphanumeric': 0.16067608044501497, 'fraction_numerical': 0.0038510911424903724, 'mean_word_length': 1.1444954128440368, 'pattern_counts': {'":': 0, '<': 51, '<?xml version=': 0, '>': 87, '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': '6326832', 'n_tokens_mistral': 1446, 'n_tokens_neox': 1396, 'n_words': 295}