@@ -44,49 +44,49 @@ |
||
| 44 | 44 | * @package OC\Http |
| 45 | 45 | */ |
| 46 | 46 | class ClientService implements IClientService { |
| 47 | - /** @var IConfig */ |
|
| 48 | - private $config; |
|
| 49 | - /** @var ICertificateManager */ |
|
| 50 | - private $certificateManager; |
|
| 51 | - /** @var DnsPinMiddleware */ |
|
| 52 | - private $dnsPinMiddleware; |
|
| 53 | - private IRemoteHostValidator $remoteHostValidator; |
|
| 54 | - private IEventLogger $eventLogger; |
|
| 47 | + /** @var IConfig */ |
|
| 48 | + private $config; |
|
| 49 | + /** @var ICertificateManager */ |
|
| 50 | + private $certificateManager; |
|
| 51 | + /** @var DnsPinMiddleware */ |
|
| 52 | + private $dnsPinMiddleware; |
|
| 53 | + private IRemoteHostValidator $remoteHostValidator; |
|
| 54 | + private IEventLogger $eventLogger; |
|
| 55 | 55 | |
| 56 | - public function __construct( |
|
| 57 | - IConfig $config, |
|
| 58 | - ICertificateManager $certificateManager, |
|
| 59 | - DnsPinMiddleware $dnsPinMiddleware, |
|
| 60 | - IRemoteHostValidator $remoteHostValidator, |
|
| 61 | - IEventLogger $eventLogger, |
|
| 62 | - ) { |
|
| 63 | - $this->config = $config; |
|
| 64 | - $this->certificateManager = $certificateManager; |
|
| 65 | - $this->dnsPinMiddleware = $dnsPinMiddleware; |
|
| 66 | - $this->remoteHostValidator = $remoteHostValidator; |
|
| 67 | - $this->eventLogger = $eventLogger; |
|
| 68 | - } |
|
| 56 | + public function __construct( |
|
| 57 | + IConfig $config, |
|
| 58 | + ICertificateManager $certificateManager, |
|
| 59 | + DnsPinMiddleware $dnsPinMiddleware, |
|
| 60 | + IRemoteHostValidator $remoteHostValidator, |
|
| 61 | + IEventLogger $eventLogger, |
|
| 62 | + ) { |
|
| 63 | + $this->config = $config; |
|
| 64 | + $this->certificateManager = $certificateManager; |
|
| 65 | + $this->dnsPinMiddleware = $dnsPinMiddleware; |
|
| 66 | + $this->remoteHostValidator = $remoteHostValidator; |
|
| 67 | + $this->eventLogger = $eventLogger; |
|
| 68 | + } |
|
| 69 | 69 | |
| 70 | - /** |
|
| 71 | - * @return Client |
|
| 72 | - */ |
|
| 73 | - public function newClient(): IClient { |
|
| 74 | - $handler = new CurlHandler(); |
|
| 75 | - $stack = HandlerStack::create($handler); |
|
| 76 | - $stack->push($this->dnsPinMiddleware->addDnsPinning()); |
|
| 77 | - $stack->push(Middleware::tap(function (RequestInterface $request) { |
|
| 78 | - $this->eventLogger->start('http:request', $request->getMethod() . " request to " . $request->getRequestTarget()); |
|
| 79 | - }, function () { |
|
| 80 | - $this->eventLogger->end('http:request'); |
|
| 81 | - }), 'event logger'); |
|
| 70 | + /** |
|
| 71 | + * @return Client |
|
| 72 | + */ |
|
| 73 | + public function newClient(): IClient { |
|
| 74 | + $handler = new CurlHandler(); |
|
| 75 | + $stack = HandlerStack::create($handler); |
|
| 76 | + $stack->push($this->dnsPinMiddleware->addDnsPinning()); |
|
| 77 | + $stack->push(Middleware::tap(function (RequestInterface $request) { |
|
| 78 | + $this->eventLogger->start('http:request', $request->getMethod() . " request to " . $request->getRequestTarget()); |
|
| 79 | + }, function () { |
|
| 80 | + $this->eventLogger->end('http:request'); |
|
| 81 | + }), 'event logger'); |
|
| 82 | 82 | |
| 83 | - $client = new GuzzleClient(['handler' => $stack]); |
|
| 83 | + $client = new GuzzleClient(['handler' => $stack]); |
|
| 84 | 84 | |
| 85 | - return new Client( |
|
| 86 | - $this->config, |
|
| 87 | - $this->certificateManager, |
|
| 88 | - $client, |
|
| 89 | - $this->remoteHostValidator, |
|
| 90 | - ); |
|
| 91 | - } |
|
| 85 | + return new Client( |
|
| 86 | + $this->config, |
|
| 87 | + $this->certificateManager, |
|
| 88 | + $client, |
|
| 89 | + $this->remoteHostValidator, |
|
| 90 | + ); |
|
| 91 | + } |
|
| 92 | 92 | } |
@@ -74,9 +74,9 @@ |
||
| 74 | 74 | $handler = new CurlHandler(); |
| 75 | 75 | $stack = HandlerStack::create($handler); |
| 76 | 76 | $stack->push($this->dnsPinMiddleware->addDnsPinning()); |
| 77 | - $stack->push(Middleware::tap(function (RequestInterface $request) { |
|
| 78 | - $this->eventLogger->start('http:request', $request->getMethod() . " request to " . $request->getRequestTarget()); |
|
| 79 | - }, function () { |
|
| 77 | + $stack->push(Middleware::tap(function(RequestInterface $request) { |
|
| 78 | + $this->eventLogger->start('http:request', $request->getMethod()." request to ".$request->getRequestTarget()); |
|
| 79 | + }, function() { |
|
| 80 | 80 | $this->eventLogger->end('http:request'); |
| 81 | 81 | }), 'event logger'); |
| 82 | 82 | |