1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-08-07 23:03:00 +03:00

Started aligning app-wide outbound http calling behaviour

This commit is contained in:
Dan Brown
2023-09-08 14:16:09 +01:00
parent 21cd2d17f6
commit a8b5652210
11 changed files with 159 additions and 107 deletions

View File

@@ -0,0 +1,28 @@
<?php
namespace BookStack\Http;
use GuzzleHttp\Psr7\Request as GuzzleRequest;
class HttpClientHistory
{
public function __construct(
protected &$container
) {
}
public function requestCount(): int
{
return count($this->container);
}
public function requestAt(int $index): ?GuzzleRequest
{
return $this->container[$index]['request'] ?? null;
}
public function latestRequest(): ?GuzzleRequest
{
return $this->requestAt($this->requestCount() - 1);
}
}