FileCategoryRepo   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 28
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getByUserGroup() 0 4 1
A getPage() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace AbterPhp\Files\Orm;
6
7
use AbterPhp\Admin\Domain\Entities\UserGroup;
8
use AbterPhp\Files\Domain\Entities\FileCategory as Entity;
9
use AbterPhp\Files\Orm\DataMappers\FileCategorySqlDataMapper; // @phan-suppress-current-line PhanUnreferencedUseNormal
10
use AbterPhp\Framework\Orm\IGridRepo;
11
use Opulence\Orm\Repositories\Repository;
12
13
class FileCategoryRepo extends Repository implements IGridRepo
14
{
15
    /**
16
     * @param int      $limitFrom
17
     * @param int      $pageSize
18
     * @param string[] $orders
19
     * @param array    $conditions
20
     * @param array    $params
21
     *
22
     * @return Entity[]
23
     * @throws \Opulence\Orm\OrmException
24
     */
25
    public function getPage(int $limitFrom, int $pageSize, array $orders, array $conditions, array $params): array
26
    {
27
        /** @see FileCategorySqlDataMapper::getPage() */
28
        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...
29
    }
30
31
    /**
32
     * @param UserGroup $userGroup
33
     *
34
     * @return Entity[]
35
     * @throws \Opulence\Orm\OrmException
36
     */
37
    public function getByUserGroup(UserGroup $userGroup): array
38
    {
39
        /** @see FileCategorySqlDataMapper::getByUserGroupId() */
40
        return $this->getFromDataMapper('getByUserGroupId', [$userGroup->getId()]);
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->getFromDat...y($userGroup->getId())) 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...
41
    }
42
}
43