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
Branch v2 (b7a21f)
by Oliver
06:19 queued 03:39
created

PharInvocation::getAlias()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
namespace TYPO3\PharStreamWrapper\Resolver;
3
4
/*
5
 * This file is part of the TYPO3 project.
6
 *
7
 * It is free software; you can redistribute it and/or modify it under the terms
8
 * of the MIT License (MIT). For the full copyright and license information,
9
 * please read the LICENSE file that was distributed with this source code.
10
 *
11
 * The TYPO3 project - inspiring people to share!
12
 */
13
14
use TYPO3\PharStreamWrapper\Exception;
15
16
class PharInvocation
17
{
18
    /**
19
     * @var string
20
     */
21
    private $baseName;
22
23
    /**
24
     * @var string
25
     */
26
    private $alias;
27
28
    /**
29
     * @param string $baseName
30
     * @param string $alias
31
     */
32
    public function __construct($baseName, $alias = '')
33
    {
34
        if ($baseName === '') {
35
            throw new Exception(
36
                'Base-name cannot be empty',
37
                1551283689
38
            );
39
        }
40
        $this->baseName = $baseName;
41
        $this->alias = $alias;
42
    }
43
44
    /**
45
     * @return string
46
     */
47
    public function __toString()
48
    {
49
        return $this->baseName;
50
    }
51
52
    /**
53
     * @return string
54
     */
55
    public function getBaseName()
56
    {
57
        return $this->baseName;
58
    }
59
60
    /**
61
     * @return null|string
62
     */
63
    public function getAlias()
64
    {
65
        return $this->alias;
66
    }
67
68
    /**
69
     * @param PharInvocation $other
70
     * @return bool
71
     */
72
    public function equals(PharInvocation $other)
73
    {
74
        return $other->baseName === $this->baseName
75
            && $other->alias === $this->alias;
76
    }
77
}