梵音定版初始化
This commit is contained in:
2
addons/epay/library/hyperf/contract/.gitattributes
vendored
Normal file
2
addons/epay/library/hyperf/contract/.gitattributes
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
/tests export-ignore
|
||||
/.github export-ignore
|
||||
21
addons/epay/library/hyperf/contract/LICENSE
Normal file
21
addons/epay/library/hyperf/contract/LICENSE
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) Hyperf
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
33
addons/epay/library/hyperf/contract/composer.json
Normal file
33
addons/epay/library/hyperf/contract/composer.json
Normal file
@@ -0,0 +1,33 @@
|
||||
{
|
||||
"name": "hyperf/contract",
|
||||
"description": "The contracts of Hyperf.",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
"php",
|
||||
"swoole",
|
||||
"hyperf"
|
||||
],
|
||||
"homepage": "https://hyperf.io",
|
||||
"support": {
|
||||
"docs": "https://hyperf.wiki",
|
||||
"issues": "https://github.com/hyperf/hyperf/issues",
|
||||
"pull-request": "https://github.com/hyperf/hyperf/pulls",
|
||||
"source": "https://github.com/hyperf/hyperf"
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.2"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Hyperf\\Contract\\": "src/"
|
||||
}
|
||||
},
|
||||
"config": {
|
||||
"sort-packages": true
|
||||
},
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "2.2-dev"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* This file is part of Hyperf.
|
||||
*
|
||||
* @link https://www.hyperf.io
|
||||
* @document https://hyperf.wiki
|
||||
* @contact group@hyperf.io
|
||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||
*/
|
||||
namespace Hyperf\Contract;
|
||||
|
||||
interface ApplicationInterface
|
||||
{
|
||||
}
|
||||
22
addons/epay/library/hyperf/contract/src/Castable.php
Normal file
22
addons/epay/library/hyperf/contract/src/Castable.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* This file is part of Hyperf.
|
||||
*
|
||||
* @link https://www.hyperf.io
|
||||
* @document https://hyperf.wiki
|
||||
* @contact group@hyperf.io
|
||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||
*/
|
||||
namespace Hyperf\Contract;
|
||||
|
||||
interface Castable
|
||||
{
|
||||
/**
|
||||
* Get the name of the caster class to use when casting from / to this cast target.
|
||||
*
|
||||
* @return CastsAttributes|CastsInboundAttributes|string
|
||||
*/
|
||||
public static function castUsing();
|
||||
}
|
||||
33
addons/epay/library/hyperf/contract/src/CastsAttributes.php
Normal file
33
addons/epay/library/hyperf/contract/src/CastsAttributes.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* This file is part of Hyperf.
|
||||
*
|
||||
* @link https://www.hyperf.io
|
||||
* @document https://hyperf.wiki
|
||||
* @contact group@hyperf.io
|
||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||
*/
|
||||
namespace Hyperf\Contract;
|
||||
|
||||
interface CastsAttributes
|
||||
{
|
||||
/**
|
||||
* Transform the attribute from the underlying model values.
|
||||
*
|
||||
* @param object $model
|
||||
* @param mixed $value
|
||||
* @return mixed
|
||||
*/
|
||||
public function get($model, string $key, $value, array $attributes);
|
||||
|
||||
/**
|
||||
* Transform the attribute to its underlying model values.
|
||||
*
|
||||
* @param object $model
|
||||
* @param mixed $value
|
||||
* @return array|string
|
||||
*/
|
||||
public function set($model, string $key, $value, array $attributes);
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* This file is part of Hyperf.
|
||||
*
|
||||
* @link https://www.hyperf.io
|
||||
* @document https://hyperf.wiki
|
||||
* @contact group@hyperf.io
|
||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||
*/
|
||||
namespace Hyperf\Contract;
|
||||
|
||||
interface CastsInboundAttributes
|
||||
{
|
||||
/**
|
||||
* Transform the attribute to its underlying model values.
|
||||
*
|
||||
* @param object $model
|
||||
* @param mixed $value
|
||||
* @return array
|
||||
*/
|
||||
public function set($model, string $key, $value, array $attributes);
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* This file is part of Hyperf.
|
||||
*
|
||||
* @link https://www.hyperf.io
|
||||
* @document https://hyperf.wiki
|
||||
* @contact group@hyperf.io
|
||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||
*/
|
||||
namespace Hyperf\Contract;
|
||||
|
||||
interface CompressInterface
|
||||
{
|
||||
public function compress(): UnCompressInterface;
|
||||
}
|
||||
41
addons/epay/library/hyperf/contract/src/ConfigInterface.php
Normal file
41
addons/epay/library/hyperf/contract/src/ConfigInterface.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* This file is part of Hyperf.
|
||||
*
|
||||
* @link https://www.hyperf.io
|
||||
* @document https://hyperf.wiki
|
||||
* @contact group@hyperf.io
|
||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||
*/
|
||||
namespace Hyperf\Contract;
|
||||
|
||||
interface ConfigInterface
|
||||
{
|
||||
/**
|
||||
* Finds an entry of the container by its identifier and returns it.
|
||||
*
|
||||
* @param string $key identifier of the entry to look for
|
||||
* @param mixed $default default value of the entry when does not found
|
||||
* @return mixed entry
|
||||
*/
|
||||
public function get(string $key, $default = null);
|
||||
|
||||
/**
|
||||
* Returns true if the container can return an entry for the given identifier.
|
||||
* Returns false otherwise.
|
||||
*
|
||||
* @param string $keys identifier of the entry to look for
|
||||
* @return bool
|
||||
*/
|
||||
public function has(string $keys);
|
||||
|
||||
/**
|
||||
* Set a value to the container by its identifier.
|
||||
*
|
||||
* @param string $key identifier of the entry to set
|
||||
* @param mixed $value the value that save to container
|
||||
*/
|
||||
public function set(string $key, $value);
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* This file is part of Hyperf.
|
||||
*
|
||||
* @link https://www.hyperf.io
|
||||
* @document https://hyperf.wiki
|
||||
* @contact group@hyperf.io
|
||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||
*/
|
||||
namespace Hyperf\Contract;
|
||||
|
||||
interface ConnectionInterface
|
||||
{
|
||||
/**
|
||||
* Get the real connection from pool.
|
||||
*/
|
||||
public function getConnection();
|
||||
|
||||
/**
|
||||
* Reconnect the connection.
|
||||
*/
|
||||
public function reconnect(): bool;
|
||||
|
||||
/**
|
||||
* Check the connection is valid.
|
||||
*/
|
||||
public function check(): bool;
|
||||
|
||||
/**
|
||||
* Close the connection.
|
||||
*/
|
||||
public function close(): bool;
|
||||
|
||||
/**
|
||||
* Release the connection to pool.
|
||||
*/
|
||||
public function release(): void;
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* This file is part of Hyperf.
|
||||
*
|
||||
* @link https://www.hyperf.io
|
||||
* @document https://hyperf.wiki
|
||||
* @contact group@hyperf.io
|
||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||
*/
|
||||
namespace Hyperf\Contract;
|
||||
|
||||
use Psr\Container\ContainerInterface as PsrContainerInterface;
|
||||
|
||||
interface ContainerInterface extends PsrContainerInterface
|
||||
{
|
||||
/**
|
||||
* Build an entry of the container by its name.
|
||||
* This method behave like get() except resolves the entry again every time.
|
||||
* For example if the entry is a class then a new instance will be created each time.
|
||||
* This method makes the container behave like a factory.
|
||||
*
|
||||
* @param string $name entry name or a class name
|
||||
* @param array $parameters Optional parameters to use to build the entry. Use this to force specific parameters
|
||||
* to specific values. Parameters not defined in this array will be resolved using
|
||||
* the container.
|
||||
* @throws InvalidArgumentException the name parameter must be of type string
|
||||
* @throws NotFoundException no entry found for the given name
|
||||
*/
|
||||
public function make(string $name, array $parameters = []);
|
||||
|
||||
/**
|
||||
* Bind an arbitrary resolved entry to an identifier.
|
||||
* Useful for testing 'get'.
|
||||
*
|
||||
* @param mixed $entry
|
||||
*/
|
||||
public function set(string $name, $entry);
|
||||
|
||||
/**
|
||||
* Unbind an arbitrary resolved entry.
|
||||
*/
|
||||
public function unbind(string $name);
|
||||
|
||||
/**
|
||||
* Bind an arbitrary definition to an identifier.
|
||||
* Useful for testing 'make'.
|
||||
*
|
||||
* @param array|callable|string $definition
|
||||
*/
|
||||
public function define(string $name, $definition);
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* This file is part of Hyperf.
|
||||
*
|
||||
* @link https://www.hyperf.io
|
||||
* @document https://hyperf.wiki
|
||||
* @contact group@hyperf.io
|
||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||
*/
|
||||
namespace Hyperf\Contract;
|
||||
|
||||
interface DispatcherInterface
|
||||
{
|
||||
public function dispatch(...$params);
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* This file is part of Hyperf.
|
||||
*
|
||||
* @link https://www.hyperf.io
|
||||
* @document https://hyperf.wiki
|
||||
* @contact group@hyperf.io
|
||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||
*/
|
||||
namespace Hyperf\Contract;
|
||||
|
||||
interface FrequencyInterface
|
||||
{
|
||||
/**
|
||||
* Number of hit per time.
|
||||
*/
|
||||
public function hit(int $number = 1): bool;
|
||||
|
||||
/**
|
||||
* Hits per second.
|
||||
*/
|
||||
public function frequency(): float;
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* This file is part of Hyperf.
|
||||
*
|
||||
* @link https://www.hyperf.io
|
||||
* @document https://hyperf.wiki
|
||||
* @contact group@hyperf.io
|
||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||
*/
|
||||
namespace Hyperf\Contract;
|
||||
|
||||
interface IdGeneratorInterface
|
||||
{
|
||||
public function generate();
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* This file is part of Hyperf.
|
||||
*
|
||||
* @link https://www.hyperf.io
|
||||
* @document https://hyperf.wiki
|
||||
* @contact group@hyperf.io
|
||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||
*/
|
||||
namespace Hyperf\Contract;
|
||||
|
||||
interface LengthAwarePaginatorInterface extends PaginatorInterface
|
||||
{
|
||||
/**
|
||||
* Create a range of pagination URLs.
|
||||
*/
|
||||
public function getUrlRange(int $start, int $end): array;
|
||||
|
||||
/**
|
||||
* Determine the total number of items in the data store.
|
||||
*/
|
||||
public function total(): int;
|
||||
|
||||
/**
|
||||
* Get the page number of the last available page.
|
||||
*/
|
||||
public function lastPage(): int;
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* This file is part of Hyperf.
|
||||
*
|
||||
* @link https://www.hyperf.io
|
||||
* @document https://hyperf.wiki
|
||||
* @contact group@hyperf.io
|
||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||
*/
|
||||
namespace Hyperf\Contract;
|
||||
|
||||
interface MiddlewareInitializerInterface
|
||||
{
|
||||
public function initCoreMiddleware(string $serverName): void;
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* This file is part of Hyperf.
|
||||
*
|
||||
* @link https://www.hyperf.io
|
||||
* @document https://hyperf.wiki
|
||||
* @contact group@hyperf.io
|
||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||
*/
|
||||
namespace Hyperf\Contract;
|
||||
|
||||
interface NormalizerInterface
|
||||
{
|
||||
/**
|
||||
* Normalizes an object into a set of arrays/scalars.
|
||||
*
|
||||
* @param mixed $object
|
||||
* @return null|array|\ArrayObject|bool|float|int|string
|
||||
*/
|
||||
public function normalize($object);
|
||||
|
||||
/**
|
||||
* Denormalizes data back into an object of the given class.
|
||||
*
|
||||
* @param mixed $data Data to restore
|
||||
* @param string $class The expected class to instantiate
|
||||
* @return mixed|object
|
||||
*/
|
||||
public function denormalize($data, string $class);
|
||||
}
|
||||
23
addons/epay/library/hyperf/contract/src/OnCloseInterface.php
Normal file
23
addons/epay/library/hyperf/contract/src/OnCloseInterface.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* This file is part of Hyperf.
|
||||
*
|
||||
* @link https://www.hyperf.io
|
||||
* @document https://hyperf.wiki
|
||||
* @contact group@hyperf.io
|
||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||
*/
|
||||
namespace Hyperf\Contract;
|
||||
|
||||
use Swoole\Http\Response;
|
||||
use Swoole\Server;
|
||||
|
||||
interface OnCloseInterface
|
||||
{
|
||||
/**
|
||||
* @param Response|Server $server
|
||||
*/
|
||||
public function onClose($server, int $fd, int $reactorId): void;
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* This file is part of Hyperf.
|
||||
*
|
||||
* @link https://www.hyperf.io
|
||||
* @document https://hyperf.wiki
|
||||
* @contact group@hyperf.io
|
||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||
*/
|
||||
namespace Hyperf\Contract;
|
||||
|
||||
use Swoole\Http\Request;
|
||||
use Swoole\Http\Response;
|
||||
|
||||
interface OnHandShakeInterface
|
||||
{
|
||||
public function onHandShake(Request $request, Response $response): void;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* This file is part of Hyperf.
|
||||
*
|
||||
* @link https://www.hyperf.io
|
||||
* @document https://hyperf.wiki
|
||||
* @contact group@hyperf.io
|
||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||
*/
|
||||
namespace Hyperf\Contract;
|
||||
|
||||
use Swoole\Http\Response;
|
||||
use Swoole\WebSocket\Frame;
|
||||
use Swoole\WebSocket\Server;
|
||||
|
||||
interface OnMessageInterface
|
||||
{
|
||||
/**
|
||||
* @param Response|Server $server
|
||||
*/
|
||||
public function onMessage($server, Frame $frame): void;
|
||||
}
|
||||
24
addons/epay/library/hyperf/contract/src/OnOpenInterface.php
Normal file
24
addons/epay/library/hyperf/contract/src/OnOpenInterface.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* This file is part of Hyperf.
|
||||
*
|
||||
* @link https://www.hyperf.io
|
||||
* @document https://hyperf.wiki
|
||||
* @contact group@hyperf.io
|
||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||
*/
|
||||
namespace Hyperf\Contract;
|
||||
|
||||
use Swoole\Http\Request;
|
||||
use Swoole\Http\Response;
|
||||
use Swoole\WebSocket\Server;
|
||||
|
||||
interface OnOpenInterface
|
||||
{
|
||||
/**
|
||||
* @param Response|Server $server
|
||||
*/
|
||||
public function onOpen($server, Request $request): void;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* This file is part of Hyperf.
|
||||
*
|
||||
* @link https://www.hyperf.io
|
||||
* @document https://hyperf.wiki
|
||||
* @contact group@hyperf.io
|
||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||
*/
|
||||
namespace Hyperf\Contract;
|
||||
|
||||
use Swoole\WebSocket\Server;
|
||||
|
||||
interface OnPacketInterface
|
||||
{
|
||||
/**
|
||||
* @param Server $server
|
||||
* @param mixed $data
|
||||
* @param array $clientInfo
|
||||
*/
|
||||
public function onPacket($server, $data, $clientInfo): void;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* This file is part of Hyperf.
|
||||
*
|
||||
* @link https://www.hyperf.io
|
||||
* @document https://hyperf.wiki
|
||||
* @contact group@hyperf.io
|
||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||
*/
|
||||
namespace Hyperf\Contract;
|
||||
|
||||
use Swoole\Coroutine\Server\Connection;
|
||||
use Swoole\Server as SwooleServer;
|
||||
|
||||
interface OnReceiveInterface
|
||||
{
|
||||
/**
|
||||
* @param Connection|SwooleServer $server
|
||||
*/
|
||||
public function onReceive($server, int $fd, int $reactorId, string $data): void;
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* This file is part of Hyperf.
|
||||
*
|
||||
* @link https://www.hyperf.io
|
||||
* @document https://hyperf.wiki
|
||||
* @contact group@hyperf.io
|
||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||
*/
|
||||
namespace Hyperf\Contract;
|
||||
|
||||
interface OnRequestInterface
|
||||
{
|
||||
/**
|
||||
* @param mixed $request swoole request or psr server request
|
||||
* @param mixed $response swoole response or swow session
|
||||
*/
|
||||
public function onRequest($request, $response): void;
|
||||
}
|
||||
19
addons/epay/library/hyperf/contract/src/PackerInterface.php
Normal file
19
addons/epay/library/hyperf/contract/src/PackerInterface.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* This file is part of Hyperf.
|
||||
*
|
||||
* @link https://www.hyperf.io
|
||||
* @document https://hyperf.wiki
|
||||
* @contact group@hyperf.io
|
||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||
*/
|
||||
namespace Hyperf\Contract;
|
||||
|
||||
interface PackerInterface
|
||||
{
|
||||
public function pack($data): string;
|
||||
|
||||
public function unpack(string $data);
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* This file is part of Hyperf.
|
||||
*
|
||||
* @link https://www.hyperf.io
|
||||
* @document https://hyperf.wiki
|
||||
* @contact group@hyperf.io
|
||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||
*/
|
||||
namespace Hyperf\Contract;
|
||||
|
||||
interface PaginatorInterface
|
||||
{
|
||||
/**
|
||||
* Get the URL for a given page.
|
||||
*/
|
||||
public function url(int $page): string;
|
||||
|
||||
/**
|
||||
* Add a set of query string values to the paginator.
|
||||
*
|
||||
* @param array|string $key
|
||||
* @return $this
|
||||
*/
|
||||
public function appends($key, ?string $value = null);
|
||||
|
||||
/**
|
||||
* Get / set the URL fragment to be appended to URLs.
|
||||
*
|
||||
* @return $this|string
|
||||
*/
|
||||
public function fragment(?string $fragment = null);
|
||||
|
||||
/**
|
||||
* The URL for the next page, or null.
|
||||
*/
|
||||
public function nextPageUrl(): ?string;
|
||||
|
||||
/**
|
||||
* Get the URL for the previous page, or null.
|
||||
*/
|
||||
public function previousPageUrl(): ?string;
|
||||
|
||||
/**
|
||||
* Get all of the items being paginated.
|
||||
*/
|
||||
public function items(): array;
|
||||
|
||||
/**
|
||||
* Get the "index" of the first item being paginated.
|
||||
*/
|
||||
public function firstItem(): ?int;
|
||||
|
||||
/**
|
||||
* Get the "index" of the last item being paginated.
|
||||
*/
|
||||
public function lastItem(): ?int;
|
||||
|
||||
/**
|
||||
* Determine how many items are being shown per page.
|
||||
*/
|
||||
public function perPage(): int;
|
||||
|
||||
/**
|
||||
* Determine the current page being paginated.
|
||||
*/
|
||||
public function currentPage(): int;
|
||||
|
||||
/**
|
||||
* Determine if there are enough items to split into multiple pages.
|
||||
*/
|
||||
public function hasPages(): bool;
|
||||
|
||||
/**
|
||||
* Determine if there is more items in the data store.
|
||||
*/
|
||||
public function hasMorePages(): bool;
|
||||
|
||||
/**
|
||||
* Determine if the list of items is empty or not.
|
||||
*/
|
||||
public function isEmpty(): bool;
|
||||
|
||||
/**
|
||||
* Determine if the list of items is not empty.
|
||||
*/
|
||||
public function isNotEmpty(): bool;
|
||||
|
||||
/**
|
||||
* Render the paginator using a given view.
|
||||
*/
|
||||
public function render(?string $view = null, array $data = []): string;
|
||||
}
|
||||
30
addons/epay/library/hyperf/contract/src/PoolInterface.php
Normal file
30
addons/epay/library/hyperf/contract/src/PoolInterface.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* This file is part of Hyperf.
|
||||
*
|
||||
* @link https://www.hyperf.io
|
||||
* @document https://hyperf.wiki
|
||||
* @contact group@hyperf.io
|
||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||
*/
|
||||
namespace Hyperf\Contract;
|
||||
|
||||
interface PoolInterface
|
||||
{
|
||||
/**
|
||||
* Get a connection from the connection pool.
|
||||
*/
|
||||
public function get(): ConnectionInterface;
|
||||
|
||||
/**
|
||||
* Release a connection back to the connection pool.
|
||||
*/
|
||||
public function release(ConnectionInterface $connection): void;
|
||||
|
||||
/**
|
||||
* Close and clear the connection pool.
|
||||
*/
|
||||
public function flush(): void;
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* This file is part of Hyperf.
|
||||
*
|
||||
* @link https://www.hyperf.io
|
||||
* @document https://hyperf.wiki
|
||||
* @contact group@hyperf.io
|
||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||
*/
|
||||
namespace Hyperf\Contract;
|
||||
|
||||
interface PoolOptionInterface
|
||||
{
|
||||
public function getMaxConnections(): int;
|
||||
|
||||
public function getMinConnections(): int;
|
||||
|
||||
public function getConnectTimeout(): float;
|
||||
|
||||
public function getWaitTimeout(): float;
|
||||
|
||||
public function getHeartbeat(): float;
|
||||
|
||||
public function getMaxIdleTime(): float;
|
||||
}
|
||||
36
addons/epay/library/hyperf/contract/src/ProcessInterface.php
Normal file
36
addons/epay/library/hyperf/contract/src/ProcessInterface.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* This file is part of Hyperf.
|
||||
*
|
||||
* @link https://www.hyperf.io
|
||||
* @document https://hyperf.wiki
|
||||
* @contact group@hyperf.io
|
||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||
*/
|
||||
namespace Hyperf\Contract;
|
||||
|
||||
use Swoole\Coroutine\Http\Server as CoHttpServer;
|
||||
use Swoole\Coroutine\Server as CoServer;
|
||||
use Swoole\Server;
|
||||
|
||||
interface ProcessInterface
|
||||
{
|
||||
/**
|
||||
* Create the process object according to process number and bind to server.
|
||||
* @param CoHttpServer|CoServer|Server $server
|
||||
*/
|
||||
public function bind($server): void;
|
||||
|
||||
/**
|
||||
* Determine if the process should start ?
|
||||
* @param CoServer|Server $server
|
||||
*/
|
||||
public function isEnable($server): bool;
|
||||
|
||||
/**
|
||||
* The logical of process will place in here.
|
||||
*/
|
||||
public function handle(): void;
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* This file is part of Hyperf.
|
||||
*
|
||||
* @link https://www.hyperf.io
|
||||
* @document https://hyperf.wiki
|
||||
* @contact group@hyperf.io
|
||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||
*/
|
||||
namespace Hyperf\Contract;
|
||||
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
|
||||
interface ResponseEmitterInterface
|
||||
{
|
||||
/**
|
||||
* @param mixed $connection swoole response or swow session
|
||||
*/
|
||||
public function emit(ResponseInterface $response, $connection, bool $withContent = true);
|
||||
}
|
||||
158
addons/epay/library/hyperf/contract/src/SessionInterface.php
Normal file
158
addons/epay/library/hyperf/contract/src/SessionInterface.php
Normal file
@@ -0,0 +1,158 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* This file is part of Hyperf.
|
||||
*
|
||||
* @link https://www.hyperf.io
|
||||
* @document https://hyperf.wiki
|
||||
* @contact group@hyperf.io
|
||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||
*/
|
||||
namespace Hyperf\Contract;
|
||||
|
||||
interface SessionInterface
|
||||
{
|
||||
/**
|
||||
* Starts the session storage.
|
||||
*
|
||||
* @throws \RuntimeException if session fails to start
|
||||
* @return bool True if session started
|
||||
*/
|
||||
public function start(): bool;
|
||||
|
||||
/**
|
||||
* Returns the session ID.
|
||||
*
|
||||
* @return string The session ID
|
||||
*/
|
||||
public function getId(): string;
|
||||
|
||||
/**
|
||||
* Sets the session ID.
|
||||
*/
|
||||
public function setId(string $id);
|
||||
|
||||
/**
|
||||
* Returns the session name.
|
||||
*/
|
||||
public function getName(): string;
|
||||
|
||||
/**
|
||||
* Sets the session name.
|
||||
*/
|
||||
public function setName(string $name);
|
||||
|
||||
/**
|
||||
* Invalidates the current session.
|
||||
*
|
||||
* Clears all session attributes and flashes and regenerates the
|
||||
* session and deletes the old session from persistence.
|
||||
*
|
||||
* @param int $lifetime Sets the cookie lifetime for the session cookie. A null value
|
||||
* will leave the system settings unchanged, 0 sets the cookie
|
||||
* to expire with browser session. Time is in seconds, and is
|
||||
* not a Unix timestamp.
|
||||
*
|
||||
* @return bool True if session invalidated, false if error
|
||||
*/
|
||||
public function invalidate(?int $lifetime = null): bool;
|
||||
|
||||
/**
|
||||
* Migrates the current session to a new session id while maintaining all
|
||||
* session attributes.
|
||||
*
|
||||
* @param bool $destroy Whether to delete the old session or leave it to garbage collection
|
||||
* @param int $lifetime Sets the cookie lifetime for the session cookie. A null value
|
||||
* will leave the system settings unchanged, 0 sets the cookie
|
||||
* to expire with browser session. Time is in seconds, and is
|
||||
* not a Unix timestamp.
|
||||
*
|
||||
* @return bool True if session migrated, false if error
|
||||
*/
|
||||
public function migrate(bool $destroy = false, ?int $lifetime = null): bool;
|
||||
|
||||
/**
|
||||
* Force the session to be saved and closed.
|
||||
*
|
||||
* This method is generally not required for real sessions as
|
||||
* the session will be automatically saved at the end of
|
||||
* code execution.
|
||||
*/
|
||||
public function save(): void;
|
||||
|
||||
/**
|
||||
* Checks if an attribute is defined.
|
||||
*
|
||||
* @param string $name The attribute name
|
||||
*
|
||||
* @return bool true if the attribute is defined, false otherwise
|
||||
*/
|
||||
public function has(string $name): bool;
|
||||
|
||||
/**
|
||||
* Returns an attribute.
|
||||
*
|
||||
* @param string $name The attribute name
|
||||
* @param mixed $default The default value if not found
|
||||
*/
|
||||
public function get(string $name, $default = null);
|
||||
|
||||
/**
|
||||
* Sets an attribute.
|
||||
* @param mixed $value
|
||||
*/
|
||||
public function set(string $name, $value): void;
|
||||
|
||||
/**
|
||||
* Put a key / value pair or array of key / value pairs in the session.
|
||||
*
|
||||
* @param array|string $key
|
||||
* @param null|mixed $value
|
||||
*/
|
||||
public function put($key, $value = null): void;
|
||||
|
||||
/**
|
||||
* Returns attributes.
|
||||
*/
|
||||
public function all(): array;
|
||||
|
||||
/**
|
||||
* Sets attributes.
|
||||
*/
|
||||
public function replace(array $attributes): void;
|
||||
|
||||
/**
|
||||
* Removes an attribute, returning its value.
|
||||
*
|
||||
* @return mixed The removed value or null when it does not exist
|
||||
*/
|
||||
public function remove(string $name);
|
||||
|
||||
/**
|
||||
* Remove one or many items from the session.
|
||||
*
|
||||
* @param array|string $keys
|
||||
*/
|
||||
public function forget($keys): void;
|
||||
|
||||
/**
|
||||
* Clears all attributes.
|
||||
*/
|
||||
public function clear(): void;
|
||||
|
||||
/**
|
||||
* Checks if the session was started.
|
||||
*/
|
||||
public function isStarted(): bool;
|
||||
|
||||
/**
|
||||
* Get the previous URL from the session.
|
||||
*/
|
||||
public function previousUrl(): ?string;
|
||||
|
||||
/**
|
||||
* Set the "previous" URL in the session.
|
||||
*/
|
||||
public function setPreviousUrl(string $url): void;
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* This file is part of Hyperf.
|
||||
*
|
||||
* @link https://www.hyperf.io
|
||||
* @document https://hyperf.wiki
|
||||
* @contact group@hyperf.io
|
||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||
*/
|
||||
namespace Hyperf\Contract;
|
||||
|
||||
use Psr\Log\LoggerInterface;
|
||||
|
||||
interface StdoutLoggerInterface extends LoggerInterface
|
||||
{
|
||||
}
|
||||
20
addons/epay/library/hyperf/contract/src/Synchronized.php
Normal file
20
addons/epay/library/hyperf/contract/src/Synchronized.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* This file is part of Hyperf.
|
||||
*
|
||||
* @link https://www.hyperf.io
|
||||
* @document https://hyperf.wiki
|
||||
* @contact group@hyperf.io
|
||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||
*/
|
||||
namespace Hyperf\Contract;
|
||||
|
||||
interface Synchronized
|
||||
{
|
||||
/**
|
||||
* Whether the data has been synchronized.
|
||||
*/
|
||||
public function isSynchronized(): bool;
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* This file is part of Hyperf.
|
||||
*
|
||||
* @link https://www.hyperf.io
|
||||
* @document https://hyperf.wiki
|
||||
* @contact group@hyperf.io
|
||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||
*/
|
||||
namespace Hyperf\Contract;
|
||||
|
||||
interface TranslatorInterface
|
||||
{
|
||||
/**
|
||||
* Get the translation for a given key.
|
||||
*/
|
||||
public function trans(string $key, array $replace = [], ?string $locale = null);
|
||||
|
||||
/**
|
||||
* Get a translation according to an integer value.
|
||||
*
|
||||
* @param array|\Countable|int $number
|
||||
*/
|
||||
public function transChoice(string $key, $number, array $replace = [], ?string $locale = null): string;
|
||||
|
||||
/**
|
||||
* Get the default locale being used.
|
||||
*/
|
||||
public function getLocale(): string;
|
||||
|
||||
/**
|
||||
* Set the default locale.
|
||||
*/
|
||||
public function setLocale(string $locale);
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* This file is part of Hyperf.
|
||||
*
|
||||
* @link https://www.hyperf.io
|
||||
* @document https://hyperf.wiki
|
||||
* @contact group@hyperf.io
|
||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||
*/
|
||||
namespace Hyperf\Contract;
|
||||
|
||||
interface TranslatorLoaderInterface
|
||||
{
|
||||
/**
|
||||
* Load the messages for the given locale.
|
||||
*/
|
||||
public function load(string $locale, string $group, ?string $namespace = null): array;
|
||||
|
||||
/**
|
||||
* Add a new namespace to the loader.
|
||||
*/
|
||||
public function addNamespace(string $namespace, string $hint);
|
||||
|
||||
/**
|
||||
* Add a new JSON path to the loader.
|
||||
*/
|
||||
public function addJsonPath(string $path);
|
||||
|
||||
/**
|
||||
* Get an array of all the registered namespaces.
|
||||
*/
|
||||
public function namespaces(): array;
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* This file is part of Hyperf.
|
||||
*
|
||||
* @link https://www.hyperf.io
|
||||
* @document https://hyperf.wiki
|
||||
* @contact group@hyperf.io
|
||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||
*/
|
||||
namespace Hyperf\Contract;
|
||||
|
||||
interface UnCompressInterface
|
||||
{
|
||||
public function uncompress();
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* This file is part of Hyperf.
|
||||
*
|
||||
* @link https://www.hyperf.io
|
||||
* @document https://hyperf.wiki
|
||||
* @contact group@hyperf.io
|
||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||
*/
|
||||
namespace Hyperf\Contract;
|
||||
|
||||
use Hyperf\Utils\Contracts\MessageBag;
|
||||
use Hyperf\Utils\Contracts\MessageProvider;
|
||||
|
||||
interface ValidatorInterface extends MessageProvider
|
||||
{
|
||||
/**
|
||||
* Run the validator's rules against its data.
|
||||
*/
|
||||
public function validate(): array;
|
||||
|
||||
/**
|
||||
* Get the attributes and values that were validated.
|
||||
*/
|
||||
public function validated(): array;
|
||||
|
||||
/**
|
||||
* Determine if the data fails the validation rules.
|
||||
*/
|
||||
public function fails(): bool;
|
||||
|
||||
/**
|
||||
* Get the failed validation rules.
|
||||
*/
|
||||
public function failed(): array;
|
||||
|
||||
/**
|
||||
* Add conditions to a given field based on a Closure.
|
||||
*
|
||||
* @param array|string $attribute
|
||||
* @param array|string $rules
|
||||
* @return $this
|
||||
*/
|
||||
public function sometimes($attribute, $rules, callable $callback);
|
||||
|
||||
/**
|
||||
* Add an after validation callback.
|
||||
*
|
||||
* @param callable|string $callback
|
||||
* @return $this
|
||||
*/
|
||||
public function after($callback);
|
||||
|
||||
/**
|
||||
* Get all of the validation error messages.
|
||||
*/
|
||||
public function errors(): MessageBag;
|
||||
}
|
||||
Reference in New Issue
Block a user