GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( a7d97d...0097ae )
by Андрей
02:25
created

StepRepository::findByIds()   B

Complexity

Conditions 3
Paths 3

Size

Total Lines 25
Code Lines 14

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 25
rs 8.8571
cc 3
eloc 14
nc 3
nop 1
1
<?php
2
/**
3
 * @link    https://github.com/old-town/workflow-doctrine
4
 * @author  Malofeykin Andrey  <[email protected]>
5
 */
6
namespace OldTown\Workflow\Spi\Doctrine\EntityRepository;
7
8
use Doctrine\ORM\EntityRepository;
9
use \OldTown\Workflow\Spi\Doctrine\Entity\AbstractStep;
10
11
class StepRepository extends EntityRepository
12
{
13
    /**
14
     * @param array $listId
15
     *
16
     * @return array
17
     *
18
     * @throws Exception\RuntimeException
19
     */
20
    public function findByIds(array $listId = [])
21
    {
22
        $countListId = count($listId);
23
        if (0 === $countListId) {
24
            return [];
25
        }
26
27
        $dql = sprintf(
28
            'SELECT s FROM %s s WHERE s.id IN (:stepIds)',
29
            $this->_entityName
30
        );
31
32
        $query = $this->_em->createQuery($dql);
33
        $query->setParameter('stepIds', $listId);
34
35
        /** @var AbstractStep[] $steps */
36
        $steps = $query->getResult();
37
38
        if ($countListId !== count($steps)) {
39
            $errMsg = 'error search step';
40
            throw new Exception\RuntimeException($errMsg);
41
        }
42
43
        return $steps;
44
    }
45
}
46