<commit_before><?php

namespace frontend\controllers;

use common\models\Goods;
use common\models\GoodsCategory;
use yii\data\ActiveDataProvider;
use yii\helpers\Url;
use yii\web\NotFoundHttpException;

class CatalogController extends \yii\web\Controller
{
    public function beforeAction($action)
    {
        if (parent::beforeAction($action)) {
            Url::remember();
            return true;
        } else {
            return false;
        }
    }

    public function actionIndex($id = null)
    {
        /** @var goodsCategory $category */
        $category = null;

        $categories = GoodsCategory::find()->where(['status'=>GoodsCategory::STATUS_ACTIVE])->indexBy('id')->orderBy('id')->all();

        $goodsQuery = Goods::find();
        if ($id !== null && isset($categories[$id])) {
            $category = $categories[$id];
            $goodsQuery->where(['category_id' => $this->getCategoryIds($categories, $id)]);
        }

        $goodsDataProvider = new ActiveDataProvider([
            'query' => $goodsQuery,
            'pagination' => [
                'pageSize' => 6,
            ],
        ]);
<commit_msg>Commit<commit_after><?php

namespace frontend\controllers;

use common\models\Goods;
use common\models\GoodsCategory;
use yii\data\ActiveDataProvider;
use yii\helpers\Url;
use yii\web\NotFoundHttpException;

class CatalogController extends \yii\web\Controller
{
    public function beforeAction($action)
    {
        if (parent::beforeAction($action)) {
            Url::remember();
            return true;
        } else {
            return false;
        }
    }

    public function actionIndex($id = null)
    {
        /** @var goodsCategory $category */
        $category = null;

        $categories = GoodsCategory::find()->where(['status'=>GoodsCategory::STATUS_ACTIVE])->indexBy('id')->orderBy('id')->all();

        $goodsQuery = Goods::find();
        if ($id !== null && isset($categories[$id])) {
            $category = $categories[$id];
            $goodsQuery->where(['category_id' => $this->getCategoryIds($categories, $id)]);
        }

        $goodsDataProvider = new ActiveDataProvider([
            'query' => $goodsQuery,
            'pagination' => [
                'pageSize' => 25,
            ],
        ]);

{'fraction_non_alphanumeric': 0.15223097112860892, 'fraction_numerical': 0.0013123359580052493, 'mean_word_length': 2.4185351270553066, 'pattern_counts': {'":': 0, '<': 5, '<?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': '1777062', 'n_tokens_mistral': 654, 'n_tokens_neox': 643, 'n_words': 116}