Passed
Pull Request — master (#1)
by Peter
03:15
created

ContentListItemRepo::getPage()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 5
dl 0
loc 4
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace AbterPhp\Website\Orm;
6
7
use AbterPhp\Framework\Orm\IGridRepo;
8
use AbterPhp\Website\Domain\Entities\ContentListItem as Entity;
9
use AbterPhp\Website\Orm\DataMappers\ContentListItemSqlDataMapper as DataMapper; // @phan-suppress-current-line PhanUnreferencedUseNormal
10
use Opulence\Orm\Repositories\Repository;
11
12
class ContentListItemRepo extends Repository implements IGridRepo
13
{
14
    /**
15
     * @param int      $limitFrom
16
     * @param int      $pageSize
17
     * @param string[] $orders
18
     * @param array    $conditions
19
     * @param array    $params
20
     *
21
     * @return Entity[]
22
     * @throws \Opulence\Orm\OrmException
23
     */
24
    public function getPage(int $limitFrom, int $pageSize, array $orders, array $conditions, array $params): array
25
    {
26
        /** @see DataMapper::getPage() */
27
        return $this->getFromDataMapper('getPage', [$limitFrom, $pageSize, $orders, $conditions, $params]);
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->getFromDat... $conditions, $params)) could return the type object which is incompatible with the type-hinted return array. Consider adding an additional type-check to rule them out.
Loading history...
28
    }
29
30
    /**
31
     * @param string $listId
32
     *
33
     * @return Entity[]
34
     * @throws \Opulence\Orm\OrmException
35
     */
36
    public function getByListId(string $listId): array
37
    {
38
        /** @see DataMapper::getByListId() */
39
        return $this->getFromDataMapper('getByListId', [$listId]);
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->getFromDat...istId', array($listId)) could return the type object which is incompatible with the type-hinted return array. Consider adding an additional type-check to rule them out.
Loading history...
40
    }
41
}
42