mirror of
https://gitee.com/hyperf/hyperf.git
synced 2024-12-12 12:55:29 +08:00
Upgrade the minimum php version to 8.0 for etcd.
This commit is contained in:
parent
fb20985692
commit
5e668afc61
@ -1 +0,0 @@
|
||||
# Etcd
|
@ -9,7 +9,7 @@
|
||||
],
|
||||
"description": "Etcd Client for Hyperf.",
|
||||
"require": {
|
||||
"php": ">=7.2",
|
||||
"php": ">=8.0",
|
||||
"hyperf/guzzle": "~3.0.0",
|
||||
"hyperf/utils": "~3.0.0"
|
||||
},
|
||||
|
@ -17,36 +17,16 @@ use Hyperf\Utils\Coroutine;
|
||||
|
||||
abstract class Client
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $baseUri;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $version;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $options = [];
|
||||
protected string $baseUri;
|
||||
|
||||
/**
|
||||
* @var HandlerStack[]
|
||||
*/
|
||||
protected $stacks = [];
|
||||
protected array $stacks = [];
|
||||
|
||||
/**
|
||||
* @var HandlerStackFactory
|
||||
*/
|
||||
protected $factory;
|
||||
|
||||
public function __construct(string $uri, string $version, array $options, HandlerStackFactory $factory)
|
||||
public function __construct(string $uri, string $version, protected array $options, protected HandlerStackFactory $factory)
|
||||
{
|
||||
$this->options = $options;
|
||||
$this->baseUri = sprintf('%s/%s/', $uri, $version);
|
||||
$this->factory = $factory;
|
||||
}
|
||||
|
||||
protected function getDefaultHandler()
|
||||
|
@ -45,6 +45,6 @@ class KVFactory
|
||||
return make(V3\KV::class, $params);
|
||||
}
|
||||
|
||||
throw new ClientNotFindException(sprintf("KV of {$version} is not find."));
|
||||
throw new ClientNotFindException("KV of {$version} is not find.");
|
||||
}
|
||||
}
|
||||
|
@ -748,7 +748,7 @@ class EtcdClient
|
||||
}
|
||||
|
||||
$map = [];
|
||||
foreach ($data as $index => $value) {
|
||||
foreach ($data as $value) {
|
||||
$key = $value['key'];
|
||||
$map[$key] = $value['value'];
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user