Code Duplication    Length = 9-11 lines in 2 locations

models/Mission.php 1 location

@@ 287-295 (lines=9) @@
284
        $this->action->complete();
285
    }
286
287
    private function fetchRoutine()
288
    {
289
        $res = Yii::app()->db->createCommand()
290
            ->select('routine')
291
            ->from('users_missions')
292
            ->where('uid=:uid AND id=:id', [':uid'=>Yii::app()->player->model->uid, ':id'=>(int)$this->id])
293
            ->queryScalar();
294
        return (int)$res;
295
    }
296
297
    private function fetchBaits()
298
    {

models/Shop.php 1 location

@@ 86-96 (lines=11) @@
83
        return (int)$levelLimit;
84
    }
85
    
86
    public function getNextItemsLevel()
87
    {
88
        $nextLevel = Yii::app()->db->createCommand()
89
            ->select('level')
90
            ->from($this->item_type.'s')
91
            ->where('level > :level', [':level'=>Yii::app()->player->model->level])
92
            ->order('level ASC')
93
            ->limit(1)
94
            ->queryScalar();
95
        return (int)$nextLevel;
96
    }
97
98
    public function setItem_type($type)
99
    {