Code Duplication    Length = 3-3 lines in 2 locations

Apps/Controller/Front/Content.php 1 location

@@ 177-179 (lines=3) @@
174
        $tagName = trim($tagName);
175
176
        // check if tag is not empty
177
        if (Str::likeEmpty($tagName) || Str::length($tagName) < 2) {
178
            throw new NotFoundException(__('Tag is empty or is too short!'));
179
        }
180
181
        // get equal rows order by creation date
182
        $records = ContentEntity::where('meta_keywords', 'like', '%' . $tagName . '%')->orderBy('created_at', 'DESC')->take(self::TAG_PER_PAGE);

Apps/Controller/Front/Search.php 1 location

@@ 35-37 (lines=3) @@
32
        $configs = $this->getConfigs();
33
34
        // check search query length
35
        if (Str::likeEmpty($query) || Str::length($query) < (int)$configs['minLength']) {
36
            throw new NotFoundException(__('Search query is too short!'));
37
        }
38
39
        // prevent sh@t query's with big length
40
        if (Str::length($query) > static::QUERY_MAX_LENGTH) {