<commit_before><?php namespace Gbrock\Table;

use Illuminate\Support\Facades\Request;
use Illuminate\Support\Facades\Input;
use Illuminate\Support\Facades\URL;

class Column
{
    /** @var Model The base model from which we can gather certain options */
    protected $model;
    /** @var string Applicable database field used in sorting */
    protected $field;
    /** @var string The default sorting direction */
    protected $direction;
    /** @var string The visible portion of the column header */
    protected $label;
    /** @var bool Whether this column can be sorted by the user */
    protected $sortable = false;
    /** @var array The CSS classes applied to the column */
    protected $classes = [];
    /**
     * @var closure
     * A rendering closure used when generating cell data, accepts the model:
     * $column->setRenderer(function($model){ return '<strong>' . $model->id . '</strong>'; })
     */
    protected $renderer;

    public static function create()
    {
        $args = func_get_args();

        $class = new static;

        // Detect instantiation scheme
        switch (count($args)) {
            case 1: // one argument passed
                if (is_string($args[0])) {
                    // Only the field was passed
                    $class->setField($args[0]);
                    $class->setLabel(ucwords(str_replace('_', ' ', $args[0])));
                } elseif (is_array($args[0])) {
                    // Just an array was sent; set the parameters.
                    $class->setParameters($args);
                }
                break;
            case 2: // two arguments
                if (is_string($args[0]) && is_string($args[1])) {
                    // Both are strings, this is a Field => Label affair.
                    $class->setField($args[0]);
                    $class->setLabel($args[1]);
                } elseif (is_string($args[0]) && is_array($args[1])) {
                    // Normal complex initialization: field and quick parameters
                    $class->setField($args[0]);<commit_msg>Fix parameter setting as per #22<commit_after><?php namespace Gbrock\Table;

use Illuminate\Support\Facades\Request;
use Illuminate\Support\Facades\Input;
use Illuminate\Support\Facades\URL;

class Column
{
    /** @var Model The base model from which we can gather certain options */
    protected $model;
    /** @var string Applicable database field used in sorting */
    protected $field;
    /** @var string The default sorting direction */
    protected $direction;
    /** @var string The visible portion of the column header */
    protected $label;
    /** @var bool Whether this column can be sorted by the user */
    protected $sortable = false;
    /** @var array The CSS classes applied to the column */
    protected $classes = [];
    /**
     * @var closure
     * A rendering closure used when generating cell data, accepts the model:
     * $column->setRenderer(function($model){ return '<strong>' . $model->id . '</strong>'; })
     */
    protected $renderer;

    public static function create()
    {
        $args = func_get_args();

        $class = new static;

        // Detect instantiation scheme
        switch (count($args)) {
            case 1: // one argument passed
                if (is_string($args[0])) {
                    // Only the field was passed
                    $class->setField($args[0]);
                    $class->setLabel(ucwords(str_replace('_', ' ', $args[0])));
                } elseif (is_array($args[0])) {
                    // Just an array was sent; set the parameters.
                    $class->setParameters($args[0]);
                }
                break;
            case 2: // two arguments
                if (is_string($args[0]) && is_string($args[1])) {
                    // Both are strings, this is a Field => Label affair.
                    $class->setField($args[0]);
                    $class->setLabel($args[1]);
                } elseif (is_string($args[0]) && is_array($args[1])) {
                    // Normal complex initialization: field and quick parameters
                    $class->setField($args[0]);
{'fraction_non_alphanumeric': 0.12589584328714765, 'fraction_numerical': 0.00692785475394171, 'mean_word_length': 1.9485915492957746, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 25, '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': '7436494', 'n_tokens_mistral': 1086, 'n_tokens_neox': 1056, 'n_words': 342}