Code Duplication    Length = 10-10 lines in 4 locations

src/Api/Controllers/ControllerQuery.php 4 locations

@@ 106-115 (lines=10) @@
103
     *
104
     * @return $this
105
     */
106
    public function setFilters($arr = [])
107
    {
108
        $this->isEnabledFilter('filter', $this->enabledFilters, $this);
109
110
        if ($this->validation->validation('filter', $arr) === true) {
111
            $this->iterateFilterOrSort($arr, 'filter');
112
        }
113
114
        return $this;
115
    }
116
117
    /**
118
     * Set sort for request.
@@ 124-133 (lines=10) @@
121
     *
122
     * @return $this
123
     */
124
    public function setSorts($arr = [])
125
    {
126
        $this->isEnabledFilter('sort', $this->enabledFilters, $this);
127
128
        if ($this->validation->validation('sort', $arr) === true) {
129
            $this->iterateFilterOrSort($arr, 'sort');
130
        }
131
132
        return $this;
133
    }
134
135
    /**
136
     * Set limit for request.
@@ 142-151 (lines=10) @@
139
     *
140
     * @return $this
141
     */
142
    public function setLimit($limit = 100)
143
    {
144
        $this->isEnabledFilter('limit', $this->enabledFilters, $this);
145
146
        if ($this->validation->validation('limit', $limit) === true) {
147
            $this->settedFilters['limit'] = $limit;
148
        }
149
150
        return $this;
151
    }
152
153
    /**
154
     * Set offset for request.
@@ 160-169 (lines=10) @@
157
     *
158
     * @return $this
159
     */
160
    public function setOffset($offset = 0)
161
    {
162
        $this->isEnabledFilter('offset', $this->enabledFilters, $this);
163
164
        if ($this->validation->validation('offset', $offset) === true) {
165
            $this->settedFilters['offset'] = $offset;
166
        }
167
168
        return $this;
169
    }
170
171
    /**
172
     * Set format for response.