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 — develop ( d16b40...f12d2b )
by David
11:46
created

ProviderNameCondition::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
rs 10
cc 1
eloc 2
nc 1
nop 1
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\Workflow;
16
17
use Netzmacht\Workflow\Data\EntityId;
18
use Netzmacht\Workflow\Flow\Workflow;
19
20
/**
21
 * Class ProviderTypeCondition check if entity matches a specific provider.
22
 *
23
 * @package Netzmacht\Workflow\Flow\Workflow\Condition
24
 */
25
class ProviderNameCondition implements Condition
26
{
27
    /**
28
     * Provider name to check against.
29
     *
30
     * @var string
31
     */
32
    private $providerName;
33
34
    /**
35
     * ProviderNameCondition constructor.
36
     *
37
     * @param string $providerName
38
     */
39
    public function __construct(string $providerName)
40
    {
41
        $this->providerName = $providerName;
42
    }
43
44
    /**
45
     * Get the provider name to check against.
46
     *
47
     * @return string
48
     */
49
    public function getProviderName(): string
50
    {
51
        return $this->providerName;
52
    }
53
54
    /**
55
     * {@inheritdoc}
56
     */
57
    public function match(Workflow $workflow, EntityId $entityId, $entity): bool
58
    {
59
        if ($this->providerName) {
60
            return $entityId->getProviderName() == $this->providerName;
61
        }
62
63
        return $entityId->getProviderName() == $workflow->getProviderName();
64
    }
65
}
66