Passed
Push — master ( 80fed1...32ef61 )
by Peter
09:46
created

UserLanguageRepo::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
eloc 1
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
nc 1
nop 5
1
<?php
2
3
declare(strict_types=1);
4
5
namespace AbterPhp\Admin\Orm;
6
7
use AbterPhp\Admin\Domain\Entities\UserLanguage as Entity;
8
use AbterPhp\Framework\Orm\IGridRepo;
9
use Opulence\Orm\Repositories\Repository;
10
11
class UserLanguageRepo 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
     * @throws \Opulence\Orm\OrmException
22
     */
23
    public function getPage(int $limitFrom, int $pageSize, array $orders, array $conditions, array $params): array
24
    {
25
        /** @see UserLanguageSqlDataMapper::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 UserLanguageSqlDataMapper::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\Admin\Domain\Entities\UserLanguage|null. Consider adding an additional type-check to rule them out.
Loading history...
39
    }
40
}
41