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
Push — master ( f95418...c000b7 )
by
unknown
22s
created

ProfileMiddleware::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace EightPoints\Bundle\GuzzleBundle\Middleware;
4
5
use Symfony\Component\Stopwatch\Stopwatch;
0 ignored issues
show
Bug introduced by
The type Symfony\Component\Stopwatch\Stopwatch was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
6
7
class ProfileMiddleware
8
{
9
    /**
10
     * @var \Symfony\Component\Stopwatch\Stopwatch
11
     */
12
    private $stopwatch;
13
14
    /**
15
     * @param \Symfony\Component\Stopwatch\Stopwatch $stopwatch
16
     */
17
    public function __construct(Stopwatch $stopwatch)
18
    {
19
        $this->stopwatch = $stopwatch;
20
    }
21
22
    /**
23
     * Profiling each Request
24
     *
25
     * @return \Closure
26
     */
27
    public function profile() : \Closure
28
    {
29
        $stopwatch = $this->stopwatch;
30
31
        return function (callable $handler) use ($stopwatch) {
32
33
            return function ($request, array $options) use ($handler, $stopwatch) {
34
                $event = $stopwatch->start(
35
                    sprintf('%s %s', $request->getMethod(), $request->getUri()),
36
                    'eight_points_guzzle'
37
                );
38
39
                return $handler($request, $options)->then(
40
41
                    function ($response) use ($event) {
42
                        $event->stop();
43
44
                        return $response;
45
                    },
46
47
                    function ($reason) use ($event) {
48
                        $event->stop();
49
50
                        return \GuzzleHttp\Promise\rejection_for($reason);
51
                    }
52
                );
53
            };
54
        };
55
    }
56
}
57