Skip to content

接口参考 ​

本文档由脚本自动生成,请勿手动编辑

本文档按包列出 Kuiper 框架中的全部 128 个公共接口及其自身声明的方法签名(不含继承自父接口的方法)。

依赖注入 ​

ContainerBuilderAwareInterface ​

命名空间: kuiper\di

方法 ​

setContainerBuilder() ​

text
void setContainerBuilder(kuiper\di\ContainerBuilderInterface $containerBuilder)

Sets the container builder.

ContainerBuilderInterface ​

命名空间: kuiper\di

方法 ​

addBeanAwareInjection() ​

text
self addBeanAwareInjection(kuiper\di\BeanAwareInjection $injection)

hasDefinition() ​

text
bool hasDefinition(string $name)

是否已经注册了指定名称的 Bean 定义.

build() ​

text
Psr\Container\ContainerInterface build()

DefinitionConfiguration ​

命名空间: kuiper\di

方法 ​

getDefinitions() ​

text
array getDefinitions()

Creates php-di definitions.

MetadataComponentInterface ​

命名空间: kuiper\di

标记该组件属性只承载元数据,不对应可实例化的类.

方法 ​

该接口未声明自己的方法。

Web ​

AttributeProcessorInterface ​

命名空间: kuiper\web

方法 ​

process() ​

text
void process()

Processes the annotation.

ControllerInterface ​

命名空间: kuiper\web\controller

方法 ​

initialize() ​

text
initialize()

Initialize controller.

withRequest() ​

text
static withRequest(Psr\Http\Message\ServerRequestInterface $request)

Sets request.

withResponse() ​

text
static withResponse(Psr\Http\Message\ResponseInterface $response)

Sets response.

getResponse() ​

text
Psr\Http\Message\ResponseInterface getResponse()

Gets the response.

LoginUrlBuilderInterface ​

命名空间: kuiper\web\handler

方法 ​

build() ​

text
string build(Psr\Http\Message\ServerRequestInterface $request)

DateFormatterInterface ​

命名空间: kuiper\web\logging

方法 ​

format() ​

text
string format(float $time)

LogContextInterface ​

命名空间: kuiper\web\logging

方法 ​

getRequest() ​

text
Psr\Http\Message\RequestInterface getRequest()

Gets the request.

getResponse() ​

text
?Psr\Http\Message\ResponseInterface getResponse()

Gets the response.

hasResponse() ​

text
bool hasResponse()

getError() ​

text
?Throwable getError()

Gets the error.

hasError() ​

text
bool hasError()

getStartTime() ​

text
float getStartTime()

getEndTime() ​

text
float getEndTime()

getRequestTime() ​

text
float getRequestTime()

LogFormatterInterface ​

命名空间: kuiper\web\logging

方法 ​

format() ​

text
array format(kuiper\web\logging\LogContextInterface $context)

MiddlewareFactory ​

命名空间: kuiper\web\middleware

方法 ​

getPriority() ​

text
int getPriority()

filter priority, the smaller one run first.

create() ​

text
Psr\Http\Server\MiddlewareInterface create(Psr\Container\ContainerInterface $container)

Creates the middleware.

RateLimiterInterface ​

命名空间: kuiper\web\ratelimit

速率限制器接口.

方法 ​

limit() ​

text
kuiper\web\ratelimit\RateLimitInfo limit(Psr\Http\Message\ServerRequestInterface $request)

检查请求是否超过速率限制.

RequestKeyResolverInterface ​

命名空间: kuiper\web\ratelimit

速率限制键解析器接口.

方法 ​

resolve() ​

text
string resolve(Psr\Http\Message\ServerRequestInterface $request)

从请求中解析速率限制键.

RateLimitStorageInterface ​

命名空间: kuiper\web\ratelimit\Storage

速率限制存储接口.

方法 ​

increment() ​

text
int increment(string $key, int $step, int $ttl)

增加计数器值.

get() ​

text
?int get(string $key)

获取计数器值.

reset() ​

text
void reset(string $key)

重置计数器.

AclInterface ​

命名空间: kuiper\web\security

方法 ​

isAllowed() ​

text
bool isAllowed(string $role, string $authority)

Check whether a role is allowed to access the resource.

AuthInterface ​

命名空间: kuiper\web\security

方法 ​

login() ​

text
void login(kuiper\web\security\UserIdentity $identity)

make current user logged in.

getIdentity() ​

text
kuiper\web\security\UserIdentity getIdentity()

Gets the user identity.

logout() ​

text
void logout(bool $destroySession = true)

make current user logged out.

isGuest() ​

text
bool isGuest()

whether current user is logged in.

isAuthorized() ​

text
bool isAuthorized()

whether current user is logged in.

CsrfTokenInterface ​

命名空间: kuiper\web\security

方法 ​

getTokenKey() ​

text
string getTokenKey()

Gets key to be used as input's name in a CSRF check.

getToken() ​

text
string getToken()

Gets token value to be used as input's value in a CSRF check.

regenerateToken() ​

text
string regenerateToken()

Regenerate the CSRF token value.

checkToken() ​

text
bool checkToken(?string $tokenValue, bool $destroyIfValid = true)

Check if the CSRF token is the same that the current in session.

check() ​

text
bool check(Psr\Http\Message\ServerRequestInterface $request, $destroyIfValid = true)

Check if the CSRF token sent in the request is the same that the current in session.

UserIdentity ​

命名空间: kuiper\web\security

方法 ​

getUsername() ​

text
string getUsername()

Returns the username used to authenticate the user.

getAuthorities() ​

text
array getAuthorities()

Returns the authorities granted to the user.

UserIdentityNormalizerInterface ​

命名空间: kuiper\web\security

UserIdentity 序列化接口.

方法 ​

normalize() ​

text
array normalize(kuiper\web\security\UserIdentity $identity)

将 UserIdentity 对象序列化为数组.

denormalize() ​

text
kuiper\web\security\UserIdentity denormalize(array $data, string $className)

将数组反序列化为 UserIdentity 对象.

FlashInterface ​

命名空间: kuiper\web\session

方法 ​

has() ​

text
bool has(?string $type = null)

Checks whether there are messages.

error() ​

text
void error(string $message)

Shows a HTML error message.

notice() ​

text
void notice(string $message)

Shows a HTML notice/information message.

success() ​

text
void success(string $message)

Shows a HTML success message.

warning() ​

text
void warning(string $message)

Shows a HTML warning message.

message() ​

text
void message(string $type, string $message)

Outputs a message.

clearAll() ​

text
void clearAll()

Clears all messages.

getMessages() ​

text
array getMessages()

Gets all messages.

SessionFactoryInterface ​

命名空间: kuiper\web\session

方法 ​

create() ​

text
kuiper\web\session\SessionInterface create(Psr\Http\Message\ServerRequestInterface $request)

SessionInterface ​

命名空间: kuiper\web\session

方法 ​

start() ​

text
void start()

Starts session, optionally using an adapter.

get() ​

text
mixed get(string $index, mixed $defaultValue = null)

Gets a session variable from an application context.

set() ​

text
void set(string $index, mixed $value)

Sets a session variable in an application context.

has() ​

text
bool has(string $index)

Check whether a session variable is set in an application context.

remove() ​

text
void remove(string $index)

Removes a session variable from an application context.

getId() ​

text
string getId()

Returns active session id.

isStarted() ​

text
bool isStarted()

Check whether the session has been started.

destroy() ​

text
bool destroy(bool $removeData = false)

Destroys the active session.

regenerateId() ​

text
void regenerateId(bool $deleteOldSession = true)

Regenerate session's id.

setCookie() ​

text
Psr\Http\Message\ResponseInterface setCookie(Psr\Http\Message\ResponseInterface $response)

ViewAwareInterface ​

命名空间: kuiper\web\view

方法 ​

setView() ​

text
void setView(kuiper\web\view\ViewInterface $view)

ViewInterface ​

命名空间: kuiper\web\view

方法 ​

render() ​

text
string render(string $name, array $context = [])

Renders a template.

数据库 ​

ConnectionInterface ​

命名空间: kuiper\db

方法 ​

connectToDatabase() ​

text
void connectToDatabase()

Connects to the database and sets PDO attributes.

disconnect() ​

text
void disconnect()

Explicitly disconnect by unset the PDO instance; does not prevent

getPdo() ​

text
PDO getPdo()

Returns the underlying PDO connection object.

ConnectionPoolInterface ​

命名空间: kuiper\db

方法 ​

take() ​

text
kuiper\db\ConnectionInterface take()

release() ​

text
void release(kuiper\db\ConnectionInterface $connection)

CrudRepositoryInterface ​

命名空间: kuiper\db

方法 ​

insert() ​

text
object insert(object $entity)

Saves the entity.

batchInsert() ​

text
array batchInsert(array $entities)

Batch insert entities.

update() ​

text
object update(object $entity)

Updates the entity.

batchUpdate() ​

text
array batchUpdate(array $entities)

Batch update entities.

save() ​

text
object save(object $entity)

Saves the entity.

batchSave() ​

text
array batchSave(array $entities)

Batch save entities.

updateBy() ​

text
void updateBy(mixed $criteria, callable|array $update)

Update by criteria.

findById() ​

text
?object findById(mixed $id)

Finds the entity by id.

existsById() ​

text
bool existsById(mixed $id)

Returns whether an entity with the given id exists.

findFirstBy() ​

text
?object findFirstBy(mixed $criteria)

Finds the entity.

findByNaturalId() ​

text
?object findByNaturalId(object $example)

Find the entity by fields annotated with @{@see NaturalId}.

findAllByNaturalId() ​

text
array findAllByNaturalId(array $examples)

Find all entities by fields annotated with @{@see NaturalId}.

findAllById() ​

text
array findAllById(array $ids)

Returns all instances of the type with the given IDs.

findAllBy() ​

text
array findAllBy(mixed $criteria)

Returns all entities match the criteria.

query() ​

text
array query(mixed $criteria)

Query with the given criteria.

count() ​

text
int count(mixed $criteria)

Returns row count match the criteria.

deleteById() ​

text
void deleteById(mixed $id)

Finds the entity by id.

delete() ​

text
void delete(object $entity)

Deletes the entity.

deleteFirstBy() ​

text
void deleteFirstBy(mixed $criteria)

Delete first entity matches criteria.

deleteAllById() ​

text
void deleteAllById(array $ids)

Delete all entity by id.

deleteAll() ​

text
void deleteAll(array $entities)

Deletes all entities.

deleteAllBy() ​

text
void deleteAllBy(mixed $criteria)

Delete all matched.

getQueryBuilder() ​

text
kuiper\db\QueryBuilderInterface getQueryBuilder()

getMetaModel() ​

text
kuiper\db\metadata\MetaModelInterface getMetaModel()

DateTimeFactoryInterface ​

命名空间: kuiper\db

方法 ​

currentTimeString() ​

text
string currentTimeString()

Returns current time string.

stringToTime() ​

text
?DateTimeInterface stringToTime(string $timeString)

Parses time string to time.

timeToString() ​

text
string timeToString(DateTimeInterface $time)

Formats time string.

PdoInterface ​

命名空间: kuiper\db

An interface to the native PDO object.

方法 ​

beginTransaction() ​

text
bool beginTransaction()

Begins a transaction and turns off autocommit mode.

commit() ​

text
bool commit()

Commits the existing transaction and restores autocommit mode.

rollBack() ​

text
bool rollBack()

Rolls back the current transaction and restores autocommit mode.

errorCode() ​

text
string errorCode()

Gets the most recent error code.

errorInfo() ​

text
array errorInfo()

Gets the most recent error info.

exec() ​

text
int exec($statement)

Executes an SQL statement and returns the number of affected rows.

inTransaction() ​

text
bool inTransaction()

Is a transaction currently active?

lastInsertId() ​

text
string|false lastInsertId(?string $name = null)

Returns the last inserted autoincrement sequence value.

prepare() ​

text
PDOStatement|false prepare(string $query, array $options = [])

Prepares an SQL statement for execution.

query() ​

text
PDOStatement|false query($statement, $mode = PDO::ATTR_DEFAULT_FETCH_MODE, ...$fetch_mode_args)

Queries the database and returns a PDOStatement.

quote() ​

text
string quote($value, $parameter_type = PDO::PARAM_STR)

Quotes a value for use in an SQL statement.

setAttribute() ​

text
bool setAttribute($attribute, $value)

Sets a PDO attribute value.

getAttribute() ​

text
mixed getAttribute(int $attribute)

Gets a PDO attribute value.

getAvailableDrivers() ​

text
static array getAvailableDrivers()

Returns all currently available PDO drivers.

QueryBuilderInterface ​

命名空间: kuiper\db

方法 ​

from() ​

text
kuiper\db\StatementInterface from(string $table)

Create select statement.

delete() ​

text
kuiper\db\StatementInterface delete(string $table)

Create delete statement.

update() ​

text
kuiper\db\StatementInterface update(string $table)

Create update statement.

insert() ​

text
kuiper\db\StatementInterface insert(string $table)

Create insert statement.

StatementInterface ​

命名空间: kuiper\db

Interface StatementInterface.

方法 ​

getLastInsertId() ​

text
?string getLastInsertId()

获取最后插入记录的自增 ID.

tableAlias() ​

text
tableAlias(string $alias)

Sets table alias.

select() ​

text
select(...$columns)

Sets selected columns.

where() ​

text
where(mixed $condition, ...$args)

Sets where statement.

bindValue() ​

text
bindValue(string $name, mixed $value)

Sets the binding parameter.

orWhere() ​

text
orWhere(mixed $condition, ...$args)

like() ​

text
like(string $column, string $value)

Sets like statement.

in() ​

text
in(string $column, array $values)

Sets in statement.

orIn() ​

text
orIn(string $column, array $values)

notIn() ​

text
notIn(string $column, array $values)

orNotIn() ​

text
orNotIn(string $column, array $values)

limit() ​

text
limit(int $limit)

offset() ​

text
offset(int $offset)

orderBy() ​

text
orderBy(array $orderSpec)

groupBy() ​

text
groupBy(array $columns)

cols() ​

text
cols(array $values)

addRow() ​

text
addRow(array $values = [])

execute() ​

text
bool execute()

Executes statement.

query() ​

text
query()

Executes query statement.

rowCount() ​

text
int rowCount()

Gets affected rows.

close() ​

text
void close()

close statement.

withConnection() ​

text
void withConnection(callable $call)

Gets the db connection.

fetch() ​

text
mixed fetch(?int $fetchStyle = null)

fetchColumn() ​

text
mixed fetchColumn(int $columnNumber = 0)

fetchAll() ​

text
array fetchAll(?int $fetchStyle = null)

TransactionManagerInterface ​

命名空间: kuiper\db

方法 ​

transaction() ​

text
mixed transaction(callable $callback)

Attribute ​

命名空间: kuiper\db\attribute

方法 ​

该接口未声明自己的方法。

AttributeConverterInterface ​

命名空间: kuiper\db\converter

方法 ​

convertToDatabaseColumn() ​

text
mixed convertToDatabaseColumn(mixed $attribute, kuiper\db\metadata\ColumnInterface $column)

Converts the value stored in the entity attribute into the

convertToEntityAttribute() ​

text
mixed convertToEntityAttribute(mixed $dbData, kuiper\db\metadata\ColumnInterface $column)

Converts the data stored in the database column into the

CriteriaClauseInterface ​

命名空间: kuiper\db\criteria

方法 ​

该接口未声明自己的方法。

CriteriaFilterInterface ​

命名空间: kuiper\db\criteria

方法 ​

filter() ​

text
kuiper\db\criteria\CriteriaClauseInterface filter(kuiper\db\criteria\CriteriaClauseInterface $clause)

Exception ​

命名空间: kuiper\db\exception

方法 ​

该接口未声明自己的方法。

ColumnInterface ​

命名空间: kuiper\db\metadata

方法 ​

getName() ​

text
string getName()

Gets the column name.

getType() ​

text
kuiper\reflection\ReflectionTypeInterface getType()

Gets the php type.

getPropertyPath() ​

text
string getPropertyPath()

Gets the object property path.

getProperty() ​

text
kuiper\db\metadata\MetaModelProperty getProperty()

Gets the property meta data.

EntityMapperInterface ​

命名空间: kuiper\db\metadata

方法 ​

freeze() ​

text
array freeze(object $entity, bool $ignoreNull = true)

Converts entity object to database column values.

thaw() ​

text
object thaw(array $columnValues)

Converts database column values.

getValue() ​

text
mixed getValue(object $entity, string $columnName)

Gets the database column value from entity object.

setValue() ​

text
void setValue(object $entity, string $columnName, mixed $value)

Sets the entity property value.

idToPrimaryKey() ​

text
array idToPrimaryKey(mixed $id)

Converts id value to database column value.

MetaModelFactoryInterface ​

命名空间: kuiper\db\metadata

方法 ​

create() ​

text
kuiper\db\metadata\MetaModelInterface create(string $entityClass)

Creates the table metadata.

createFromRepository() ​

text
kuiper\db\metadata\MetaModelInterface createFromRepository(string $repositoryClass)

Creates the table metadata by repository.

MetaModelInterface ​

命名空间: kuiper\db\metadata

方法 ​

getTable() ​

text
string getTable()

Gets the table name.

getEntityClass() ​

text
ReflectionClass getEntityClass()

Gets the class.

getColumnNames() ​

text
array getColumnNames()

Gets the database column names.

getColumns() ​

text
array getColumns()

Gets the column objects.

getCreationTimestamp() ​

text
?string getCreationTimestamp()

Gets the creation timestamp column name.

getUpdateTimestamp() ​

text
?string getUpdateTimestamp()

Gets the update timestamp column name.

getAutoIncrement() ​

text
?string getAutoIncrement()

Gets the auto increment column name.

getNaturalIdIndex() ​

text
?string getNaturalIdIndex()

Gets the unique key index name.

getIdValues() ​

text
?array getIdValues(object $entity)

Gets the database column values that annotated with {@see Id} or {@see NaturalId}.

getNaturalIdValues() ​

text
?array getNaturalIdValues(object $entity)

Gets the database column values that annotated with {@see NaturalId}.

getUniqueKey() ​

text
string getUniqueKey(object $entity, string $joiner = '', bool $ignoreCase = true)

Gets the unique key by join natural id values.

getId() ​

text
getId(object $entity)

Gets the property value annotated with {@see Id}.

getProperty() ​

text
?kuiper\db\metadata\MetaModelProperty getProperty(string $propertyPath)

Gets the property.

filterCriteria() ​

text
kuiper\db\Criteria filterCriteria(kuiper\db\Criteria $criteria)

Filters the criteria.

NamingStrategyInterface ​

命名空间: kuiper\db\metadata

方法 ​

toTableName() ​

text
string toTableName(kuiper\db\metadata\NamingContext $context)

Converts table name to physical table name.

toColumnName() ​

text
string toColumnName(kuiper\db\metadata\NamingContext $context)

Converts column name to physical column name.

ClusterInterface ​

命名空间: kuiper\db\sharding

方法 ​

getTableStrategy() ​

text
kuiper\db\sharding\StrategyInterface getTableStrategy(string $table)

Gets the table sharding strategy.

ConnectionFactoryInterface ​

命名空间: kuiper\db\sharding

方法 ​

create() ​

text
kuiper\db\ConnectionInterface create(int $connectionId)

Creates the connection.

StatementInterface ​

命名空间: kuiper\db\sharding

方法 ​

shardBy() ​

text
void shardBy(array $fields)

Sets the sharding field values.

getShardBy() ​

text
array getShardBy()

getBaseTable() ​

text
string getBaseTable()

Gets the original name of the table.

getTableStrategy() ​

text
kuiper\db\sharding\StrategyInterface getTableStrategy()

Gets the sharding strategy.

StrategyInterface ​

命名空间: kuiper\db\sharding

方法 ​

getTable() ​

text
string getTable(array $fields, string $table)

Gets the partition table name.

getDb() ​

text
int getDb(array $fields)

Gets the connection id.

RuleInterface ​

命名空间: kuiper\db\sharding\rule

方法 ​

getPartition() ​

text
string|int getPartition(array $fields)

Gets the sharding partition.

RPC ​

RpcRequestHandlerInterface ​

命名空间: kuiper\rpc

客户端和服务端共享的 RPC 请求处理器契约.

方法 ​

handle() ​

text
kuiper\rpc\message\RpcResponseInterface handle(kuiper\rpc\message\RpcRequestInterface $request)

ProxyGeneratorInterface ​

命名空间: kuiper\rpc\client

方法 ​

generate() ​

text
mixed generate(string $interfaceName, array $context = [])

RequestHandlerInterface ​

命名空间: kuiper\rpc\client

客户端请求处理器(保留以兼容已有类型声明).

方法 ​

该接口未声明自己的方法。

RpcExecutorFactoryInterface ​

命名空间: kuiper\rpc\client

方法 ​

createExecutor() ​

text
kuiper\rpc\client\RpcExecutorInterface createExecutor(object $proxy, string $method, array $args)

RpcExecutorInterface ​

命名空间: kuiper\rpc\client

方法 ​

execute() ​

text
mixed execute()

返回方法调用的结果(即方法的返回值,不含 out 参数).

executeAll() ​

text
array executeAll()

协议无关地返回全部结果.

RpcRequestFactoryInterface ​

命名空间: kuiper\rpc\client

方法 ​

createRequest() ​

text
kuiper\rpc\message\RpcRequestInterface createRequest(object $proxy, string $method, array $args)

RpcResponseFactoryInterface ​

命名空间: kuiper\rpc\client

方法 ​

createResponse() ​

text
kuiper\rpc\message\RpcResponseInterface createResponse(kuiper\rpc\message\RpcRequestInterface $request, mixed $result)

createErrorResponse() ​

text
kuiper\rpc\message\RpcResponseInterface createErrorResponse(kuiper\rpc\message\RpcRequestInterface $request, Throwable $error)

CircuitBreakerMetricsInterface ​

命名空间: kuiper\rpc\client\middleware

Observer interface for CircuitBreaker state transitions and call outcomes. Implementations can export metrics to Prometheus, StatsD, or any monitoring system.

方法 ​

onSuccess() ​

text
void onSuccess(string $serviceName)

Called when a call succeeds.

onFailure() ​

text
void onFailure(string $serviceName)

Called when a call fails.

onCallNotPermitted() ​

text
void onCallNotPermitted(string $serviceName)

Called when a call is rejected because the circuit is open.

onStateTransition() ​

text
void onStateTransition(string $serviceName, int $fromState, int $toState)

Called when the circuit state transitions.

MiddlewareInterface ​

命名空间: kuiper\rpc\client\middleware

方法 ​

该接口未声明自己的方法。

CodecInterface ​

命名空间: kuiper\rpc\codec

方法 ​

该接口未声明自己的方法。

RequestCodecInterface ​

命名空间: kuiper\rpc\codec

方法 ​

supports() ​

text
bool supports(string $protocol, string $serialization)

encodeRequest() ​

text
kuiper\rpc\transporter\message\TransportRequestInterface encodeRequest(kuiper\rpc\message\RpcRequestInterface $request)

Encode an RPC request into a transport request.

decodeRequest() ​

text
kuiper\rpc\message\RpcRequestInterface decodeRequest(kuiper\rpc\transporter\message\TransportRequestInterface $message)

Decode a transport request into an RPC request.

ResponseCodecInterface ​

命名空间: kuiper\rpc\codec

方法 ​

supports() ​

text
bool supports(string $protocol, string $serialization)

encodeResponse() ​

text
kuiper\rpc\transporter\message\TransportResponseInterface encodeResponse(kuiper\rpc\message\RpcResponseInterface $response)

Encode an RPC response into a transport response.

decodeResponse() ​

text
kuiper\rpc\message\RpcResponseInterface decodeResponse(kuiper\rpc\transporter\message\TransportResponseInterface $message, ?kuiper\rpc\message\RpcRequestInterface $request = null)

Decode a transport response into an RPC response.

RpcContextInterface ​

命名空间: kuiper\rpc\message

方法 ​

getTraceId() ​

text
?string getTraceId()

getSpanId() ​

text
?string getSpanId()

getParentSpanId() ​

text
?string getParentSpanId()

withTrace() ​

text
static withTrace(string $traceId, string $spanId, ?string $parentSpanId = null)

fromAttributes() ​

text
static static fromAttributes(array $attributes)

RpcMethodInterface ​

命名空间: kuiper\rpc\message

方法 ​

getTarget() ​

text
object|string getTarget()

getTargetClass() ​

text
string getTargetClass()

getServiceLocator() ​

text
kuiper\rpc\message\ServiceLocatorInterface getServiceLocator()

getMethodName() ​

text
string getMethodName()

getArguments() ​

text
array getArguments()

withArguments() ​

text
static withArguments(array $args)

getResult() ​

text
array getResult()

withResult() ​

text
static withResult(array $result)

RpcRequestInterface ​

命名空间: kuiper\rpc\message

方法 ​

getRpcMethod() ​

text
kuiper\rpc\message\RpcMethodInterface getRpcMethod()

withRpcMethod() ​

text
static withRpcMethod(kuiper\rpc\message\RpcMethodInterface $rpcMethod)

getEndpoint() ​

text
?kuiper\rpc\transporter\Endpoint getEndpoint()

withEndpoint() ​

text
static withEndpoint(kuiper\rpc\transporter\Endpoint $endpoint)

getAttributes() ​

text
array getAttributes()

getAttribute() ​

text
mixed getAttribute(string $name, mixed $default = null)

withAttribute() ​

text
static withAttribute(string $name, mixed $value)

RpcResponseInterface ​

命名空间: kuiper\rpc\message

方法 ​

getRequest() ​

text
kuiper\rpc\message\RpcRequestInterface getRequest()

getResult() ​

text
array getResult()

withResult() ​

text
static withResult(array $result)

getError() ​

text
?Throwable getError()

withError() ​

text
static withError(Throwable $error)

RpcServerRequestInterface ​

命名空间: kuiper\rpc\message

方法 ​

getRpcMethod() ​

text
kuiper\rpc\message\RpcMethodInterface getRpcMethod()

getServiceLocator() ​

text
kuiper\rpc\message\ServiceLocatorInterface getServiceLocator()

ServiceLocatorInterface ​

命名空间: kuiper\rpc\message

方法 ​

getName() ​

text
string getName()

getNamespace() ​

text
string getNamespace()

getVersion() ​

text
string getVersion()

equals() ​

text
bool equals(kuiper\rpc\message\ServiceLocatorInterface $other)

__toString() ​

text
string __toString()

返回可用于注册表精确匹配的稳定字符串 key.

MiddlewareFactoryInterface ​

命名空间: kuiper\rpc\middleware

方法 ​

getPriority() ​

text
int getPriority()

MiddlewareInterface ​

命名空间: kuiper\rpc\middleware

方法 ​

process() ​

text
kuiper\rpc\message\RpcResponseInterface process(kuiper\rpc\message\RpcRequestInterface $request, kuiper\rpc\RpcRequestHandlerInterface $handler)

RpcServerResponseFactoryInterface ​

命名空间: kuiper\rpc\server

方法 ​

createResponse() ​

text
kuiper\rpc\message\RpcResponseInterface createResponse(kuiper\rpc\message\RpcRequestInterface $request, mixed $result)

createResultResponse() ​

text
kuiper\rpc\message\RpcResponseInterface createResultResponse(kuiper\rpc\message\RpcRequestInterface $request, array $results)

用 [返回值, ...out 参数] 的全部结果创建响应(TARS 多输出参数协议).

createErrorResponse() ​

text
kuiper\rpc\message\RpcResponseInterface createErrorResponse(kuiper\rpc\message\RpcRequestInterface $request, Throwable $error)

ServerRequestHandlerInterface ​

命名空间: kuiper\rpc\server

服务端请求处理器(保留以兼容已有类型声明).

方法 ​

该接口未声明自己的方法。

ServiceRegistryInterface ​

命名空间: kuiper\rpc\server

方法 ​

getService() ​

text
?object getService(kuiper\rpc\message\ServiceLocatorInterface $locator)

register() ​

text
void register(string $serviceName, object $serviceInstance)

registerService() ​

text
void registerService(kuiper\rpc\message\ServiceLocatorInterface $locator, object $serviceInstance)

按完整 ServiceLocator(name + namespace + version)注册服务.

deregister() ​

text
void deregister(string $serviceName)

getServices() ​

text
array getServices()

ServiceResolverInterface ​

命名空间: kuiper\rpc\servicediscovery

方法 ​

resolve() ​

text
?kuiper\rpc\servicediscovery\ServiceEndpoint resolve(kuiper\rpc\message\ServiceLocatorInterface $serviceLocator)

DnsResolverInterface ​

命名空间: kuiper\rpc\servicediscovery\dns

DNS 解析器接口.

方法 ​

resolve() ​

text
array resolve(string $hostname)

解析主机名.

LoadBalanceInterface ​

命名空间: kuiper\rpc\servicediscovery\loadbalance

负载均衡接口.

方法 ​

select() ​

text
mixed select()

选择下一个候选.

Closable ​

命名空间: kuiper\rpc\transporter

方法 ​

close() ​

text
void close()

TransporterFactoryInterface ​

命名空间: kuiper\rpc\transporter

方法 ​

create() ​

text
kuiper\rpc\transporter\TransporterInterface create(kuiper\rpc\transporter\Endpoint $endpoint)

TransporterInterface ​

命名空间: kuiper\rpc\transporter

方法 ​

send() ​

text
kuiper\rpc\transporter\message\TransportResponseInterface send(kuiper\rpc\transporter\message\TransportRequestInterface $request)

sendDirect() ​

text
kuiper\rpc\transporter\message\TransportResponseInterface sendDirect(mixed $connection, kuiper\rpc\transporter\message\TransportRequestInterface $request)

Send request using an already-established connection.

TransportRequestInterface ​

命名空间: kuiper\rpc\transporter\message

方法 ​

getContent() ​

text
string getContent()

getMetadata() ​

text
array getMetadata()

TransportResponseInterface ​

命名空间: kuiper\rpc\transporter\message

方法 ​

getContent() ​

text
string getContent()

getMetadata() ​

text
array getMetadata()

缓存 ​

CacheConstants ​

命名空间: kuiper\cache\stash

Cache constants.

方法 ​

该接口未声明自己的方法。

DriverInterface ​

命名空间: kuiper\cache\stash

方法 ​

getData() ​

text
array getData(string $key)

Returns the previously stored data as well as its expiration date in an associative array. This array contains

storeData() ​

text
bool storeData(string $key, mixed $data, int $expiration)

Takes in data from the exposed Stash class and stored it for later retrieval.

clear() ​

text
bool clear(?string $key = null)

Clears the cache tree using the key array provided as the key. If called with no arguments the entire cache gets

purge() ​

text
bool purge()

Remove any expired code from the cache. For some drivers this can just return true, as their underlying engines

序列化 ​

JsonSerializerInterface ​

命名空间: kuiper\serializer

方法 ​

toJson() ​

text
string toJson(mixed $data, int $options = 0)

Serializes data into json.

fromJson() ​

text
mixed fromJson(string $jsonString, object|string $type)

Converts json to object.

NormalizerInterface ​

命名空间: kuiper\serializer

方法 ​

normalize() ​

text
mixed normalize(mixed $object)

Normalizes the object into an array of scalars|arrays.

denormalize() ​

text
mixed denormalize(mixed $data, kuiper\reflection\ReflectionTypeInterface|string $dataType)

Turn data back into an object of the given class.

SerializerInterface ​

命名空间: kuiper\serializer

统一序列化器接口.

方法 ​

该接口未声明自己的方法。

日志 ​

LoggerFactoryInterface ​

命名空间: kuiper\logger

方法 ​

create() ​

text
Psr\Log\LoggerInterface create(?string $className = null)

Creates logger for the class.

可观测性 ​

TelemetryFlushable ​

命名空间: kuiper\otel

标记"这是一个适合冲刷 telemetry 的边界".

方法 ​

该接口未声明自己的方法。

容错 ​

CircuitBreaker ​

命名空间: kuiper\resilience\circuitbreaker

熔断器接口.

方法 ​

decorate() ​

text
callable decorate(callable $call)

装饰一个待保护的调用.

call() ​

text
mixed call(callable $call, mixed ...$args)

通过熔断器执行一次调用.

getName() ​

text
string getName()

熔断器的名称.

getMetrics() ​

text
kuiper\resilience\circuitbreaker\CircuitBreakerMetrics getMetrics()

获取熔断器的度量指标.

CircuitBreakerFactory ​

命名空间: kuiper\resilience\circuitbreaker

熔断器工厂接口.

方法 ​

create() ​

text
kuiper\resilience\circuitbreaker\CircuitBreaker create(string $name)

按名称获取熔断器,同名熔断器会被复用.

CircuitBreakerMetrics ​

命名空间: kuiper\resilience\circuitbreaker

熔断器度量指标接口.

方法 ​

getFailureRate() ​

text
float getFailureRate()

返回当前失败率(百分比).

getSlowCallRate() ​

text
float getSlowCallRate()

返回当前慢调用率(百分比).

getNumberOfSlowCalls() ​

text
int getNumberOfSlowCalls()

返回当前慢调用总数.

getNumberOfSlowSuccessfulCalls() ​

text
int getNumberOfSlowSuccessfulCalls()

返回当前成功的慢调用数量.

getNumberOfSlowFailedCalls() ​

text
int getNumberOfSlowFailedCalls()

返回当前失败的慢调用数量.

getNumberOfBufferedCalls() ​

text
int getNumberOfBufferedCalls()

返回当前滑动窗口中缓冲的调用总数.

getNumberOfFailedCalls() ​

text
int getNumberOfFailedCalls()

返回当前滑动窗口中缓冲的失败调用数.

getNumberOfNotPermittedCalls() ​

text
int getNumberOfNotPermittedCalls()

返回当前被拒绝的调用数量.

getNumberOfSuccessfulCalls() ​

text
int getNumberOfSuccessfulCalls()

返回当前滑动窗口中缓冲的成功调用数.

reset() ​

text
void reset()

重置度量指标.

onCallNotPermitted() ​

text
void onCallNotPermitted()

记录一次被拒绝的调用.

onSuccess() ​

text
kuiper\resilience\circuitbreaker\Result onSuccess(int $duration)

记录一次成功调用并检查阈值.

onError() ​

text
kuiper\resilience\circuitbreaker\Result onError(int $duration)

记录一次失败调用并检查阈值.

CircuitBreakerState ​

命名空间: kuiper\resilience\circuitbreaker

熔断器状态机接口.

方法 ​

tryAcquirePermission() ​

text
bool tryAcquirePermission()

尝试获取调用许可.

acquirePermission() ​

text
void acquirePermission()

获取调用许可,不允许时抛出异常.

releasePermission() ​

text
void releasePermission()

释放调用许可.

onError() ​

text
void onError(int $duration, Exception $exception)

记录一次失败调用.

onSuccess() ​

text
void onSuccess(int $duration)

记录一次成功调用.

attempts() ​

text
int attempts()

当前状态已经尝试的次数.

getState() ​

text
kuiper\resilience\circuitbreaker\State getState()

当前状态.

StateStore ​

命名空间: kuiper\resilience\circuitbreaker

熔断器状态存储接口.

方法 ​

getState() ​

text
kuiper\resilience\circuitbreaker\State getState(string $name)

读取指定熔断器的状态.

setState() ​

text
void setState(string $name, kuiper\resilience\circuitbreaker\State $state)

写入指定熔断器的状态.

getOpenAt() ​

text
int getOpenAt(string $name)

读取指定熔断器进入 OPEN 状态的时间戳(毫秒),未处于 OPEN 状态时返回 0.

clear() ​

text
void clear(string $name)

清除指定熔断器的状态.

Clock ​

命名空间: kuiper\resilience\core

时钟抽象.

方法 ​

getEpochSecond() ​

text
int getEpochSecond()

获取当前时间戳(秒).

getTimeInMillis() ​

text
int getTimeInMillis()

获取当前时间戳(毫秒).

sleep() ​

text
void sleep(int $millis)

休眠指定的毫秒数.

Counter ​

命名空间: kuiper\resilience\core

计数器抽象.

方法 ​

get() ​

text
int get()

获取当前值.

set() ​

text
void set(int $value)

设置当前值.

increment() ​

text
int increment(int $value = 1)

自增并返回自增后的值.

decrement() ​

text
int decrement(int $value = 1)

自减并返回自减后的值.

CounterFactory ​

命名空间: kuiper\resilience\core

计数器工厂.

方法 ​

create() ​

text
kuiper\resilience\core\Counter create(string $name)

创建(或复用)一个计数器.

Metrics ​

命名空间: kuiper\resilience\core

滑动窗口指标.

方法 ​

record() ​

text
kuiper\resilience\core\Snapshot record(int $duration, kuiper\resilience\core\Outcome $outcome)

记录一次调用.

reset() ​

text
void reset()

重置所有统计量.

getSnapshot() ​

text
kuiper\resilience\core\Snapshot getSnapshot()

返回当前窗口的快照.

getWindowSize() ​

text
int getWindowSize()

返回窗口大小.

getWindowType() ​

text
kuiper\resilience\circuitbreaker\SlideWindowType getWindowType()

返回窗口类型.

MetricsFactory ​

命名空间: kuiper\resilience\core

滑动窗口指标工厂.

方法 ​

create() ​

text
kuiper\resilience\core\Metrics create(string $name, kuiper\resilience\circuitbreaker\SlideWindowType $type, int $windowSize)

创建(或复用)一个滑动窗口指标.

ResilienceException ​

命名空间: kuiper\resilience\core

弹性组件异常标记接口.

方法 ​

该接口未声明自己的方法。

Retry ​

命名空间: kuiper\resilience\retry

重试器.

方法 ​

getName() ​

text
string getName()

重试器的名称.

decorate() ​

text
callable decorate(callable $call)

创建一个带重试能力的可调用对象.

call() ​

text
mixed call(callable $call, ...$args)

执行调用,失败时按照配置重试.

getMetrics() ​

text
kuiper\resilience\retry\RetryMetrics getMetrics()

获取最近一次调用(以及历史累计)的统计指标.

RetryFactory ​

命名空间: kuiper\resilience\retry

重试器工厂.

方法 ​

create() ​

text
kuiper\resilience\retry\Retry create(string $name)

根据名称创建(或者复用)一个重试器.

RetryMetrics ​

命名空间: kuiper\resilience\retry

重试统计指标.

方法 ​

getNumberOfSuccessfulCallsWithoutRetryAttempt() ​

text
int getNumberOfSuccessfulCallsWithoutRetryAttempt()

返回没有发生重试就成功的调用次数.

getNumberOfFailedCallsWithoutRetryAttempt() ​

text
int getNumberOfFailedCallsWithoutRetryAttempt()

返回没有发生重试就失败的调用次数.

getNumberOfSuccessfulCallsWithRetryAttempt() ​

text
int getNumberOfSuccessfulCallsWithRetryAttempt()

返回重试之后成功的调用次数.

getNumberOfFailedCallsWithRetryAttempt() ​

text
int getNumberOfFailedCallsWithRetryAttempt()

返回重试之后依然失败的调用次数.

反射 ​

ReflectionAttributeInterface ​

命名空间: kuiper\reflection

Interface for attribute metadata. Provides static analysis information about PHP 8 attributes.

方法 ​

getName() ​

text
string getName()

Gets the attribute name.

getArguments() ​

text
array getArguments()

Gets the attribute arguments.

newInstance() ​

text
object newInstance()

Creates the attribute instance.

toArray() ​

text
array toArray()

Serializes to array for caching.

fromArray() ​

text
static self fromArray(array $data)

Creates from cached array.

ReflectionClassInterface ​

命名空间: kuiper\reflection

Interface for class metadata. Method names are consistent with \ReflectionClass for familiarity.

方法 ​

getName() ​

text
string getName()

Gets the class name.

getNamespaceName() ​

text
string getNamespaceName()

Gets the namespace name.

getFileName() ​

text
string getFileName()

Gets the filename of the file where the class is defined.

isInterface() ​

text
bool isInterface()

Checks if the class is an interface.

isTrait() ​

text
bool isTrait()

Checks if the class is a trait.

isAbstract() ​

text
bool isAbstract()

Checks if the class is abstract.

isFinal() ​

text
bool isFinal()

Checks if the class is final.

isReadOnly() ​

text
bool isReadOnly()

Checks if the class is readonly.

isInstantiable() ​

text
bool isInstantiable()

Checks if the class is instantiable.

getParentClass() ​

text
?string getParentClass()

Gets the parent class name.

getInterfaceNames() ​

text
array getInterfaceNames()

Gets the interface names.

getTraitNames() ​

text
array getTraitNames()

Gets the trait names.

toReflectionClass() ​

text
ReflectionClass toReflectionClass()

toArray() ​

text
array toArray()

Serializes to array for caching.

fromArray() ​

text
static self fromArray(array $data)

Creates from cached array.

getAttributes() ​

text
array getAttributes(?string $name = null, int $flags = 0)

Gets all attribute metadata.

hasAttribute() ​

text
bool hasAttribute(string $attributeName)

Checks if class has a specific attribute.

ReflectionDocBlockFactoryInterface ​

命名空间: kuiper\reflection

方法 ​

createPropertyDocBlock() ​

text
kuiper\reflection\ReflectionPropertyDocBlockInterface createPropertyDocBlock(ReflectionProperty $property)

createMethodDocBlock() ​

text
kuiper\reflection\ReflectionMethodDocBlockInterface createMethodDocBlock(ReflectionMethod $method)

ReflectionDocBlockInterface ​

命名空间: kuiper\reflection

方法 ​

该接口未声明自己的方法。

ReflectionMethodDocBlockInterface ​

命名空间: kuiper\reflection

方法 ​

getParameterTypes() ​

text
array getParameterTypes()

Parses the docblock of the method to get all parameters type.

getReturnType() ​

text
kuiper\reflection\ReflectionTypeInterface getReturnType()

Parses the docblock of the method to get return type.

ReflectionPropertyDocBlockInterface ​

命名空间: kuiper\reflection

方法 ​

getType() ​

text
kuiper\reflection\ReflectionTypeInterface getType()

Parse the docblock of the property to get the class of the var annotation.

ReflectionTypeInterface ​

命名空间: kuiper\reflection

方法 ​

getName() ​

text
string getName()

Gets type string.

allowsNull() ​

text
bool allowsNull()

Checks if null is allowed.

withAllowsNull() ​

text
kuiper\reflection\ReflectionTypeInterface withAllowsNull(bool $allowsNull)

Returns a new instance with the specified nullability setting.

__toString() ​

text
string __toString()

isPrimitive() ​

text
bool isPrimitive()

Checks if the type is a primitive type.

isArray() ​

text
bool isArray()

Checks if the type is an array type.

isScalar() ​

text
bool isScalar()

Checks if the type is a scalar type.

isCompound() ​

text
bool isCompound()

Checks if the type is a compound type.

isPseudo() ​

text
bool isPseudo()

Checks if the type is a pseudo type.

isNull() ​

text
bool isNull()

Checks if the type is the null type.

isResource() ​

text
bool isResource()

Checks if the type is a resource type.

isClass() ​

text
bool isClass()

Checks if the type is a class type.

isObject() ​

text
bool isObject()

Checks if the type is an object type.

isComposite() ​

text
bool isComposite()

Checks if the type is a composite (union) type.

isUnknown() ​

text
bool isUnknown()

Checks if the type is an unknown type.

equals() ​

text
bool equals(kuiper\reflection\ReflectionTypeInterface $other)

Checks if the type is equal to another type.

TypeFilterInterface ​

命名空间: kuiper\reflection

方法 ​

isValid() ​

text
bool isValid(mixed $value)

checks whether the value is valid.

sanitize() ​

text
mixed sanitize(mixed $value)

Sanitizes input value.

TypeFilterRegistryInterface ​

命名空间: kuiper\reflection

Type filter registry interface.

方法 ​

register() ​

text
void register(string $typeClass, string $filterClass)

Registers the mapping relationship between type and filter.

has() ​

text
bool has(string $typeClass)

Checks if a filter is registered for the specified type.

getFilter() ​

text
?kuiper\reflection\TypeFilterInterface getFilter(kuiper\reflection\ReflectionTypeInterface $type)

Gets the filter instance for the specified type.

getRegisteredTypes() ​

text
array getRegisteredTypes()

Gets all registered type class names.

TypeParserInterface ​

命名空间: kuiper\reflection

方法 ​

parse() ​

text
kuiper\reflection\ReflectionTypeInterface parse(string $typeString)

Parses a type string into a ReflectionTypeInterface instance.

Swoole ​

CounterInterface ​

命名空间: kuiper\swoole\concurrency

方法 ​

add() ​

text
int add(int $value = 1)

增加计数器并返回新值.

get() ​

text
int get()

获取当前值.

set() ​

text
void set(int $value)

设置计数器值.

LockInterface ​

命名空间: kuiper\swoole\concurrency

方法 ​

lock() ​

text
bool lock()

获取锁.

unlock() ​

text
bool unlock()

释放锁.

trylock() ​

text
bool trylock()

尝试获取锁(非阻塞).

ChannelInterface ​

命名空间: kuiper\swoole\coroutine

方法 ​

push() ​

text
bool push($data, ?float $timeout = null)

pop() ​

text
pop(?float $timeout = null)

size() ​

text
int size()

PoolExceptionInterface ​

命名空间: kuiper\swoole\exception

Interface for pool-related exceptions.

方法 ​

该接口未声明自己的方法。

ConnectionHealthCheckInterface ​

命名空间: kuiper\swoole\pool

Interface for checking connection health.

方法 ​

isHealthy() ​

text
bool isHealthy(mixed $resource)

Check if a connection resource is healthy and can be used.

ConnectionInterface ​

命名空间: kuiper\swoole\pool

方法 ​

getResource() ​

text
mixed getResource()

Gets the resource object.

getId() ​

text
int getId()

Gets the connection id.

getCreatedAt() ​

text
float getCreatedAt()

Gets the created time.

close() ​

text
void close()

Close the connection.

ConnectionWarmupInterface ​

命名空间: kuiper\swoole\pool

Interface for connection warmup. Connection warmup is used to perform initialization operations on newly created connections before they are used.

方法 ​

warmup() ​

text
void warmup(mixed $resource)

Warms up a connection resource.

PoolFactoryInterface ​

命名空间: kuiper\swoole\pool

方法 ​

create() ​

text
kuiper\swoole\pool\PoolInterface create(string $poolName, callable $connectionFactory)

Create pool.

PoolInterface ​

命名空间: kuiper\swoole\pool

方法 ​

take() ​

text
mixed take()

release() ​

text
void release(mixed $connection)

Release the connection back to the pool (connection is healthy).

discard() ​

text
void discard(mixed $connection)

Discard a broken connection permanently (will not be reused).

close() ​

text
void close()

Close the pool.

getName() ​

text
string getName()

Gets the pool name.

PoolLifecycleListenerInterface ​

命名空间: kuiper\swoole\pool

Interface for listening to pool lifecycle events.

方法 ​

onPoolInitialize() ​

text
void onPoolInitialize(kuiper\swoole\pool\PoolInterface $pool)

Called when the pool is initialized.

onPoolClose() ​

text
void onPoolClose(kuiper\swoole\pool\PoolInterface $pool)

Called when the pool is closed.

onConnectionCreate() ​

text
void onConnectionCreate(kuiper\swoole\pool\ConnectionInterface $connection)

Called after a connection is created.

onConnectionRelease() ​

text
void onConnectionRelease(kuiper\swoole\pool\ConnectionInterface $connection)

Called before a connection is released back to the pool.

onConnectionDestroy() ​

text
void onConnectionDestroy(kuiper\swoole\pool\ConnectionInterface $connection)

Called before a connection is destroyed.

PoolStatisticsInterface ​

命名空间: kuiper\swoole\pool

Interface for pool statistics.

方法 ​

getActiveConnections() ​

text
int getActiveConnections()

Gets the number of active connections.

getIdleConnections() ​

text
int getIdleConnections()

Gets the number of idle connections in the pool.

getWaitingCoroutines() ​

text
int getWaitingCoroutines()

Gets the number of coroutines waiting for a connection.

getTotalCreated() ​

text
int getTotalCreated()

Gets the total number of connections created.

getTotalDestroyed() ​

text
int getTotalDestroyed()

Gets the total number of connections destroyed.

getAverageWaitTime() ​

text
float getAverageWaitTime()

Gets the average wait time in seconds for acquiring a connection.

getStatistics() ​

text
array getStatistics()

Gets all statistics as an array.

事件 ​

AsyncEventDispatcherInterface ​

命名空间: kuiper\event

方法 ​

dispatchAsync() ​

text
void dispatchAsync(object $event)

EventDispatcherAwareInterface ​

命名空间: kuiper\event

方法 ​

setEventDispatcher() ​

text
void setEventDispatcher(Psr\EventDispatcher\EventDispatcherInterface $eventDispatcher)

Sets the event dispatcher object.

EventListenerInterface ​

命名空间: kuiper\event

方法 ​

__invoke() ​

text
void __invoke(object $event)

getSubscribedEvent() ​

text
string getSubscribedEvent()

Returns the event name this event listener wants to listen to.

EventRegistryInterface ​

命名空间: kuiper\event

方法 ​

addListener() ​

text
void addListener(string $eventName, callable $listener, int $priority = 0)

Adds an event listener that listens on the specified events.

reset() ​

text
void reset()

Removes all event listeners.

EventSubscriberInterface ​

命名空间: kuiper\event

方法 ​

__invoke() ​

text
void __invoke(object $event)

getSubscribedEvents() ​

text
array getSubscribedEvents()

Returns the event name this event listener wants to listen to.

工具 ​

ConfigAwareInterface ​

命名空间: kuiper\helper

方法 ​

setConfig() ​

text
void setConfig(kuiper\helper\ConfigInterface $config)

ConfigInterface ​

命名空间: kuiper\helper

方法 ​

get() ​

text
mixed get(string $key, mixed $default = null)

Finds an entry.

set() ​

text
void set(string $key, mixed $value)

Set a value.

getInt() ​

text
int getInt(string $key, int $default = 0)

Gets an integer value from the configuration.

getFloat() ​

text
float getFloat(string $key, float $default = 0.0)

Gets a float value from the configuration.

getBool() ​

text
bool getBool(string $key, bool $default = false)

Gets a boolean value from the configuration.

getString() ​

text
string getString(string $key, string $default = '')

Gets a string value from the configuration.

has() ​

text
bool has(string $key)

Returns true if the entry exists.

replace() ​

text
void replace(array $other)

Merge other config, overwrite existing keys.

merge() ​

text
void merge(array $other)

Merge other config, keep existing keys.

mergeWhenAbsent() ​

text
void mergeWhenAbsent(array $other)

Merge other config when key not exists.

HTTP 客户端 ​

HttpClientFactoryInterface ​

命名空间: kuiper\http\client

方法 ​

create() ​

text
GuzzleHttp\ClientInterface create(array $options = [])

基于 MIT 许可发布