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.

RouteSpecification::sameValueAs()   A
last analyzed

Complexity

Conditions 3
Paths 3

Size

Total Lines 12
Code Lines 6

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 12
rs 9.4285
cc 3
eloc 6
nc 3
nop 1
1
<?php
2
/*
3
 * This file is part of the prooph/php-ddd-cargo-sample package.
4
 * (c) Alexander Miertsch <[email protected]>
5
 *
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 */
9
declare(strict_types = 1);
10
11
namespace Codeliner\CargoBackend\Model\Cargo;
12
13
/**
14
 *  RouteSpecification
15
 *
16
 * Describes where a cargo origin and destination is.
17
 * 
18
 * @author Alexander Miertsch <[email protected]>
19
 */
20
class RouteSpecification
21
{
22
    /**
23
     * Origin Location
24
     * 
25
     * @var string 
26
     */
27
    protected $origin;
28
    
29
    /**
30
     * Destination Location
31
     * 
32
     * @var string 
33
     */
34
    protected $destination;
35
36
    /**
37
     * @param string $origin
38
     * @param string $destination
39
     */
40
    public function __construct(string $origin, string $destination)
41
    {
42
        $this->origin = $origin;
43
        $this->destination = $destination;
44
    }
45
    
46
    /**
47
     * @return string
48
     */
49
    public function origin(): string
50
    {
51
        return $this->origin;
52
    }
53
54
    /**
55
     * @return string
56
     */
57
    public function destination(): string
58
    {
59
        return $this->destination;
60
    }
61
62
    /**
63
     * @param RouteSpecification $other
64
     * @return bool
65
     */
66
    public function sameValueAs(RouteSpecification $other): bool
67
    {
68
        if ($this->origin() !== $other->origin()) {
69
            return false;
70
        }
71
72
        if ($this->destination() !== $other->destination()) {
73
            return false;
74
        }
75
76
        return true;
77
    }
78
}
79