<commit_before><?php

namespace core\controllers;

use Yii;
use core\components\Controller;
use core\models\Tag;
use yii\helpers\ArrayHelper;

/**
 * TagController implements the CRUD actions for Tag model.
 */
class TagController extends Controller
{
    var $MainModel = 'core\models\Tag';
    var $MainModelSearch = 'core\models\TagSearch';

	/**
     * @inheritdoc
     */
    public function behaviors()
    {
    	return ArrayHelper::merge(
           	[
	           	'access' => [
	                'rules' => [
	                    [
	                        'actions' => ['list'], // Define specific actions
	                        'allow' => true, // Has access
	                        'roles' => ['read::' . $this->getCompatibilityId()],
	                    ],
	                ],
	           	],
	        ],
			parent::behaviors()
		);
    }

    /**
     * Updates the prices of a product
     * If update is successful, the browser will be redirected to the 'view' page.
     * @param integer $id
     * @return mixed
     */
    public function actionList($type, $term)
    {
    	$tags = Tag::find()->where('type = :type AND LOWER(name) LIKE :term AND status<>"deleted"', [':type' => $type, ':term' => '%' . strtolower($term) . '%'])->all();
    	$response = [];
    	foreach($tags as $tag) {
    		$response[] = ["id" => $tag->id, "label" => $tag->name, "value" => $tag->name];
    	}
        Yii::$app->response->format = 'json';
        return $response;
    }    <commit_msg>spacing fix<commit_after><?php

namespace core\controllers;

use Yii;
use core\components\Controller;
use core\models\Tag;
use yii\helpers\ArrayHelper;

/**
 * TagController implements the CRUD actions for Tag model.
 */
class TagController extends Controller
{
    var $MainModel = 'core\models\Tag';
    var $MainModelSearch = 'core\models\TagSearch';

	/**
     * @inheritdoc
     */
    public function behaviors()
    {
    	return ArrayHelper::merge(
           	[
	           	'access' => [
	                'rules' => [
	                    [
	                        'actions' => ['list'], // Define specific actions
	                        'allow' => true, // Has access
	                        'roles' => ['read::' . $this->getCompatibilityId()],
	                    ],
	                ],
	           	],
	        ],
			parent::behaviors()
		);
    }

    /**
     * Updates the prices of a product
     * If update is successful, the browser will be redirected to the 'view' page.
     * @param integer $id
     * @return mixed
     */
    public function actionList($type, $term)
    {
    	$tags = Tag::find()->where('type = :type AND LOWER(name) LIKE :term AND status<>"deleted"', [':type' => $type, ':term' => '%' . strtolower($term) . '%'])->all();
    	$response = [];
    	foreach($tags as $tag) {
    		$response[] = ["id" => $tag->id, "label" => $tag->name, "value" => $tag->name];
    	}
        Yii::$app->response->format = 'json';
        return $response;
    }
{'fraction_non_alphanumeric': 0.16265060240963855, 'fraction_numerical': 0.0, 'mean_word_length': 1.8520992366412214, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 41, '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': '1051131', 'n_tokens_mistral': 920, 'n_tokens_neox': 878, 'n_words': 215}