Passed
Push — master ( cbe288...130872 )
by Peter
02:31
created

PageCategoryRepo::getByIdentifier()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 4
rs 10
c 0
b 0
f 0
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\PageCategory as Entity;
9
use Opulence\Orm\Repositories\Repository;
10
11
class PageCategoryRepo extends Repository implements IGridRepo
12
{
13
    /**
14
     * @param int      $limitFrom
15
     * @param int      $pageSize
16
     * @param string[] $orders
17
     * @param array    $conditions
18
     * @param array    $params
19
     *
20
     * @return Entity[]
21
     */
22
    public function getPage(int $limitFrom, int $pageSize, array $orders, array $conditions, array $params): array
23
    {
24
        /** @see PageLayoutSqlDataMapper::getPage() */
25
        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...
26
    }
27
28
    /**
29
     * @param string $identifier
30
     *
31
     * @return Entity|null
32
     * @throws \Opulence\Orm\OrmException
33
     */
34
    public function getByIdentifier(string $identifier): ?Entity
35
    {
36
        /** @see PageLayoutSqlDataMapper::getByIdentifier() */
37
        return $this->getFromDataMapper('getByIdentifier', [$identifier]);
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->getFromDat...r', array($identifier)) could return the type array<mixed,object> which is incompatible with the type-hinted return AbterPhp\Website\Domain\Entities\PageCategory|null. Consider adding an additional type-check to rule them out.
Loading history...
38
    }
39
}
40