Issues (44)

app/Services/TopicService.php (1 issue)

Labels
Severity
1
<?php
2
3
namespace App\Services;
4
5
use App\Repositories\Criteria\OrderBy;
6
use App\Repositories\Criteria\Where;
7
use App\Repositories\TopicRepository;
8
9
class TopicService
10
{
11
    private $repository;
12
13
    /**
14
     * TopicService constructor.
15
     */
16
    public function __construct()
17
    {
18
        $this->repository = app(TopicRepository::class);
19
    }
20
21
    public function topicsForContest($contestId)
22
    {
23
        $this->repository->pushCriteria(new Where('contest_id', $contestId));
24
        $this->repository->pushCriteria(new OrderBy('created_at', 'desc'));
25
26
        return $this->repository->paginate(request('per_page', 50));
0 ignored issues
show
request('per_page', 50) of type Illuminate\Http\Request|array|string is incompatible with the type integer expected by parameter $perPage of Czim\Repository\BaseRepository::paginate(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

26
        return $this->repository->paginate(/** @scrutinizer ignore-type */ request('per_page', 50));
Loading history...
27
    }
28
}
29