Code Duplication    Length = 3-3 lines in 2 locations

Apps/Controller/Api/Content.php 1 location

@@ 57-59 (lines=3) @@
54
    public function actionChangerate($type, $id)
55
    {
56
        // check input params
57
        if (!Arr::in($type, ['plus', 'minus']) || !Obj::isLikeInt($id)) {
58
            throw new NativeException('Bad conditions');
59
        }
60
        
61
        // get current user and check is authed
62
        $user = App::$User->identity();

Apps/Controller/Api/Profile.php 1 location

@@ 338-340 (lines=3) @@
335
        // get current user object
336
        $user = App::$User->identity();
337
338
        if (Arr::in($queryType, ['before', 'after']) && (!Obj::isLikeInt($queryId) || $queryId < 1)) {
339
            throw new NativeException('Bad input data');
340
        }
341
342
        $messages = null;
343
        // sounds like a Hindi code, but we need more closures to organize where conditions