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
Pull Request — master (#29)
by Daniel
12:02 queued 09:43
created

GetLocations   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 3
dl 0
loc 32
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A __invoke() 0 9 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: 8/13/15 - 12:11 AM
10
 */
11
namespace Codeliner\CargoBackend\Http\Action;
12
13
use Codeliner\CargoBackend\Application\Booking\BookingService;
14
use Codeliner\CargoBackend\Application\Booking\Dto\LocationDto;
15
use Psr\Http\Message\RequestInterface;
16
use Psr\Http\Message\ResponseInterface;
17
use Zend\Diactoros\Response\JsonResponse;
18
19
/**
20
 * Class GetLocations
21
 * Get Locations API Endpoint
22
 *
23
 * @package Codeliner\ApiGateway\Action
24
 */
25
final class GetLocations
26
{
27
    /**
28
     * @var BookingService
29
     */
30
    private $bookingService;
31
32
    /**
33
     * GetLocations constructor.
34
     *
35
     * @param BookingService $bookingService
36
     */
37
    public function __construct(BookingService $bookingService)
38
    {
39
        $this->bookingService = $bookingService;
40
    }
41
42
    /**
43
     * @param RequestInterface $request
44
     * @param ResponseInterface $response
45
     * @return JsonResponse
46
     */
47
    public function __invoke(RequestInterface $request, ResponseInterface $response)
0 ignored issues
show
Unused Code introduced by
The parameter $request is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $response is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
48
    {
49
        return new JsonResponse(['locations' => array_map(function(LocationDto $locationDto) {
50
            return [
51
                'name' => $locationDto->getName(),
52
                'unLocode' => $locationDto->getUnLocode()
53
            ];
54
        }, $this->bookingService->listShippingLocations())]);
55
    }
56
}
57