@@ -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 | } |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | { |
| 33 | 33 | $output = ''; |
| 34 | 34 | |
| 35 | - foreach($request_headers as $key => $value) |
|
| 35 | + foreach ($request_headers as $key => $value) |
|
| 36 | 36 | { |
| 37 | 37 | $output .= sprintf(' -H "%s: %s"', $key, is_array($value) ? $value[0] : $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 $key => $value) |
|
| 47 | + foreach ($singleCall['request_headers'] as $key => $value) |
|
| 48 | 48 | { |
| 49 | - if($key == 'Content-Type' && (is_array($value) ? $value[0] : $value) == 'application/json') |
|
| 49 | + if ($key == 'Content-Type' && (is_array($value) ? $value[0] : $value) == 'application/json') |
|
| 50 | 50 | { |
| 51 | 51 | return sprintf(" --data '%s'", json_encode($singleCall['params'])); |
| 52 | 52 | } |
@@ -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 | } |
@@ -37,7 +37,7 @@ |
||
| 37 | 37 | { |
| 38 | 38 | $time = microtime(true) - $this->startTime; |
| 39 | 39 | |
| 40 | - if($request->getHeader('Content-Type') == 'application/json') |
|
| 40 | + if ($request->getHeader('Content-Type') == 'application/json') |
|
| 41 | 41 | { |
| 42 | 42 | $payload = json_decode($request->getBody(), true) ?: []; |
| 43 | 43 | } |
@@ -40,8 +40,7 @@ |
||
| 40 | 40 | if($request->getHeader('Content-Type') == 'application/json') |
| 41 | 41 | { |
| 42 | 42 | $payload = json_decode($request->getBody(), true) ?: []; |
| 43 | - } |
|
| 44 | - else { |
|
| 43 | + } else { |
|
| 45 | 44 | parse_str($request->getBody(), $payload); |
| 46 | 45 | } |
| 47 | 46 | |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | { |
| 12 | 12 | $treeBuilder = new TreeBuilder('nixilla_api_logger'); |
| 13 | 13 | |
| 14 | - if ( ! method_exists($treeBuilder, 'getRootNode')) { |
|
| 14 | + if (!method_exists($treeBuilder, 'getRootNode')) { |
|
| 15 | 15 | $treeBuilder->root('nixilla_api_logger'); |
| 16 | 16 | } |
| 17 | 17 | |