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   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 3
c 2
b 0
f 0
lcom 1
cbo 4
dl 0
loc 35
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
B findByIds() 0 25 3
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