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.

OrCondition   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 0
Metric Value
wmc 4
c 0
b 0
f 0
lcom 1
cbo 3
dl 0
loc 24
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A match() 0 18 4
1
<?php
2
3
/**
4
 * Workflow library.
5
 *
6
 * @package    workflow
7
 * @author     David Molineus <[email protected]>
8
 * @copyright  2014-2017 netzmacht David Molineus
9
 * @license    LGPL 3.0 https://github.com/netzmacht/workflow
10
 * @filesource
11
 */
12
13
declare(strict_types=1);
14
15
namespace Netzmacht\Workflow\Flow\Condition\Transition;
16
17
use Netzmacht\Workflow\Flow\Context;
18
use Netzmacht\Workflow\Flow\Item;
19
use Netzmacht\Workflow\Flow\Transition;
20
21
/**
22
 * Class OrCondition matches if any of the child condition matches.
23
 *
24
 * @package Netzmacht\Workflow\Flow\Condition\Transition
25
 */
26
class OrCondition extends ConditionCollection
27
{
28
    /**
29
     * {@inheritdoc}
30
     */
31
    public function match(Transition $transition, Item $item, Context $context): bool
32
    {
33
        if (empty($this->conditions)) {
34
            return true;
35
        }
36
37
        $localContext = $context->createCleanCopy();
38
39
        foreach ($this->conditions as $condition) {
40
            if ($condition->match($transition, $item, $localContext)) {
41
                return true;
42
            }
43
        }
44
45
        $context->addError('transition.condition.or.failed', array(), $localContext->getErrorCollection());
46
47
        return false;
48
    }
49
}
50