File tree Expand file tree Collapse file tree 3 files changed +31
-2
lines changed Expand file tree Collapse file tree 3 files changed +31
-2
lines changed Original file line number Diff line number Diff line change
1
+ name : Static analysis
2
+
3
+ on :
4
+ push :
5
+ branches :
6
+ - master
7
+ pull_request :
8
+
9
+ jobs :
10
+ phpstan :
11
+ name : PHPStan
12
+ runs-on : ubuntu-latest
13
+
14
+ steps :
15
+ - name : Checkout code
16
+ uses : actions/checkout@v2
17
+
18
+ - name : PHPStan
19
+ uses : docker://oskarstark/phpstan-ga
20
+ with :
21
+ args : analyze --no-progress
Original file line number Diff line number Diff line change
1
+ parameters:
2
+ level: max
3
+ paths:
4
+ - src
Original file line number Diff line number Diff line change 4
4
5
5
use Http \Client \Common \Plugin ;
6
6
use Http \Client \Exception ;
7
+ use Http \Promise \Promise ;
7
8
use Psr \Http \Message \RequestInterface ;
8
9
use Psr \Http \Message \ResponseInterface ;
9
10
use Symfony \Component \Stopwatch \Stopwatch ;
@@ -29,17 +30,20 @@ public function __construct(Stopwatch $stopwatch)
29
30
$ this ->stopwatch = $ stopwatch ;
30
31
}
31
32
33
+ /**
34
+ * @return Promise Resolves a PSR-7 Response or fails with an Http\Client\Exception (The same as HttpAsyncClient)
35
+ */
32
36
protected function doHandleRequest (RequestInterface $ request , callable $ next , callable $ first )
33
37
{
34
38
$ eventName = $ this ->getStopwatchEventName ($ request );
35
39
$ this ->stopwatch ->start ($ eventName , self ::CATEGORY );
36
40
37
41
return $ next ($ request )->then (function (ResponseInterface $ response ) use ($ eventName ) {
38
- $ this ->stopwatch ->stop ($ eventName, self :: CATEGORY );
42
+ $ this ->stopwatch ->stop ($ eventName );
39
43
40
44
return $ response ;
41
45
}, function (Exception $ exception ) use ($ eventName ) {
42
- $ this ->stopwatch ->stop ($ eventName, self :: CATEGORY );
46
+ $ this ->stopwatch ->stop ($ eventName );
43
47
44
48
throw $ exception ;
45
49
});
You can’t perform that action at this time.
0 commit comments