GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Code Duplication    Length = 25-28 lines in 2 locations

application/backend/models/BackendMenu.php 1 location

@@ 149-173 (lines=25) @@
146
     * @param  integer $id ID of record
147
     * @return BackendMenu BackendMenu instance
148
     */
149
    public static function findById($id)
150
    {
151
        if (!isset(static::$identity_map[$id])) {
152
            $cacheKey = static::tableName().":$id";
153
            if (false === $model = Yii::$app->cache->get($cacheKey)) {
154
                $model = static::find()->where(['id' => $id]);
155
                
156
                if (null !== $model = $model->one()) {
157
                    Yii::$app->cache->set(
158
                        $cacheKey,
159
                        $model,
160
                        86400,
161
                        new TagDependency([
162
                            'tags' => [
163
                                \devgroup\TagDependencyHelper\ActiveRecordHelper::getCommonTag(static::className())
164
                            ]
165
                        ])
166
                    );
167
                }
168
            }
169
            static::$identity_map[$id] = $model;
170
        }
171
172
        return static::$identity_map[$id];
173
    }
174
175
    /**
176
     * Returns all available to logged user BackendMenu items in yii\widgets\Menu acceptable format

application/models/PropertyStaticValues.php 1 location

@@ 135-162 (lines=28) @@
132
     * @param int $id
133
     * @return null|PropertyStaticValues
134
     */
135
    public static function findById($id)
136
    {
137
        if (!isset(static::$identity_map[$id])) {
138
            $cacheKey = "PropertyStaticValue:$id";
139
140
            if (false === $property = Yii::$app->cache->get($cacheKey)) {
141
                if (null !== $property = static::find()->where(['id' => $id])->asArray()->one()) {
142
                    Yii::$app->cache->set(
143
                        $cacheKey,
144
                        $property,
145
                        0,
146
                        new TagDependency(
147
                            [
148
                                'tags' => [
149
                                    \devgroup\TagDependencyHelper\ActiveRecordHelper::getObjectTag(
150
                                        static::className(),
151
                                        $id
152
                                    ),
153
                                ],
154
                            ]
155
                        )
156
                    );
157
                }
158
            }
159
            static::$identity_map[$id] = $property;
160
        }
161
        return static::$identity_map[$id];
162
    }
163
164
    /**
165
     * Возвращает массив возможных значений свойств по property_id