Code Duplication    Length = 11-13 lines in 2 locations

src/Comment/Modules/Question.php 1 location

@@ 59-71 (lines=13) @@
56
     *
57
     * @return array
58
     */
59
    public function getQuestions($sql = null, $params = null)
60
    {
61
        $questions = [];
62
63
        if ($sql == null) {
64
            $questions = $this->findAll();
65
        }
66
        if ($sql != null) {
67
            $questions = $this->findAllWhere($sql, $params);
68
        }
69
        // array_reverse so latest order question gets returned
70
        return array_reverse(array_map(array($this, 'setupQuestion'), $questions));
71
    }
72
73
    /**
74
    * Returns one question with it's own question text and other answers

src/Comment/Modules/User.php 1 location

@@ 105-115 (lines=11) @@
102
     *
103
     * @return array
104
     */
105
    public function getAllUsers($sql = null, $params = null)
106
    {
107
        if ($sql == null) {
108
            $users = $this->findAll();
109
        }
110
        if ($sql != null) {
111
            $users = $this->findAllWhere($sql, $params);
112
        }
113
114
        return array_map(array($this, 'setupUser'), $users);
115
    }
116
117
    /**
118
     * return question/answer, three attributes are set, comments connected to them is an array.