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

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