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:
28
app/Http/HttpClientHistory.php
Normal file
28
app/Http/HttpClientHistory.php
Normal 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);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user