File tree Expand file tree Collapse file tree 3 files changed +15
-3
lines changed
Expand file tree Collapse file tree 3 files changed +15
-3
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " emag-tech-labs/guzzle-middleware" ,
33 "description" : " Guzzle middlewares" ,
4- "version" : " 0.2.7 " ,
4+ "version" : " 0.2.8 " ,
55 "license" : " GPL-3.0-only" ,
66 "authors" : [
77 {
Original file line number Diff line number Diff line change @@ -26,7 +26,13 @@ public function __construct(StatsDataInterface $statsdService)
2626 public function __invoke (callable $ handler ): callable
2727 {
2828 return function (RequestInterface $ request , array $ options ) use ($ handler ) {
29- $ options ['on_stats ' ] = function (TransferStats $ stats ) {
29+ $ onStats = $ options ['on_stats ' ] ?? null ;
30+
31+ $ options ['on_stats ' ] = function (TransferStats $ stats ) use ($ onStats ) {
32+ if (is_callable ($ onStats )) {
33+ $ onStats ($ stats );
34+ }
35+
3036 $ this ->startProfiling ($ stats );
3137 };
3238
Original file line number Diff line number Diff line change @@ -25,7 +25,13 @@ public function __construct(StatsDataInterface $statsdService)
2525 public function __invoke (callable $ handler ): callable
2626 {
2727 return function (RequestInterface $ request , array $ options ) use ($ handler ) {
28- $ options ['on_stats ' ] = function (TransferStats $ stats ) {
28+ $ onStats = $ options ['on_stats ' ] ?? null ;
29+
30+ $ options ['on_stats ' ] = function (TransferStats $ stats ) use ($ onStats ) {
31+ if (is_callable ($ onStats )) {
32+ $ onStats ($ stats );
33+ }
34+
2935 $ this ->startProfiling ($ stats );
3036 };
3137
You can’t perform that action at this time.
0 commit comments