<commit_before><?php

namespace Opifer\CrudBundle\Datagrid\Cell\Type;

use Opifer\CrudBundle\Datagrid\Column\Column;

class CountCell extends AbstractCell
{
    /**
     * {@inheritDoc}
     */
    public function getData($row, Column $column, array $attributes)
    {
        $value = parent::getData($row, $column, $attributes);

        if (!is_array($value) && !$value instanceof \Countable) {
            throw new \Exception('The value in a CountCell must be an array or an instance of \Countable');
        }

        return count($value);
    }

    /**
     * {@inheritDoc}
     */
    public function getView()
    {
        return 'label';
    }

    /**
     * {@inheritDoc}
     */
    public function getName()
    {
        return 'label';
    }
}<commit_msg>Fixed count cell view<commit_after><?php

namespace Opifer\CrudBundle\Datagrid\Cell\Type;

use Opifer\CrudBundle\Datagrid\Column\Column;

class CountCell extends AbstractCell
{
    /**
     * {@inheritDoc}
     */
    public function getData($row, Column $column, array $attributes)
    {
        $value = parent::getData($row, $column, $attributes);

        if (!is_array($value) && !$value instanceof \Countable) {
            throw new \Exception('The value in a CountCell must be an array or an instance of \Countable');
        }

        return count($value);
    }

    /**
     * {@inheritDoc}
     */
    public function getView()
    {
        return 'text';
    }

    /**
     * {@inheritDoc}
     */
    public function getName()
    {
        return 'count';
    }
}
{'fraction_non_alphanumeric': 0.13247588424437298, 'fraction_numerical': 0.0, 'mean_word_length': 2.2416666666666667, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '4869564', 'n_tokens_mistral': 470, 'n_tokens_neox': 464, 'n_words': 115}