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::match()   A
last analyzed

Complexity

Conditions 4
Paths 4

Size

Total Lines 18

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 18
rs 9.6666
c 0
b 0
f 0
cc 4
nc 4
nop 3
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