代码段
public function getURI(): string
{
if (isset($this->id) !== true) {
throw new RuntimeException(
'id is required for create'
);
}
$id = $this->id;
if (isset($this->index) !== true) {
throw new RuntimeException(
'index is required for create'
);
}
$index = $this->index;
var_dump($this->type);
$type = $this->type ?? null;
if (isset($type)) { //这里的判断是不是有问题?不建议url传送类型,那么这个扩展包还有其他的方法吗?
@trigger_error('Specifying types in urls has been deprecated', E_USER_DEPRECATED);
}
if (isset($type)) {
return "/$index/$type/$id/_create";
}
return "/$index/_create/$id";
}
vendor\easyswoole\elasticsearch\src\Endpoints\Create.php
代码段 public function getURI(): string { if (isset($this->id) !== true) { throw new RuntimeException( 'id is required for create' ); } $id = $this->id; if (isset($this->index) !== true) { throw new RuntimeException( 'index is required for create' ); } $index = $this->index; var_dump($this->type); $type = $this->type ?? null; if (isset($type)) { //这里的判断是不是有问题?不建议url传送类型,那么这个扩展包还有其他的方法吗? @trigger_error('Specifying types in urls has been deprecated', E_USER_DEPRECATED); }