Passed
Push — master ( 4a146d...3e1455 )
by Peter
02:17
created

PageRepo::getByCategoryIdentifiers()   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\Page as Entity;
9
use AbterPhp\Website\Orm\DataMappers\PageSqlDataMapper;
10
use Opulence\Orm\Repositories\Repository;
11
12
class PageRepo 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
     */
23
    public function getPage(int $limitFrom, int $pageSize, array $orders, array $conditions, array $params): array
24
    {
25
        /** @see PageSqlDataMapper::getPage() */
26
        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...
27
    }
28
29
    /**
30
     * @param string $identifier
31
     *
32
     * @return Entity|null
33
     * @throws \Opulence\Orm\OrmException
34
     */
35
    public function getByIdentifier(string $identifier): ?Entity
36
    {
37
        /** @see PageSqlDataMapper::getByIdentifier() */
38
        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\Page|null. Consider adding an additional type-check to rule them out.
Loading history...
39
    }
40
41
    /**
42
     * @param string $identifier
43
     *
44
     * @return Entity|null
45
     * @throws \Opulence\Orm\OrmException
46
     */
47
    public function getWithLayout(string $identifier): ?Entity
48
    {
49
        /** @see PageSqlDataMapper::getWithLayout() */
50
        return $this->getFromDataMapper('getWithLayout', [$identifier]);
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->getFromDat...t', array($identifier)) could return the type array<mixed,object> which is incompatible with the type-hinted return AbterPhp\Website\Domain\Entities\Page|null. Consider adding an additional type-check to rule them out.
Loading history...
51
    }
52
53
    /**
54
     * @param array $identifiers
55
     *
56
     * @return Entity[]
57
     */
58
    public function getByCategoryIdentifiers(array $identifiers): array
59
    {
60
        /** @see PageSqlDataMapper::getByCategoryIdentifiers() */
61
        return $this->getFromDataMapper('getByCategoryIdentifiers', [$identifiers]);
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->getFromDat...', array($identifiers)) 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...
62
    }
63
}
64