text
stringlengths
14
100k
source
stringclasses
1 value
repo
stringclasses
810 values
language
stringclasses
13 values
<|fim_suffix|> mixed> */ public function toArray(): array; } <|fim_prefix|><?php declare(strict_types=1); namespace EasyWeChat\Kernel\Contracts; inter<|fim_middle|>face Arrayable { /** * @return array<int|string,<|endoftext|>
fim
w7corp/easywechat
php
<|fim_suffix|>id; /** * @param array<string>|string $key */ public function get(array|string $key, mixed $default = null): mixed; } <|fim_prefix|><?php declare(strict_types=1); namespace EasyWeChat\Kernel\Contracts; use ArrayAccess; /*<|fim_middle|>* * @extends ArrayAccess<string, mixed> */ i...
fim
w7corp/easywechat
php
<|fim_prefix|><?php declare(strict_types=1); namespace EasyWeChat\Kernel\Contracts; interface JsApiTicket { public function getTicket(): string; /** * @return arr<|fim_suffix|>ng $url, string $nonce, int $timestamp): array; } <|fim_middle|>ay<string,mixed> */ public function configSignature(st...
fim
w7corp/easywechat
php
<|fim_suffix|>ion toJson(): string|false; } <|fim_prefix|><?php declare(strict_ty<|fim_middle|>pes=1); namespace EasyWeChat\Kernel\Contracts; interface Jsonable { public funct<|endoftext|>
fim
w7corp/easywechat
php
<|fim_suffix|>AccessToken extends AccessToken { public function refresh(): string; } <|fim_prefix|><?php namespa<|fim_middle|>ce EasyWeChat\Kernel\Contracts; interface Refreshable<|endoftext|>
fim
w7corp/easywechat
php
<|fim_prefix|><?php namespa<|fim_suffix|>ing; } <|fim_middle|>ce EasyWeChat\Kernel\Contracts; interface RefreshableJsApiTicket extends JsApiTicket { public function refreshTicket(): str<|endoftext|>
fim
w7corp/easywechat
php
<|fim_suffix|>terface; /** * @method mixed withDefaultSuiteTicketHandler(callable $handler) used in \EasyWeChat\OpenWork\Server */ interface Server { public function serve(): ResponseInterface; } <|fim_prefix|><?php declare(strict_types=1); nam<|fim_middle|>espace EasyWeChat\Kernel\Contracts; use Psr\Http\Mes...
fim
w7corp/easywechat
php
<|fim_suffix|>g|int ...$attributes): string { $attributes = array_map( static fn (string|int $attribute): string => (string) $attribute, $attributes ); sort($attributes, SORT_STRING); return sha1(implode('', $attributes)); } /** * @throws Runti...
fim
w7corp/easywechat
php
<?php namespace EasyWeChat\Kernel\Exceptions; class BadMethodCallException extends Exception { } <|endoftext|>
fim
w7corp/easywechat
php
<|fim_suffix|>on { } <|fim_prefix|><?php declare(strict_types=1); namespace EasyWeChat\Kernel\Exceptions; class BadRequestExcepti<|fim_middle|>on extends Excepti<|endoftext|>
fim
w7corp/easywechat
php
<|fim_suffix|>on { } <|fim_prefix|><?php declare(strict_t<|fim_middle|>ypes=1); namespace EasyWeChat\Kernel\Exceptions; class BadResponseException extends Excepti<|endoftext|>
fim
w7corp/easywechat
php
<|fim_prefix|><?php declare(strict_types=1); namespace EasyWeChat\Kernel\Excep<|fim_suffix|>n extends Exception { } <|fim_middle|>tions; class DecryptExceptio<|endoftext|>
fim
w7corp/easywechat
php
<|fim_prefix|><?php declare(strict_types=1); <|fim_suffix|>on { } <|fim_middle|> namespace EasyWeChat\Kernel\Exceptions; use Exception as BaseException; class Exception extends BaseExcepti<|endoftext|>
fim
w7corp/easywechat
php
<?php declare(strict_types=1); namespace EasyWeChat\Kernel\Exceptions; use Psr\Http\Message\ResponseInterface; class HttpException extends Exception { public ?ResponseInterface $response; /** * HttpException constructor. */ public function __construct(string $message, ?ResponseInterface $resp...
fim
w7corp/easywechat
php
<|fim_suffix|>idArgumentException extends Exception { } <|fim_prefix|><?ph<|fim_middle|>p declare(strict_types=1); namespace EasyWeChat\Kernel\Exceptions; class Inval<|endoftext|>
fim
w7corp/easywechat
php
<|fim_prefix|><?p<|fim_suffix|>idConfigException extends Exception { } <|fim_middle|>hp declare(strict_types=1); namespace EasyWeChat\Kernel\Exceptions; class Inval<|endoftext|>
fim
w7corp/easywechat
php
<|fim_suffix|> Exception { } <|fim_prefix|><?php declare(strict_types=1); namespace EasyWeChat\Kernel\Exceptions; class<|fim_middle|> RuntimeException extends<|endoftext|>
fim
w7corp/easywechat
php
<|fim_suffix|>{ } <|fim_prefix|><?php declare<|fim_middle|>(strict_types=1); namespace EasyWeChat\Kernel\Exceptions; class ServiceNotFoundException extends Exception <|endoftext|>
fim
w7corp/easywechat
php
<|fim_prefix|><?php namespace EasyWeChat\Kernel\Form; use const PATHINFO_EXTENSION; use EasyWeChat\K<|fim_suffix|>on withContents( string $contents, ?string $filename = null, ?string $contentType = null, ?string $encoding = null ): DataPart { return self::fromContents($con...
fim
w7corp/easywechat
php
<|fim_prefix|><?php namespace EasyWeChat\Kernel\Form; use JetBrains\PhpStorm\ArrayShape; use Symfony\Component\Mime\Part\DataPart; use Symfony\Component\Mime\Part\Multipart\FormDataPart; class Form { /** * @param array<string|array|Da<|fim_suffix|>string[]>,body:string} */ #[ArrayShape(['headers' ...
fim
w7corp/easywechat
php
<|fim_prefix|><?php declare(strict_types=1); namespace EasyWeChat\Kernel\HttpClient; use Closure; use EasyWeChat\Kernel\Contracts\AccessToken as AccessTokenInterface; use EasyWeChat\Kernel\Contracts\AccessTokenAwareHttpClient as AccessTokenAwareHttpClientInterface; use EasyWeChat\Kernel\Traits\MockableHttpClient; us...
fim
w7corp/easywechat
php
<|fim_suffix|> ?TransportExceptionInterface $exception ): ?bool { if ($responseContent && $this->decider && ($this->decider)($context, $responseContent, $exception)) { if ($this->accessToken instanceof RefreshableAccessTokenInterface) { return (bool) $this->accessToken->re...
fim
w7corp/easywechat
php
<|fim_suffix|>$url, RequestUtil::formatOptions($options, 'PATCH')); } /** * @param array<string, mixed> $options * * @throws TransportExceptionInterface */ public function put(string $url, array $options = []): Response|ResponseInterfaceAlias { return $this->request('PUT',...
fim
w7corp/easywechat
php
<|fim_prefix|><?php namespace EasyWeChat\Kernel\HttpClient; use const ARRAY_FILTER_USE_KEY; use const JSON_FORCE_OBJECT; use const JSON_UNESCAPED_UNICODE; use EasyWeChat\Kernel\Support\UserAgent; use EasyWeChat\Kernel\Support\Xml; use InvalidArgumentException; use JetBrains\PhpStorm\ArrayShape; use Nyholm\Psr7\Facto...
fim
w7corp/easywechat
php
<|fim_suffix|>, string $method = 'GET'): array { $name = in_array(strtoupper($method), ['GET', 'HEAD', 'DELETE']) ? 'query' : 'body'; if (($options['headers']['Content-Type'] ?? $options['headers']['content-type'] ?? null) === 'application/json' || ! empty($options['json'])) { $name = '...
fim
w7corp/easywechat
php
<|fim_suffix|>fset] ?? null; } /** * @throws BadMethodCallException */ public function offsetSet(mixed $offset, mixed $value): void { throw new BadMethodCallException('Response is immutable.'); } /** * @throws BadMethodCallException */ public function offsetUnse...
fim
w7corp/easywechat
php
<|fim_prefix|><?php namespace EasyWeChat\Kernel\HttpClient; use Psr\Log\LoggerInterface; use Symf<|fim_suffix|>>client = new RetryableHttpClient($this->client, $strategy, $maxRetries, $logger); return $this; } } <|fim_middle|>ony\Component\HttpClient\Retry\GenericRetryStrategy; use Symfony\Component\Http...
fim
w7corp/easywechat
php
<|fim_prefix|><?php declare(strict_types=1); namespace EasyWeChat\Kernel\HttpClient; use Psr\Log\LoggerAwareInterface; use Psr\Log\LoggerInterface; use Symfony\Component\HttpClient\HttpClientTrait; use Symfony\Contracts\HttpClient\HttpClientInterface; use Symfony\Contracts\H<|fim_suffix|>od, $url, $options); } ...
fim
w7corp/easywechat
php
<|fim_prefix|><?php declare(strict_types=1); namespace EasyWeChat\Kernel; use ArrayAccess; use E<|fim_suffix|>$attributes; } /** * @throws BadRequestException */ public static function createFromRequest(ServerRequestInterface $request): Message { return static::createFromStringCont...
fim
w7corp/easywechat
php
<|fim_prefix|><?php namespace EasyWeChat\Kernel; use const PHP_OUTPUT_HANDLER_CLEANABLE; use const PHP_OUTPUT_HANDLER_FLUSHABLE; use const PHP_OUTPUT_HANDLER_REMOVABLE; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\StreamInterface; use function array_keys; use function array_map; use function count; ...
fim
w7corp/easywechat
php
<|fim_prefix|><?php namespace EasyWeChat\Kernel\Support; use const OPENSSL_RAW_DATA; use EasyWeChat\Kernel\Contracts\Aes; use EasyWeChat\Kernel\Exceptions\InvalidArgumentException; use function base64_decode; use function openssl_decrypt; use function openssl_error_string; class AesCbc implements Aes { /** ...
fim
w7corp/easywechat
php
<|fim_suffix|> 'aes-256-ecb', $key, OPENSSL_RAW_DATA, (string) $iv ); if ($plaintext === false) { throw new InvalidArgumentException(openssl_error_string() ?: 'Decrypt AES ECB failed.'); } return $plaintext; } } <|fim_prefix|><?php ...
fim
w7corp/easywechat
php
<|fim_suffix|>= substr($ciphertext, 0, -self::BLOCK_SIZE); $plaintext = openssl_decrypt($ciphertext, 'aes-256-gcm', $key, OPENSSL_RAW_DATA, (string) $iv, $tag, $aad); if ($plaintext === false) { throw new InvalidArgumentException(openssl_error_string() ?: 'Decrypt failed'); } ...
fim
w7corp/easywechat
php
<|fim_suffix|> arrays to hold final // values at the correct depth. Then we'll keep digging into the array. if (! isset($array[$key]) || ! is_array($array[$key])) { $array[$key] = []; } $array = &$array[$key]; } $array[array_shift($keys)]...
fim
w7corp/easywechat
php
<|fim_prefix|><?php declare(strict_types=1); namespace EasyWeChat\Kernel\Support; use EasyWeChat\Kernel\Exceptions\BadRequestException; class MessageParser { /** * Parse message content from string (XML or JSON). * This is a pure parser that automatically detects and parses XML or JSON format. * ...
fim
w7corp/easywechat
php
<|fim_prefix|><?php namespace EasyWeChat\Kernel\Support; use EasyWeChat\Kernel\Exceptions\InvalidArgumentException; class Pkcs7 { /** * @throws InvalidArgumentException */ public static function padding(string $contents, int $blockSize): string { if ($blockSize > 32) { throw...
fim
w7corp/easywechat
php
<|fim_suffix|>lass PrivateKey { public function __construct(protected string $key, protected ?string $passphrase = null) { if (file_exists($key)) { $this->key = "file://{$key}"; } } public function getKey(): string { if (str_starts_with($this->key, 'file://')) { ...
fim
w7corp/easywechat
php
<|fim_suffix|>tion getSerialNo(): string { $info = openssl_x509_parse($this->certificate); if ($info === false) { throw new InvalidConfigException('Read the $certificate failed, please check it whether or nor correct'); } return strtoupper($info['serialNumberHex']); ...
fim
w7corp/easywechat
php
<|fim_prefix|><?php namespace EasyWeChat\Kernel\Support; use Exception; use function base64_encode; use function preg_replace; use function random_bytes; use function str_replace; use function strlen; use function strtolower; use function substr; use function trim; class Str { /** * From https://github.com...
fim
w7corp/easywechat
php
<|fim_suffix|>?: ['version' => 'unknown'])['version']); } if (! ini_get('safe_mode') && function_exists('php_uname') && ! in_array('php_uname', $disabledFunctions, true) ) { $osName = 'OS/'.php_uname('s').'/'.php_uname('r'); array_unshift($value, ...
fim
w7corp/easywechat
php
<|fim_suffix|>nsformer::toArray($xml); } public static function build(array $data): string { return Transformer::toXml($data); } } <|fim_prefix|><?php declare(strict_types=1); namespace EasyWeChat\Kernel\Support;<|fim_middle|> use TheNorthMemory\Xml\Transformer; class Xml { public stati...
fim
w7corp/easywechat
php
<|fim_prefix|><?php namespace EasyWeChat\Kernel\Traits; /** * @deprecated Use DecryptMessage trait instead. This tr<|fim_suffix|> decryptJsonMessage; } } <|fim_middle|>ait will be removed in a future version. */ trait DecryptJsonMessage { use DecryptMessage { decryptMessage as<|endoftext|>
fim
w7corp/easywechat
php
<|fim_prefix|><?php namespace EasyWeChat\Kernel\Traits<|fim_suffix|>timestamp ); $attributes = MessageParser::parse($plaintext); $message->merge($attributes); return $message; } /** * Validate the request signature. * * @throws BadRequestException */ ...
fim
w7corp/easywechat
php
<|fim_prefix|><?php namespace EasyWeChat\Kernel\Traits; /** * @deprecated Use DecryptMessage trait instead. This trait will be removed in a future version. */ trait DecryptXmlMessage { use Dec<|fim_suffix|> { decryptMessage as public; } } <|fim_middle|>ryptMessage<|endoftext|>
fim
w7corp/easywechat
php
<?php declare(strict_types=1); namespace EasyWeChat\Kernel\Traits; use function array_key_exists; use function array_merge; use function json_encode; trait HasAttributes { /** * @var array<int|string,mixed> */ protected array $attributes = []; /** * @param array<int|string,mixed> $attr...
fim
w7corp/easywechat
php
<|fim_prefix|><?php declare(strict_types=1); namespace EasyWeChat\Kernel\Traits; use Psr\SimpleCache\CacheInterface; use Symfony\Component\Cache\Adapter\FilesystemAdapter; use Symfony\Component\Cache\Psr16Cache; trait InteractWithCache { protected ?CacheInterface $cache = null; protected int $cacheLifetime...
fim
w7corp/easywechat
php
<?php declare(strict_types=1); namespace EasyWeChat\Kernel\Traits; use EasyWeChat\Kernel\HttpClient\AccessTokenAwareClient; trait InteractWithClient { protected ?AccessTokenAwareClient $client = null; public function getClient(): AccessTokenAwareClient { if (! $this->client) { $this...
fim
w7corp/easywechat
php
<|fim_prefix|><?php declare(strict_types=1); namespace EasyWeChat\Kernel\Traits; use EasyWeChat\Kernel\Config; use EasyWeChat\Kernel\Contracts\C<|fim_suffix|> is_array; trait InteractWithConfig { protected ConfigInterface $config; /** * @param array<string,mixed>|ConfigInterface $config */ ...
fim
w7corp/easywechat
php
<?php declare(strict_types=1); namespace EasyWeChat\Kernel\Traits; use Closure; use EasyWeChat\Kernel\Exceptions\InvalidArgumentException; use JetBrains\PhpStorm\ArrayShape; use function array_reverse; use function array_unshift; use function call_user_func; use function func_get_args; use function gettype; use fun...
fim
w7corp/easywechat
php
<|fim_suffix|>tionsByRegexp = Arr::get($options, 'options_by_regexp', []); unset($options['options_by_regexp']); $client = HttpClient::create(RequestUtil::formatDefaultOptions($options)); if (is_array($optionsByRegexp) && ! empty($optionsByRegexp)) { $client = new ScopingHttpClient...
fim
w7corp/easywechat
php
<|fim_prefix|><?php declare(strict_types=1); namespace EasyWeChat\Kernel\Traits; use EasyWeChat\Kernel\HttpClient\RequestUtil; use Nyholm\Psr7\Factory\Psr17Factory; use Psr\Http\Message\ServerRequestInterface; use Symfony\Bridge\PsrHttpMessage\Factory\PsrHttpFactory; use Symfony\Component\HttpFoundation\Request; tr...
fim
w7corp/easywechat
php
<|fim_suffix|> } #[Pure] public function getRequestUrl(): string { return $this->mockResponse->getRequestUrl(); } /** * @return array<string, mixed> */ #[Pure] public function getRequestOptio...
fim
w7corp/easywechat
php
<|fim_suffix|>function createJsonResponse(array $attributes, ?Encryptor $encryptor = null): ResponseInterface { $jsonStr = json_encode($attributes, JSON_UNESCAPED_UNICODE); if (is_string($jsonStr)) { return new Response(200, ['Content-Type' => 'application/json'], $encryptor ? $encrypto...
fim
w7corp/easywechat
php
<|fim_prefix|><?php namespace EasyWeChat\Kernel\Traits; use EasyWeChat\Kernel\Encryptor; use EasyWeChat\Kernel\Exceptions\InvalidArgumentException; use EasyWeChat\Kernel\Exceptions\RuntimeException; use EasyWeChat\Kernel\Message; use EasyWeChat\Kernel\Support\Xml; use Nyholm\Psr7\Response; use Psr\Http\Message\Respon...
fim
w7corp/easywechat
php
<|fim_prefix|><?php declare(strict_types=1); namespace EasyWeChat\MiniApp; class AccessToken extends<|fim_suffix|> const CACHE_KEY_PREFIX = 'mini_app'; } <|fim_middle|> \EasyWeChat\OfficialAccount\AccessToken { <|endoftext|>
fim
w7corp/easywechat
php
<|fim_prefix|><?php declare<|fim_suffix|>nt implements AccountInterface { // } <|fim_middle|>(strict_types=1); namespace EasyWeChat\MiniApp; use EasyWeChat\MiniApp\Contracts\Account as AccountInterface; class Account extends \EasyWeChat\OfficialAccount\Accou<|endoftext|>
fim
w7corp/easywechat
php
<|fim_prefix|><?php declare(strict_types=1); namespace EasyWeChat\MiniApp; use EasyWeChat\Kernel\Contracts\AccessToken as AccessTokenInterface; use EasyWeChat\Kernel\Contracts\Server as ServerInterface; use EasyWeChat\Kernel\Encryptor; use EasyWeChat\Kernel\Exceptions\InvalidConfigException; use EasyWeChat\Kernel\Ht...
fim
w7corp/easywechat
php
<|fim_suffix|>ring; public function getAesKey(): ?string; } <|fim_prefix|><?php declare(strict_types=1); namespace EasyWeChat\MiniApp\Contracts; interface Accoun<|fim_middle|>t { public function getAppId(): string; public function getSecret(): string; public function getToken(): ?st<|endoftext|>
fim
w7corp/easywechat
php
<|fim_suffix|> AccessTokenAwareClient; public function getHttpClient(): HttpClientInterface; public function getConfig(): Config; public function getAccessToken(): AccessToken; public function getCache(): CacheInterface; } <|fim_prefix|><?php declare(strict_types=1); namespace EasyWeChat\MiniApp\C...
fim
w7corp/easywechat
php
<?php declare(strict_types=1); namespace EasyWeChat\MiniApp; use EasyWeChat\Kernel\Exceptions\DecryptException; use EasyWeChat\Kernel\Support\AesCbc; use Throwable; use function base64_decode; use function is_array; use function json_decode; use function sprintf; class Decryptor { /** * @return array<stri...
fim
w7corp/easywechat
php
<|fim_prefix|><?php declare(strict_types=1); namespace <|fim_suffix|>ss Server extends \EasyWeChat\OfficialAccount\Server { } <|fim_middle|>EasyWeChat\MiniApp; cla<|endoftext|>
fim
w7corp/easywechat
php
<|fim_suffix|>neNumber error: '.json_encode($response, JSON_UNESCAPED_UNICODE)); } return $response; } } <|fim_prefix|><?php namespace EasyWeChat\MiniApp; use EasyWeChat\Kernel\Exceptions\HttpException; class Utils { public function __construct(protected Application $app) { } /*...
fim
w7corp/easywechat
php
<|fim_suffix|>ponse['access_token'])) { throw new HttpException('Failed to get access_token: '.json_encode($response, JSON_UNESCAPED_UNICODE)); } $this->cache->set($this->getKey(), $response['access_token'], intval($response['expires_in'])); return $response['access_token']; } ...
fim
w7corp/easywechat
php
<|fim_suffix|> } } <|fim_prefix|><?php declare(strict_types=1); namespace EasyWeChat\OfficialAccount; use EasyWeChat\OfficialAccount\Contracts\Account as AccountInterface; use RuntimeException; class<|fim_middle|> Account implements AccountInterface { public function __construct( protected string $appId...
fim
w7corp/easywechat
php
<|fim_prefix|><?php declare(strict_types=1); namespace EasyWeChat\OfficialAccount; use EasyWeChat\Kernel\Contracts\AccessToken as AccessTokenInterface; use EasyWeChat\Kernel\Contracts\JsApiTicket as JsApiTicketInterface; use EasyWeChat\Kernel\Contracts\RefreshableAccessToken as RefreshableAccessTokenInterface; use E...
fim
w7corp/easywechat
php
<|fim_prefix|><?php declare(strict_types=1); name<|fim_suffix|> * @var array<string> */ protected array $requiredKeys = [ 'app_id', ]; } <|fim_middle|>space EasyWeChat\OfficialAccount; class Config extends \EasyWeChat\Kernel\Config { /** <|endoftext|>
fim
w7corp/easywechat
php
<?php declare(strict_types=1); namespace EasyWeChat\OfficialAccount\Contracts; interface Account { public function getAppId(): string; public function getSecret(): string; public function getToken(): ?string; public function getAesKey(): ?string; } <|endoftext|>
fim
w7corp/easywechat
php
<|fim_prefix|><?php declare(strict_types=1); namespace EasyWeChat\OfficialAccount\Contracts; use EasyWeChat\Kernel\Contracts\AccessToken; use EasyWeChat\Kernel\Contracts\Config; use EasyWeChat\Kernel\Contracts\Server; use EasyWeChat\Kernel\Encryptor; use EasyWeChat\Kernel\HttpClient\AccessTokenAwareClient; use Overt...
fim
w7corp/easywechat
php
<?php declare(strict_types=1); namespace EasyWeChat\OfficialAccount; use EasyWeChat\Kernel\Contracts\RefreshableJsApiTicket as RefreshableJsApiTicketInterface; use EasyWeChat\Kernel\Exceptions\HttpException; use JetBrains\PhpStorm\ArrayShape; use function sprintf; class JsApiTicket extends AccessToken implements R...
fim
w7corp/easywechat
php
<|fim_prefix|><?php declare(s<|fim_suffix|>Message extends \EasyWeChat\Kernel\Message { // } <|fim_middle|>trict_types=1); namespace EasyWeChat\OfficialAccount; /** * @property string $Event * @property string $MsgType */ class <|endoftext|>
fim
w7corp/easywechat
php
<|fim_prefix|><?php declare(strict_types=1)<|fim_suffix|>rnel\Traits\InteractWithHandlers; use EasyWeChat\Kernel\Traits\InteractWithServerRequest; use EasyWeChat\Kernel\Traits\RespondXmlMessage; use Nyholm\Psr7\Response; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; use Throwable...
fim
w7corp/easywechat
php
<|fim_prefix|><?php namespace<|fim_suffix|>lic function __construct(protected Application $app) { } /** * @param array<string> $jsApiList * @param array<string> $openTagList * @return array<string, mixed> */ public function buildJsSdkConfig( string $url, array $...
fim
w7corp/easywechat
php
<|fim_suffix|> return $this->token; } public function getAesKey(): string { return $this->aesKey; } } <|fim_prefix|><?php declare(strict_types=1); namespace EasyWeChat\OpenPlatform; use EasyWeChat\OpenPlatform\Contracts\Account as AccountInterface; class Account implements AccountInterf...
fim
w7corp/easywechat
php
<|fim_suffix|> 'json' => [ 'component_appid' => $this->getAccount()->getAppId(), 'authorizer_appid' => $authorizerAppId, 'authorizer_refresh_token' => $authorizerRefreshToken, ], ] )->toArray(false); if (empty($re...
fim
w7corp/easywechat
php
<|fim_suffix|>rizer_appid'] ?? ''; } #[Pure] public function getAccessToken(): AuthorizerAccessToken { return new AuthorizerAccessToken( /** @phpstan-ignore-next-line */ $this->attributes['authorization_info']['authorizer_appid'] ?? '', /** @phpstan-ignore-n...
fim
w7corp/easywechat
php
<|fim_suffix|>eturn $this->appId; } public function getToken(): string { return $this->accessToken; } public function __toString() { return $this->accessToken; } /** * @return array<string, string> */ #[Pure] #[ArrayShape(['access_token' => 'string'])...
fim
w7corp/easywechat
php
<|fim_prefix|><?php declare(strict_types=1); namespace EasyWeChat\OpenPlatform; use EasyWeChat\Kernel\Contracts\RefreshableAccessToken as Refresh<|fim_suffix|>.qq.com/']); $this->cache = $cache ?? new Psr16Cache(new FilesystemAdapter(namespace: 'easywechat', defaultLifetime: 1500)); } public functio...
fim
w7corp/easywechat
php
<|fim_suffix|> 'app_id', 'secret', 'aes_key', ]; } <|fim_prefix|><?php declare(strict_types=1); names<|fim_middle|>pace EasyWeChat\OpenPlatform; class Config extends \EasyWeChat\Kernel\Config { /** * @var array<string> */ protected array $requiredKeys = [ <|endoftext|>
fim
w7corp/easywechat
php
<|fim_suffix|>e Account { public function getAppId(): string; public function getSecret(): string; public function getToken(): string; public function getAesKey(): string; } <|fim_prefix|><?php declare(strict_types=1); namespace E<|fim_middle|>asyWeChat\OpenPlatform\Contracts; interfac<|endoftext|...
fim
w7corp/easywechat
php
<|fim_prefix|><?php declare(strict_types=1); namespace EasyWeChat\OpenPlatform\Contracts; use EasyWeChat\Kernel\Contracts\AccessToken; use EasyWeChat\Kernel\Contracts\Config; use EasyWeChat\Kernel\Contracts\Server; use EasyWeChat\Kernel\Encryptor; use EasyWeChat\Kernel\HttpClient\AccessTokenAwareClient; use EasyWeCh...
fim
w7corp/easywechat
php
<?php declare(strict_types=1); namespace EasyWeChat\OpenPlatform\Contracts; interface VerifyTicket { public function getTicket(): string; public function setTicket(string $ticket): static; } <|endoftext|>
fim
w7corp/easywechat
php
<|fim_suffix|>/ } <|fim_prefix|><?php declare(strict_types=1); namespace EasyWeChat\OpenPlatform; /** * @property string $InfoType <|fim_middle|>* @property string $ComponentVerifyTicket */ class Message extends \EasyWeChat\Kernel\Message { /<|endoftext|>
fim
w7corp/easywechat
php
<?php declare(strict_types=1); namespace EasyWeChat\OpenPlatform; use Closure; use EasyWeChat\Kernel\Contracts\Server as ServerInterface; use EasyWeChat\Kernel\Encryptor; use EasyWeChat\Kernel\ServerResponse; use EasyWeChat\Kernel\Traits\DecryptMessage; use EasyWeChat\Kernel\Traits\InteractWithHandlers; use EasyWeCh...
fim
w7corp/easywechat
php
<|fim_suffix|>ion setTicket(string $ticket): static { $this->cache->set($this->getKey(), $ticket, 6000); return $this; } /** * @throws RuntimeException */ public function getTicket(): string { $ticket = $this->cache->get($this->getKey()); if (! $ticket ||...
fim
w7corp/easywechat
php
<|fim_suffix|>): string { return $this->corpId; } public function getProviderSecret(): string { return $this->providerSecret; } public function getSuiteId(): string { return $this->suiteId; } public function getSuiteSecret(): string { return $th...
fim
w7corp/easywechat
php
<|fim_suffix|>fig->get('oauth.scopes', ['snsapi_base'])); } /** * @return array<string, mixed> */ protected function getHttpClientDefaultOptions(): array { return array_merge( ['base_uri' => 'https://qyapi.weixin.qq.com/'], (array) $this->config->get('http', []...
fim
w7corp/easywechat
php
<|fim_suffix|> } } <|fim_prefix|><?php declare(strict_types=1); namespace EasyWeChat\OpenWork; use ArrayAccess; use EasyWeChat\Kernel\Contracts\Arrayable; use EasyWeChat\Kernel\Contracts\Jsonable; use EasyWeChat\Kernel\Traits\HasAttributes; /** * @implements ArrayAccess<string, mixed> */ class Authorization im...
fim
w7corp/easywechat
php
<|fim_prefix|><?php declare(strict_types=1); namespace EasyWeChat\OpenWork; use EasyWeChat\Kernel\Contracts\Acc<|fim_suffix|>y(): array { return ['access_token' => $this->getToken()]; } public function getKey(): string { return $this->key ?? $this->key = sprintf('open_work.authorizer...
fim
w7corp/easywechat
php
<|fim_suffix|>ted array $requiredKeys = [ 'corp_id', 'suite_id', 'provider_secret', 'suite_secret', 'token', 'aes_key', ]; } <|fim_prefix|><?php declare(strict_types=1); namespace EasyWeChat\OpenWork; class Config extends \EasyW<|fim_middle|>eChat\Kernel\Config { ...
fim
w7corp/easywechat
php
<|fim_suffix|>ken(): string; public function getAesKey(): string; } <|fim_prefix|><?php declare(strict_types=1); namespace EasyWeChat\OpenWork\Contracts; interface Account { public function getCorpId(): string; public function getProviderSecret(): string; public function getSuiteId(): string; ...
fim
w7corp/easywechat
php
<|fim_suffix|>): Encryptor; public function getServer(): Server; public function getRequest(): ServerRequestInterface; public function getClient(): AccessTokenAwareClient; public function getHttpClient(): HttpClientInterface; public function getConfig(): Config; public function getProvider...
fim
w7corp/easywechat
php
<|fim_prefix|><?php declare(strict_types=1); namespace EasyWeChat\OpenWork\Contracts; interface SuiteTicket { public function getTick<|fim_suffix|>ticket): static; } <|fim_middle|>et(): string; public function setTicket(string $<|endoftext|>
fim
w7corp/easywechat
php
<|fim_prefix|><?php namespace EasyWeChat\OpenWork; use JetBrains\PhpStorm\Pure; class Encryptor extends \EasyWeChat\Kernel\Encryptor { #[Pure] public function __cons<|fim_suffix|>t::__construct($corpId, $token, $aesKey, null); } } <|fim_middle|>truct(string $corpId, string $token, string $aesKey) { ...
fim
w7corp/easywechat
php
<|fim_suffix|>); $ticket = $this->cache->get($key); if ($ticket && is_string($ticket)) { return $ticket; } $response = $this->httpClient->request('GET', '/cgi-bin/ticket/get', ['query' => ['type' => 'agent_config']])->toArray(false); if (empty($response['ticket']))...
fim
w7corp/easywechat
php
<|fim_suffix|>ass Message extends \EasyWeChat\Kernel\Message { // } <|fim_prefix|><?php declare(strict_types=1); namespace EasyWeChat\OpenWork; /** * @property string $InfoType * @property string $Chan<|fim_middle|>geType * @property string $SuiteTicket * @property string $SuiteId * @property string $MsgTyp...
fim
w7corp/easywechat
php
<?php declare(strict_types=1); namespace EasyWeChat\OpenWork; use const JSON_UNESCAPED_UNICODE; use EasyWeChat\Kernel\Contracts\RefreshableAccessToken as RefreshableAccessTokenInterface; use EasyWeChat\Kernel\Exceptions\HttpException; use JetBrains\PhpStorm\ArrayShape; use Psr\SimpleCache\CacheInterface; use Symfon...
fim
w7corp/easywechat
php
<|fim_suffix|>ction getDecryptedMessage(?ServerRequestInterface $request = null): \EasyWeChat\Kernel\Message { $request = $request ?? $this->getRequest(); $message = $this->getRequestMessage($request); $query = $request->getQueryParams(); return $this->decryptMessage( me...
fim
w7corp/easywechat
php
<|fim_suffix|> $this->cache->set( $this->getKey(), $response['suite_access_token'], abs(intval($response['expires_in']) - 100) ); return $response['suite_access_token']; } } <|fim_prefix|><?php declare(strict_types=1); namespace EasyWeChat\OpenWork; use const ...
fim
w7corp/easywechat
php
<|fim_prefix|><?php namespace EasyWeChat\OpenWork;<|fim_suffix|>torm\Pure; class SuiteEncryptor extends Encryptor { #[Pure] public function __construct(string $suiteId, string $token, string $aesKey) { parent::__construct($suiteId, $token, $aesKey, null); } } <|fim_middle|> use EasyWeChat\Ker...
fim
w7corp/easywechat
php
<|fim_suffix|>ent\Cache\Adapter\FilesystemAdapter; use Symfony\Component\Cache\Psr16Cache; use function is_string; use function sprintf; class SuiteTicket implements SuiteTicketInterface { protected CacheInterface $cache; public function __construct( protected string $suiteId, ?CacheInterface...
fim
w7corp/easywechat
php