Code Duplication    Length = 3-3 lines in 3 locations

Apps/Model/Api/Comments/CommentAdd.php 1 location

@@ 54-56 (lines=3) @@
51
    public function check()
52
    {
53
        // check if user is auth'd or guest name is defined
54
        if (!App::$User->isAuth() && ((int)$this->_configs['guestAdd'] !== 1 || Str::length($this->guestName) < 2)) {
55
            throw new JsonException(__('Guest name is not defined'));
56
        }
57
58
        // check if pathway is empty
59
        if (Str::likeEmpty($this->pathway)) {

Apps/Model/Api/Comments/CommentAnswerAdd.php 1 location

@@ 50-52 (lines=3) @@
47
    public function check()
48
    {
49
        // check if user is auth'd or guest name is defined
50
        if (!App::$User->isAuth() && ((int)$this->_configs['guestAdd'] !== 1 || Str::length($this->guestName) < 2)) {
51
            throw new JsonException(__('Guest name is not defined'));
52
        }
53
54
        if ($this->replayTo < 1) {
55
            throw new JsonException(__('Comment post thread is not founded'));

Apps/Model/Api/Comments/CommentPostAdd.php 1 location

@@ 59-61 (lines=3) @@
56
    public function check()
57
    {
58
        // check if user is auth'd or guest name is defined
59
        if (!App::$User->isAuth() && ((int)$this->_configs['guestAdd'] !== 1 || Str::length($this->guestName) < 2)) {
60
            throw new JsonException(__('Guest name is not defined'));
61
        }
62
63
        // check if pathway is empty
64
        if (Str::likeEmpty($this->pathway)) {