mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-11-28 20:00:47 +08:00
29 lines
535 B
PHP
29 lines
535 B
PHP
|
<?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);
|
||
|
}
|
||
|
}
|