@@ -16,11 +16,11 @@ |
||
16 | 16 | |
17 | 17 | $result = parent::send($request, $response, $options); |
18 | 18 | |
19 | - if($this->hasLogger()) |
|
19 | + if ($this->hasLogger()) |
|
20 | 20 | { |
21 | 21 | $time = microtime(true) - $start; |
22 | 22 | |
23 | - if($request->getHeader('Content-Type') == 'application/json') |
|
23 | + if ($request->getHeader('Content-Type') == 'application/json') |
|
24 | 24 | { |
25 | 25 | $payload = json_decode($request->getContent(), true) ?: []; |
26 | 26 | } |
@@ -23,8 +23,7 @@ |
||
23 | 23 | if($request->getHeader('Content-Type') == 'application/json') |
24 | 24 | { |
25 | 25 | $payload = json_decode($request->getContent(), true) ?: []; |
26 | - } |
|
27 | - else { |
|
26 | + } else { |
|
28 | 27 | parse_str($request->getContent(), $payload); |
29 | 28 | } |
30 | 29 |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | { |
33 | 33 | $output = ''; |
34 | 34 | |
35 | - foreach($request_headers as $value) |
|
35 | + foreach ($request_headers as $value) |
|
36 | 36 | { |
37 | 37 | $output .= sprintf(' -H "%s"', $value); |
38 | 38 | } |
@@ -42,11 +42,11 @@ discard block |
||
42 | 42 | |
43 | 43 | private function formatParams($singleCall) |
44 | 44 | { |
45 | - if($singleCall['method'] != 'GET') |
|
45 | + if ($singleCall['method'] != 'GET') |
|
46 | 46 | { |
47 | - foreach($singleCall['request_headers'] as $header) |
|
47 | + foreach ($singleCall['request_headers'] as $header) |
|
48 | 48 | { |
49 | - if($header == 'Content-Type: application/json') |
|
49 | + if ($header == 'Content-Type: application/json') |
|
50 | 50 | { |
51 | 51 | return sprintf(" --data '%s'", json_encode($singleCall['params'])); |
52 | 52 | } |
@@ -53,8 +53,7 @@ |
||
53 | 53 | } |
54 | 54 | |
55 | 55 | return sprintf(" --data '%s'", http_build_query($singleCall['params'])); |
56 | - } |
|
57 | - else |
|
56 | + } else |
|
58 | 57 | { |
59 | 58 | return ''; |
60 | 59 | } |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | |
30 | 30 | public function logCall($host, $path, $method, $time, array $requestHeaders = [], array $params = [], array $responseHeaders = [], $result = null) |
31 | 31 | { |
32 | - if($this->debug) |
|
32 | + if ($this->debug) |
|
33 | 33 | { |
34 | 34 | $this->calls[] = [ |
35 | 35 | 'host' => $host, |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | ]; |
44 | 44 | } |
45 | 45 | |
46 | - if(null !== $this->logger) |
|
46 | + if (null !== $this->logger) |
|
47 | 47 | { |
48 | 48 | $this->logger->info(sprintf("%s (%s) %0.2f ms, params: %s", $path, $method, $time * 1000, json_encode($params))); |
49 | 49 | } |
@@ -58,7 +58,7 @@ |
||
58 | 58 | public function getTime() |
59 | 59 | { |
60 | 60 | $total = 0; |
61 | - foreach($this->data['calls'] as $call) |
|
61 | + foreach ($this->data['calls'] as $call) |
|
62 | 62 | $total += $call['time']; |
63 | 63 | |
64 | 64 | return $total; |
@@ -58,8 +58,9 @@ |
||
58 | 58 | public function getTime() |
59 | 59 | { |
60 | 60 | $total = 0; |
61 | - foreach($this->data['calls'] as $call) |
|
62 | - $total += $call['time']; |
|
61 | + foreach($this->data['calls'] as $call) { |
|
62 | + $total += $call['time']; |
|
63 | + } |
|
63 | 64 | |
64 | 65 | return $total; |
65 | 66 | } |
@@ -14,7 +14,7 @@ |
||
14 | 14 | $configuration = new Configuration(); |
15 | 15 | $this->processConfiguration($configuration, $configs); |
16 | 16 | |
17 | - $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config')); |
|
17 | + $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); |
|
18 | 18 | $loader->load('services.yml'); |
19 | 19 | } |
20 | 20 | } |
@@ -26,7 +26,7 @@ |
||
26 | 26 | /** @var Response $result */ |
27 | 27 | $result = parent::request($method, $url, $params, $data, $headers, $user, $password, $timeout); |
28 | 28 | |
29 | - if($this->hasLogger()) |
|
29 | + if ($this->hasLogger()) |
|
30 | 30 | { |
31 | 31 | $time = microtime(true) - $start; |
32 | 32 |