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.

GraphTraversalServiceMock::findShortestPath()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 17
Code Lines 11

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 17
rs 9.4285
cc 1
eloc 11
nc 1
nop 2
1
<?php
2
/*
3
 * This file is part of the prooph/php-ddd-cargo-sample.
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
 * Date: 29.03.14 - 19:57
10
 */
11
12
namespace CodelinerTest\CargoBackend\Mock;
13
14
use Codeliner\GraphTraversalBackend\Dto\EdgeDto;
15
use Codeliner\GraphTraversalBackend\Dto\TransitPathDto;
16
use Codeliner\GraphTraversalBackend\GraphTraversalServiceInterface;
17
18
/**
19
 * Class GraphTraversalServiceMock
20
 *
21
 * @package CodelinerTest\CargoBackend\Domain\Mock
22
 * @author Alexander Miertsch <[email protected]>
23
 */
24
class GraphTraversalServiceMock implements GraphTraversalServiceInterface
25
{
26
    /**
27
     * @param string $fromUnLocode
28
     * @param string $toUnLocode
29
     * @return TransitPathDto[]
30
     */
31
    public function findShortestPath($fromUnLocode, $toUnLocode): array
32
    {
33
        $transitPath = new TransitPathDto();
34
35
        $fromDate = new \DateTime('2014-03-29 19:59:23');
36
        $toDate   = new \DateTime('2014-03-30 21:30:00');
37
38
        $edge = new EdgeDto();
39
        $edge->setFromUnLocode($fromUnLocode);
40
        $edge->setToUnLocode($toUnLocode);
41
        $edge->setFromDate($fromDate->format(\DateTime::ISO8601));
42
        $edge->setToDate($toDate->format(\DateTime::ISO8601));
43
44
        $transitPath->setEdges([$edge]);
45
46
        return [$transitPath];
47
    }
48
}
49