<commit_before><?php
namespace Riesenia\Utility\Kendo\Table\Column;

/**
 * Base class for Table helper columns
 *
 * @author <NAME> <<EMAIL>>
 */
class Base
{
    /**
     * Type used for model type property
     *
     * @var string
     */
    protected $_type = 'string';

    /**
     * Column template with %format% / %field% / %class% placeholder
     *
     * @var string
     */
    protected $_template = '<td class="%class%" style="%style%">%format%</td>';

    /**
     * Field format with %field% placeholder
     *
     * @var string
     */
    protected $_format = '#: %field% #';

    /**
     * Predefined class
     *
     * @var string
     */
    protected $_class = 'tableColumn';

    /**
     * Options
     *
     * @var array
     */
    protected $_options = [];

    /**
     * Model options
     *
     * @var array
     */
    protected $_modelOptions = [];

    /**
     * Table id
     *
     * @var string
     */
    protected $_tableId;

    /**
     * Construct the column
     *
     * @param array options
     * @param string table id
     */
    public function __construct(array $options, $tableId)
    {
        $this->_tableId = $tableId;

        // model options first
        if (isset($options['model'])) {
            $this->_modelOptions = $options['model'];
            unset($options['model']);
        }

        $this->_options = $options;

        // class
        $this->_options['class'] = isset($this->_options['class']) ? $this->_class . ' ' . $this->_options['class'] : $this->_class;

        // cell display has to be handled manually
        $style = '# for (var i = 0; i < grid.columns.length; i++) { if (grid.columns[i].field == "' . $this->_options['field'] . '") { ##: grid.columns[i].hidden ? "display: none;" : "" ## break; } } #';

        // style
        $this->_options['style'] = isset($this->_options['style']) ? $style . ' ' . $this->_options['style'] : $style;

        if (!isset($this->_options['headerAttributes']['class'])) {
            $this->_options['headerAttributes']['class'] = $this->_options['class'];
        }

        // template
        if (isset($this->_options['template'])) {
            $this->_template = str_replace('%format%', $this->_options['template'], $this->_template);
        }<commit_msg>code optimalization<commit_after><?php
namespace Riesenia\Utility\Kendo\Table\Column;

/**
 * Base class for Table helper columns
 *
 * @author <NAME> <<EMAIL>>
 */
class Base
{
    /**
     * Type used for model type property
     *
     * @var string
     */
    protected $_type = 'string';

    /**
     * Column template with %format% / %field% / %class% placeholder
     *
     * @var string
     */
    protected $_template = '<td class="%class%" style="%style%">%format%</td>';

    /**
     * Field format with %field% placeholder
     *
     * @var string
     */
    protected $_format = '#: %field% #';

    /**
     * Predefined class
     *
     * @var string
     */
    protected $_class = 'tableColumn';

    /**
     * Options
     *
     * @var array
     */
    protected $_options = [];

    /**
     * Model options
     *
     * @var array
     */
    protected $_modelOptions = [];

    /**
     * Table id
     *
     * @var string
     */
    protected $_tableId;

    /**
     * Construct the column
     *
     * @param array options
     * @param string table id
     */
    public function __construct(array $options, $tableId)
    {
        $this->_tableId = $tableId;

        // model options first
        if (isset($options['model'])) {
            $this->_modelOptions = $options['model'];
            unset($options['model']);
        }

        $this->_options = $options;

        // class
        $this->_options['class'] = isset($this->_options['class']) ? $this->_class . ' ' . $this->_options['class'] : $this->_class;

        // cell display has to be handled manually
        $style = '#: grid.columns[grid.element.find("th[data-field=' . $this->_options['field'] . ']").data("index")].hidden ? "display: none;" : "" #';

        // style
        $this->_options['style'] = isset($this->_options['style']) ? $style . ' ' . $this->_options['style'] : $style;

        if (!isset($this->_options['headerAttributes']['class'])) {
            $this->_options['headerAttributes']['class'] = $this->_options['class'];
        }

        // template
        if (isset($this->_options['template'])) {
            $this->_template = str_replace('%format%', $this->_options['template'], $this->_template);
        }
{'fraction_non_alphanumeric': 0.18385748845392566, 'fraction_numerical': 0.00021992522542335605, 'mean_word_length': 2.0813008130081303, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 51, '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': '795567', 'n_tokens_mistral': 1332, 'n_tokens_neox': 1307, 'n_words': 282}