<commit_before><?php

namespace iproger\colorlist;

use yii\helpers\ArrayHelper;

class ColorList extends widgets\ColorList\AbstractColorList
{

    public function getColors()
    {
        return ArrayHelper::map(Color::find()->orderBy(['id' => SORT_ASC])->all(), 'id', 'name');
    }

}<commit_msg>change getColors() and create getModel() in ColorList<commit_after><?php

namespace iproger\colorlist;

use yii\helpers\ArrayHelper;
use iproger\colorlist\models\Color;

class ColorList extends widgets\ColorList\AbstractColorList
{

    public function getColors()
    {
        $model = $this->getModel();

        $colors = $model::find()
            ->orderBy(['id' => SORT_ASC])
            ->all();

        return ArrayHelper::map($colors, 'id', 'name');
    }

    public function getModel()
    {
        return Color;
    }

}
{'fraction_non_alphanumeric': 0.14354066985645933, 'fraction_numerical': 0.0, 'mean_word_length': 3.248730964467005, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 10, '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': '4573127', 'n_tokens_mistral': 260, 'n_tokens_neox': 262, 'n_words': 53}