| 1 |
<?php |
| 2 |
|
| 3 |
/* |
| 4 |
* This file is part of the Symfony package. |
| 5 |
* |
| 6 |
* (c) Fabien Potencier <[email protected]> |
| 7 |
* |
| 8 |
* For the full copyright and license information, please view the LICENSE |
| 9 |
* file that was distributed with this source code. |
| 10 |
*/ |
| 11 |
|
| 12 |
namespace Symfony\Component\HttpClient\Internal; |
| 13 |
|
| 14 |
/** |
| 15 |
* Internal representation of the native client's state. |
| 16 |
* |
| 17 |
* @author Alexander M. Turek <[email protected]> |
| 18 |
* |
| 19 |
* @internal |
| 20 |
*/ |
| 21 |
final class NativeClientState extends ClientState |
| 22 |
{ |
| 23 |
/** @var int */ |
| 24 |
public $id; |
| 25 |
/** @var int */ |
| 26 |
public $maxHostConnections = \PHP_INT_MAX; |
| 27 |
/** @var int */ |
| 28 |
public $responseCount = 0; |
| 29 |
/** @var string[] */ |
| 30 |
public $dnsCache = []; |
| 31 |
/** @var bool */ |
| 32 |
public $sleep = false; |
| 33 |
/** @var int[] */ |
| 34 |
public $hosts = []; |
| 35 |
|
| 36 |
public function __construct() |
| 37 |
{ |
| 38 |
$this->id = random_int(\PHP_INT_MIN, \PHP_INT_MAX); |
| 39 |
} |
| 40 |
|
| 41 |
public function reset() |
| 42 |
{ |
| 43 |
$this->responseCount = 0; |
| 44 |
$this->dnsCache = []; |
| 45 |
$this->hosts = []; |
| 46 |
} |
| 47 |
} |
| 48 |
|