File tree Expand file tree Collapse file tree 3 files changed +6
-8
lines changed
Expand file tree Collapse file tree 3 files changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -15,8 +15,8 @@ class HttpCodeProfiler
1515 /** @var StatsDataInterface */
1616 private $ statsdService ;
1717
18- /** @var string */
19- private $ statsdKey ;
18+ /** @var string|null */
19+ private $ statsdKey = null ;
2020
2121 public function __construct (StatsDataInterface $ statsdService )
2222 {
@@ -54,9 +54,8 @@ private function startProfiling(TransferStats $stats): void
5454 private function getKey (TransferStats $ stats ): string
5555 {
5656 $ key = ($ this ->statsdKey ?? $ this ->generateKey ($ stats ));
57- $ statusCode = (!empty ($ stats ->getResponse ())) ? $ stats ->getResponse ()->getStatusCode () : '' ;
58- $ key .= '. ' . $ statusCode ;
57+ $ statusCode = (empty ($ stats ->getResponse ())) ? '' : $ stats ->getResponse ()->getStatusCode ();
5958
60- return $ key ;
59+ return $ key . ( ' . ' . $ statusCode ) ;
6160 }
6261}
Original file line number Diff line number Diff line change @@ -14,8 +14,8 @@ class TimingProfiler
1414 /** @var StatsDataInterface */
1515 private $ statsdService ;
1616
17- /** @var string */
18- private $ statsdKey ;
17+ /** @var string|null */
18+ private $ statsdKey = null ;
1919
2020 public function __construct (StatsDataInterface $ statsdService )
2121 {
Original file line number Diff line number Diff line change 11<?php
22namespace EmagTechLabs \Tests ;
33
4-
54use EmagTechLabs \GuzzleMiddleware \Adapter \StatsDataInterface ;
65use GuzzleHttp \Client ;
76use GuzzleHttp \HandlerStack ;
You can’t perform that action at this time.
0 commit comments