File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ function iclogger_guzzle_middleware(LoggerInterface $log, $type = 'raw')
1212 $ method = (string ) $ request ->getMethod ();
1313 $ uri = (string ) $ request ->getUri ();
1414 $ body = (string ) $ request ->getBody ();
15-
15+
1616 if (empty ($ body )) {
1717 $ message = "[ {$ method }] Calling ` {$ uri }`. " ;
1818 $ context = [];
@@ -31,12 +31,12 @@ function iclogger_guzzle_middleware(LoggerInterface $log, $type = 'raw')
3131 }
3232 }
3333 $ log ->info ($ message , $ context );
34-
34+
3535 return $ handler ($ request , $ options )->then (
3636 function ($ response ) use ($ log , $ type ) {
3737 $ body = (string ) $ response ->getBody ();
3838 $ code = $ response ->getStatusCode ();
39-
39+
4040 $ message = "[ {$ code }] Response: " ;
4141 switch ($ type ) {
4242 case 'json ' :
@@ -45,7 +45,7 @@ function ($response) use ($log, $type) {
4545 throw new RuntimeException ('Bad response, json expected. ' , ['response ' => $ body ]);
4646 }
4747 break ;
48-
48+
4949 case 'raw ' :
5050 default :
5151 $ message .= "\n{$ body }" ;
@@ -55,9 +55,9 @@ function ($response) use ($log, $type) {
5555 if (!empty ($ context )) {
5656 $ response ->iclParsedBody = $ context ;
5757 }
58-
58+
5959 $ log ->info ($ message , $ context );
60-
60+
6161 return $ response ;
6262 },
6363 function ($ reason ) {
You can’t perform that action at this time.
0 commit comments