Code Duplication    Length = 10-10 lines in 2 locations

app/Http/Requests/SearchDocumentsRequest.php 2 locations

@@ 21-30 (lines=10) @@
18
19
        $input = $this->all();
20
21
        if ($this->has('offset')) {
22
            $input['offset'] = intval($input['offset']);
23
            if ($input['offset'] < 0) {
24
                unset($input['offset']);
25
                $this->warnings[] = 'Offset cannot be negative.';
26
            } elseif ($input['offset'] > $maxPaginationDepth) {
27
                $input['offset'] = $maxPaginationDepth;
28
                $this->warnings[] = 'Pagination depth is limited to ' . $maxPaginationDepth . ' results.';
29
            }
30
        }
31
32
        if ($this->has('limit')) {
33
            $input['limit'] = intval($input['limit']);
@@ 32-41 (lines=10) @@
29
            }
30
        }
31
32
        if ($this->has('limit')) {
33
            $input['limit'] = intval($input['limit']);
34
            if ($input['limit'] < 1) {
35
                unset($input['limit']);
36
                $this->warnings[] = 'Limit cannot be negative.';
37
            } elseif ($input['limit'] > $maxResultsPerRequest) {
38
                $input['limit'] = $maxResultsPerRequest;
39
                $this->warnings[] = 'Limiting to max ' . $maxResultsPerRequest . ' results per request.';
40
            }
41
        }
42
43
        $this->replace($input);
44