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   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2
Metric Value
wmc 1
lcom 0
cbo 2
dl 0
loc 25
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A findShortestPath() 0 17 1
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