<commit_before><?php namespace Zofe\Rapyd\DataGrid;

use Zofe\Rapyd\Helpers\HTML;

class Column
{
    public $name;
    public $link = "";
    public $label = "";
    public $orderby = null;
    public $orderby_field = null;
    public $attributes = array();
    public $filters = array();

    public $key = 'id';
    public $uri = null;
    public $actions = array();

    public $value = null;
    public $cell_callable;

    public function __construct($name, $label = null, $orderby = false)
    {
        $this->name = $name;

        //check for filters
        $filter = strstr($name, '|');
        if ($filter) {
            $this->name = strstr($name, '|', true);<commit_msg>BugFix: DataGrid will crash when add a column with no $name given<commit_after><?php namespace Zofe\Rapyd\DataGrid;

use Zofe\Rapyd\Helpers\HTML;

class Column
{
    public $name;
    public $link = "";
    public $label = "";
    public $orderby = null;
    public $orderby_field = null;
    public $attributes = array();
    public $filters = array();

    public $key = 'id';
    public $uri = null;
    public $actions = array();

    public $value = null;
    public $cell_callable;

    public function __construct($name, $label = null, $orderby = false)
    {

        if (!$name) {
            throw new \Exception('$name must be given when creating Column object.');    
        }

        $this->name = $name;

        //check for filters
        $filter = strstr($name, '|');
        if ($filter) {
            $this->name = strstr($name, '|', true);
{'fraction_non_alphanumeric': 0.1448900388098318, 'fraction_numerical': 0.0, 'mean_word_length': 2.437777777777778, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '4085465', 'n_tokens_mistral': 487, 'n_tokens_neox': 477, 'n_words': 138}