mirror of
				https://github.com/BookStackApp/BookStack.git
				synced 2025-10-31 03:50:27 +03:00 
			
		
		
		
	- Fixed some existing issues in new aligned process. - Manually tested each external call scenario.
		
			
				
	
	
		
			34 lines
		
	
	
		
			614 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			34 lines
		
	
	
		
			614 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);
 | |
|     }
 | |
| 
 | |
|     public function all(): array
 | |
|     {
 | |
|         return $this->container;
 | |
|     }
 | |
| }
 |