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.

GetCargos::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
/*
3
 * This file is part of the prooph/cargo-sample2.
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: 07.12.2015 - 8:39 PM
10
 */
11
namespace Codeliner\CargoBackend\Http\Action;
12
use Codeliner\CargoBackend\Application\Booking\BookingService;
13
use Codeliner\CargoBackend\Application\Booking\Dto\CargoRoutingDto;
14
use Psr\Http\Message\ResponseInterface;
15
use Psr\Http\Message\ServerRequestInterface;
16
use Zend\Diactoros\Response\JsonResponse;
17
18
/**
19
 * Class GetCargos
20
 *
21
 * @package Codeliner\CargoBackend\Application\Action
22
 */
23
final class GetCargos
24
{
25
    /**
26
     * @var BookingService
27
     */
28
    private $bookingService;
29
30
    /**
31
     * GetCargos constructor.
32
     * @param BookingService $bookingService
33
     */
34
    public function __construct(BookingService $bookingService)
35
    {
36
        $this->bookingService = $bookingService;
37
    }
38
39
    public function __invoke(ServerRequestInterface $request, ResponseInterface $response, callable $next)
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...
Unused Code introduced by
The parameter $next 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...
40
    {
41
        return new JsonResponse(['cargos' => array_map(function(CargoRoutingDto $cargoRoutingDto) {
42
            return $cargoRoutingDto->getArrayCopy();
43
        }, $this->bookingService->listAllCargos() )]);
44
    }
45
}
46