Compare commits

..

21 Commits

Author SHA1 Message Date
李东云
4d8a918898 chore(release): 1.0.0-beta.0 2023-12-15 08:00:49 +00:00
李东云
cfbb770559 build(release): 将版本号改为 beta
Signed-off-by: 李东云 <dongyu.li@luxcreo.ai>
2023-12-15 16:00:08 +08:00
李东云
01aa833537 fix(bin): 更新了迁移脚本的目录
Signed-off-by: 李东云 <dongyu.li@luxcreo.ai>
2023-12-15 15:58:23 +08:00
李东云
c02a08ca6b chore(release): 1.0.0-alpha.19 2023-12-15 07:13:15 +00:00
李东云
a84b812dd0 feat(bin): 增加了迁移到最新版本的脚本
Signed-off-by: 李东云 <dongyu.li@luxcreo.ai>
2023-12-15 15:13:07 +08:00
李东云
6eacde9970 chore(release): 1.0.0-alpha.18 2023-12-14 08:29:17 +00:00
李东云
7d6dc7fe9f feat(bin): 增加了迁移到最新版本的脚本
Signed-off-by: 李东云 <dongyu.li@luxcreo.ai>
2023-12-14 16:28:59 +08:00
李东云
97131d224c refactor: 迁移到 hyperf3.1 的写法
Signed-off-by: 李东云 <dongyu.li@luxcreo.ai>
2023-12-14 16:03:23 +08:00
李东云
08d00a785f build(composer): 清理 composer 配置
移除了多余的 composer 包仓库

Signed-off-by: 李东云 <dongyu.li@luxcreo.ai>
2023-12-14 15:48:30 +08:00
李东云
16f69c193c chore(release): 1.0.0-alpha.17 2023-12-14 07:38:35 +00:00
李东云
b89b218eaa build(composer): 更新依赖,增加 php8.2/8.3的 polyfill
Signed-off-by: 李东云 <dongyu.li@luxcreo.ai>
2023-12-14 15:38:14 +08:00
李东云
14d28deee2 fix(CoreMiddleware): 修复参数类型过少的问题
Signed-off-by: 李东云 <dongyu.li@luxcreo.ai>
2023-12-14 15:24:22 +08:00
李东云
cbc59ccf74 build(ide): 增加了docker 映射
Signed-off-by: 李东云 <dongyu.li@luxcreo.ai>
2023-12-14 15:23:46 +08:00
李东云
f34b2c9e21 chore(release): 1.0.0-alpha.16 2023-12-04 09:13:05 +00:00
李东云
eee68cab8a refactor: 迁移到 hyperf3.1和 pestphp2
Signed-off-by: 李东云 <dongyu.li@luxcreo.ai>
2023-12-04 17:12:12 +08:00
李东云
c93ed73f10 chore(release): 1.0.0-alpha.15 2023-10-30 06:30:51 +00:00
李东云
97848a5e22 test(utils): 增加了无极分类的测试用例
Signed-off-by: 李东云 <dongyu.li@luxcreo.ai>
2023-10-30 14:30:31 +08:00
李东云
b7d0dd87c5 test(request): 修复了无法使用的测试用例
Signed-off-by: 李东云 <dongyu.li@luxcreo.ai>
2023-10-30 14:30:13 +08:00
李东云
26b55f1ca5 build(composer): 更新依赖
Signed-off-by: 李东云 <dongyu.li@luxcreo.ai>
2023-10-29 23:45:37 +08:00
李东云
6ca5462195 chore(release): 1.0.0-alpha.14 2023-10-23 12:48:06 +00:00
李东云
8e4f4d0d29 ci(GiteaActions): 修复没有内容的问题
Signed-off-by: 李东云 <dongyu.li@luxcreo.ai>
2023-10-23 20:47:45 +08:00
32 changed files with 3928 additions and 1729 deletions

View File

@@ -1,25 +0,0 @@
name: Release to registry
on: [ release ]
jobs:
Publish on Released:
runs-on: ubuntu-latest
steps:
- run: echo "🔎 The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}."
- name: Check out repository code
uses: actions/checkout@v4
- run: echo "💡 The ${{ gitea.repository }} repository has been cloned to the runner."
- name: List files in the repository
run: |
ls ${{ gitea.workspace }}
- name: Zip files in the repository
run: |
apt-get update
apt-get install zip
zip hdk-core.dist.zip *
- name: Publish to registry
run: |
curl --user ch4o5:4fd300672472e666014314c1c94c604c634165a9 \
--upload-file ./hdk-core.dist.zip \
https://nest.doylee.cn/api/packages/HDK/composer?version=${{ gitea.ref_name }}
- run: echo "🍏 This job's status is ${{ job.status }}."

View File

@@ -19,7 +19,7 @@ jobs:
run: |
apt-get update
apt-get install zip
zip hdk-core.dist.zip *
zip -r hdk-core.dist.zip *
- name: Publish to registry
run: |
curl --user ch4o5:4fd300672472e666014314c1c94c604c634165a9 \

292
.idea/HDK-Core.iml generated
View File

@@ -4,161 +4,179 @@
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" packagePrefix="Singularity\HDK\Core\" />
<sourceFolder url="file://$MODULE_DIR$/tests" isTestSource="true" packagePrefix="Singularity\HDK\Test\Core\" />
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/recursion-context" />
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/lines-of-code" />
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/type" />
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/version" />
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/cli-parser" />
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/code-unit" />
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/environment" />
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/exporter" />
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/resource-operations" />
<excludeFolder url="file://$MODULE_DIR$/vendor/guzzlehttp/promises" />
<excludeFolder url="file://$MODULE_DIR$/vendor/guzzlehttp/psr7" />
<excludeFolder url="file://$MODULE_DIR$/vendor/guzzlehttp/guzzle" />
<excludeFolder url="file://$MODULE_DIR$/vendor/alibabacloud/tea-xml" />
<excludeFolder url="file://$MODULE_DIR$/runtime" />
<excludeFolder url="file://$MODULE_DIR$/vendor/adbario/php-dot-notation" />
<excludeFolder url="file://$MODULE_DIR$/vendor/alibabacloud/credentials" />
<excludeFolder url="file://$MODULE_DIR$/vendor/alibabacloud/darabonba-openapi" />
<excludeFolder url="file://$MODULE_DIR$/vendor/alibabacloud/dysmsapi-20170525" />
<excludeFolder url="file://$MODULE_DIR$/vendor/alibabacloud/endpoint-util" />
<excludeFolder url="file://$MODULE_DIR$/vendor/alibabacloud/gateway-spi" />
<excludeFolder url="file://$MODULE_DIR$/vendor/alibabacloud/openapi-util" />
<excludeFolder url="file://$MODULE_DIR$/vendor/alibabacloud/tea" />
<excludeFolder url="file://$MODULE_DIR$/vendor/alibabacloud/tea-utils" />
<excludeFolder url="file://$MODULE_DIR$/vendor/alibabacloud/gateway-spi" />
<excludeFolder url="file://$MODULE_DIR$/vendor/alibabacloud/endpoint-util" />
<excludeFolder url="file://$MODULE_DIR$/vendor/alibabacloud/dysmsapi-20170525" />
<excludeFolder url="file://$MODULE_DIR$/vendor/alibabacloud/credentials" />
<excludeFolder url="file://$MODULE_DIR$/vendor/justinrainbow/json-schema" />
<excludeFolder url="file://$MODULE_DIR$/vendor/graham-campbell/result-type" />
<excludeFolder url="file://$MODULE_DIR$/vendor/alibabacloud/tea-xml" />
<excludeFolder url="file://$MODULE_DIR$/vendor/composer" />
<excludeFolder url="file://$MODULE_DIR$/vendor/fig/http-message-util" />
<excludeFolder url="file://$MODULE_DIR$/vendor/lmc/http-constants" />
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/http-server-handler" />
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/event-dispatcher" />
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/http-server-middleware" />
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/http-message" />
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/container" />
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/http-client" />
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/log" />
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/http-factory" />
<excludeFolder url="file://$MODULE_DIR$/vendor/seld/phar-utils" />
<excludeFolder url="file://$MODULE_DIR$/vendor/seld/jsonlint" />
<excludeFolder url="file://$MODULE_DIR$/vendor/seld/signal-handler" />
<excludeFolder url="file://$MODULE_DIR$/vendor/nikic/php-parser" />
<excludeFolder url="file://$MODULE_DIR$/vendor/nikic/fast-route" />
<excludeFolder url="file://$MODULE_DIR$/vendor/react/promise" />
<excludeFolder url="file://$MODULE_DIR$/vendor/roave/dont" />
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/database" />
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/contract" />
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/di" />
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/context" />
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/logger" />
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/http-server" />
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/translation" />
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/framework" />
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/config" />
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/redis" />
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/constants" />
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/dispatcher" />
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/server" />
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/utils" />
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/http-message" />
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/exception-handler" />
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/macroable" />
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/pool" />
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/event" />
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/validation" />
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/session" />
<excludeFolder url="file://$MODULE_DIR$/vendor/nesbot/carbon" />
<excludeFolder url="file://$MODULE_DIR$/vendor/php-di/phpdoc-reader" />
<excludeFolder url="file://$MODULE_DIR$/vendor/teapot/status-code" />
<excludeFolder url="file://$MODULE_DIR$/vendor/vlucas/phpdotenv" />
<excludeFolder url="file://$MODULE_DIR$/vendor/adbario/php-dot-notation" />
<excludeFolder url="file://$MODULE_DIR$/vendor/egulias/email-validator" />
<excludeFolder url="file://$MODULE_DIR$/vendor/laminas/laminas-mime" />
<excludeFolder url="file://$MODULE_DIR$/vendor/laminas/laminas-stdlib" />
<excludeFolder url="file://$MODULE_DIR$/vendor/monolog/monolog" />
<excludeFolder url="file://$MODULE_DIR$/vendor/myclabs/php-enum" />
<excludeFolder url="file://$MODULE_DIR$/vendor/myclabs/deep-copy" />
<excludeFolder url="file://$MODULE_DIR$/vendor/phar-io/manifest" />
<excludeFolder url="file://$MODULE_DIR$/vendor/phar-io/version" />
<excludeFolder url="file://$MODULE_DIR$/vendor/phpunit/php-timer" />
<excludeFolder url="file://$MODULE_DIR$/vendor/phpunit/php-text-template" />
<excludeFolder url="file://$MODULE_DIR$/vendor/phpunit/php-code-coverage" />
<excludeFolder url="file://$MODULE_DIR$/vendor/phpunit/php-invoker" />
<excludeFolder url="file://$MODULE_DIR$/vendor/phpunit/php-file-iterator" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-php73" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-php80" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-ctype" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-php81" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-php72" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/translation" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/translation-contracts" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/event-dispatcher" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/mailer" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/filesystem" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-intl-idn" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-intl-normalizer" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/event-dispatcher-contracts" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/finder" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/mime" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/string" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/deprecation-contracts" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/service-contracts" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/process" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/console" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-mbstring" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-intl-grapheme" />
<excludeFolder url="file://$MODULE_DIR$/vendor/theseer/tokenizer" />
<excludeFolder url="file://$MODULE_DIR$/vendor/doctrine/lexer" />
<excludeFolder url="file://$MODULE_DIR$/vendor/doctrine/deprecations" />
<excludeFolder url="file://$MODULE_DIR$/vendor/doctrine/inflector" />
<excludeFolder url="file://$MODULE_DIR$/vendor/doctrine/instantiator" />
<excludeFolder url="file://$MODULE_DIR$/vendor/doctrine/lexer" />
<excludeFolder url="file://$MODULE_DIR$/vendor/egulias/email-validator" />
<excludeFolder url="file://$MODULE_DIR$/vendor/ergebnis/http-method" />
<excludeFolder url="file://$MODULE_DIR$/vendor/firebase/php-jwt" />
<excludeFolder url="file://$MODULE_DIR$/vendor/jetbrains/phpstorm-attributes" />
<excludeFolder url="file://$MODULE_DIR$/vendor/lizhichao/one-sm" />
<excludeFolder url="file://$MODULE_DIR$/vendor/phpoption/phpoption" />
<excludeFolder url="file://$MODULE_DIR$/vendor/ralouphie/getallheaders" />
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/comparator" />
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/global-state" />
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/object-enumerator" />
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/object-reflector" />
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/complexity" />
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/code-unit-reverse-lookup" />
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/diff" />
<excludeFolder url="file://$MODULE_DIR$/vendor/swoole/ide-helper" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/options-resolver" />
<excludeFolder url="file://$MODULE_DIR$/vendor/nunomaduro/collision" />
<excludeFolder url="file://$MODULE_DIR$/vendor/pestphp/pest" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/stopwatch" />
<excludeFolder url="file://$MODULE_DIR$/vendor/phpstan/phpstan" />
<excludeFolder url="file://$MODULE_DIR$/vendor/pestphp/pest-plugin" />
<excludeFolder url="file://$MODULE_DIR$/vendor/friendsofphp/php-cs-fixer" />
<excludeFolder url="file://$MODULE_DIR$/vendor/fig/http-message-util" />
<excludeFolder url="file://$MODULE_DIR$/vendor/filp/whoops" />
<excludeFolder url="file://$MODULE_DIR$/vendor/doctrine/deprecations" />
<excludeFolder url="file://$MODULE_DIR$/vendor/phpunit/phpunit" />
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/engine" />
<excludeFolder url="file://$MODULE_DIR$/vendor/spatie/pest-plugin-test-time" />
<excludeFolder url="file://$MODULE_DIR$/vendor/spatie/test-time" />
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/coordinator" />
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/engine-contract" />
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/resource" />
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/paginator" />
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/guzzle" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/http-foundation" />
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/collection" />
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/db" />
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/pipeline" />
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/tappable" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/serializer" />
<excludeFolder url="file://$MODULE_DIR$/vendor/firebase/php-jwt" />
<excludeFolder url="file://$MODULE_DIR$/vendor/friendsofphp/php-cs-fixer" />
<excludeFolder url="file://$MODULE_DIR$/vendor/graham-campbell/result-type" />
<excludeFolder url="file://$MODULE_DIR$/vendor/guzzlehttp/guzzle" />
<excludeFolder url="file://$MODULE_DIR$/vendor/guzzlehttp/promises" />
<excludeFolder url="file://$MODULE_DIR$/vendor/guzzlehttp/psr7" />
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/code-parser" />
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/codec" />
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/collection" />
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/conditionable" />
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/config" />
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/constants" />
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/context" />
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/contract" />
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/coordinator" />
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/coroutine" />
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/crontab" />
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/database" />
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/db" />
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/di" />
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/dispatcher" />
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/engine" />
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/engine-contract" />
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/event" />
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/exception-handler" />
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/framework" />
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/guzzle" />
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/http-message" />
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/http-server" />
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/logger" />
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/macroable" />
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/paginator" />
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/pipeline" />
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/pool" />
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/redis" />
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/resource" />
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/serializer" />
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/server" />
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/session" />
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/stringable" />
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/support" />
<excludeFolder url="file://$MODULE_DIR$/vendor/cooper/hyperf-pest" />
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/tappable" />
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/translation" />
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/utils" />
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/validation" />
<excludeFolder url="file://$MODULE_DIR$/vendor/jetbrains/phpstorm-attributes" />
<excludeFolder url="file://$MODULE_DIR$/vendor/justinrainbow/json-schema" />
<excludeFolder url="file://$MODULE_DIR$/vendor/laminas/laminas-mime" />
<excludeFolder url="file://$MODULE_DIR$/vendor/laminas/laminas-stdlib" />
<excludeFolder url="file://$MODULE_DIR$/vendor/lizhichao/one-sm" />
<excludeFolder url="file://$MODULE_DIR$/vendor/lmc/http-constants" />
<excludeFolder url="file://$MODULE_DIR$/vendor/monolog/monolog" />
<excludeFolder url="file://$MODULE_DIR$/vendor/myclabs/deep-copy" />
<excludeFolder url="file://$MODULE_DIR$/vendor/myclabs/php-enum" />
<excludeFolder url="file://$MODULE_DIR$/vendor/nesbot/carbon" />
<excludeFolder url="file://$MODULE_DIR$/vendor/nikic/fast-route" />
<excludeFolder url="file://$MODULE_DIR$/vendor/nikic/php-parser" />
<excludeFolder url="file://$MODULE_DIR$/vendor/nunomaduro/collision" />
<excludeFolder url="file://$MODULE_DIR$/vendor/pestphp/pest" />
<excludeFolder url="file://$MODULE_DIR$/vendor/pestphp/pest-plugin" />
<excludeFolder url="file://$MODULE_DIR$/vendor/phar-io/manifest" />
<excludeFolder url="file://$MODULE_DIR$/vendor/phar-io/version" />
<excludeFolder url="file://$MODULE_DIR$/vendor/php-di/phpdoc-reader" />
<excludeFolder url="file://$MODULE_DIR$/vendor/phpoption/phpoption" />
<excludeFolder url="file://$MODULE_DIR$/vendor/phpstan/phpstan" />
<excludeFolder url="file://$MODULE_DIR$/vendor/phpunit/php-code-coverage" />
<excludeFolder url="file://$MODULE_DIR$/vendor/phpunit/php-file-iterator" />
<excludeFolder url="file://$MODULE_DIR$/vendor/phpunit/php-invoker" />
<excludeFolder url="file://$MODULE_DIR$/vendor/phpunit/php-text-template" />
<excludeFolder url="file://$MODULE_DIR$/vendor/phpunit/php-timer" />
<excludeFolder url="file://$MODULE_DIR$/vendor/phpunit/phpunit" />
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/clock" />
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/container" />
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/event-dispatcher" />
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/http-client" />
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/http-factory" />
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/http-message" />
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/http-server-handler" />
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/http-server-middleware" />
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/log" />
<excludeFolder url="file://$MODULE_DIR$/vendor/ralouphie/getallheaders" />
<excludeFolder url="file://$MODULE_DIR$/vendor/react/promise" />
<excludeFolder url="file://$MODULE_DIR$/vendor/roave/dont" />
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/cli-parser" />
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/code-unit" />
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/code-unit-reverse-lookup" />
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/comparator" />
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/complexity" />
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/diff" />
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/environment" />
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/exporter" />
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/global-state" />
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/lines-of-code" />
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/object-enumerator" />
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/object-reflector" />
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/recursion-context" />
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/type" />
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/version" />
<excludeFolder url="file://$MODULE_DIR$/vendor/seld/jsonlint" />
<excludeFolder url="file://$MODULE_DIR$/vendor/seld/phar-utils" />
<excludeFolder url="file://$MODULE_DIR$/vendor/seld/signal-handler" />
<excludeFolder url="file://$MODULE_DIR$/vendor/spatie/pest-plugin-test-time" />
<excludeFolder url="file://$MODULE_DIR$/vendor/spatie/test-time" />
<excludeFolder url="file://$MODULE_DIR$/vendor/swoole/ide-helper" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/console" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/deprecation-contracts" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/event-dispatcher" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/event-dispatcher-contracts" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/filesystem" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/finder" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/http-foundation" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/mailer" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/mime" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/options-resolver" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-ctype" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-intl-grapheme" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-intl-idn" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-intl-normalizer" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-mbstring" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-php72" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-php73" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-php80" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-php81" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-php83" />
<excludeFolder url="file://$MODULE_DIR$/runtime" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/process" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/serializer" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/service-contracts" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/stopwatch" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/string" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/translation" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/translation-contracts" />
<excludeFolder url="file://$MODULE_DIR$/vendor/teapot/status-code" />
<excludeFolder url="file://$MODULE_DIR$/vendor/theseer/tokenizer" />
<excludeFolder url="file://$MODULE_DIR$/vendor/vlucas/phpdotenv" />
<excludeFolder url="file://$MODULE_DIR$/vendor/brianium/paratest" />
<excludeFolder url="file://$MODULE_DIR$/vendor/fidry/cpu-core-counter" />
<excludeFolder url="file://$MODULE_DIR$/vendor/friendsofhyperf/pest-plugin-hyperf" />
<excludeFolder url="file://$MODULE_DIR$/vendor/friendsofhyperf/rector" />
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/stdlib" />
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/testing" />
<excludeFolder url="file://$MODULE_DIR$/vendor/jean85/pretty-package-versions" />
<excludeFolder url="file://$MODULE_DIR$/vendor/nunomaduro/termwind" />
<excludeFolder url="file://$MODULE_DIR$/vendor/pestphp/pest-plugin-arch" />
<excludeFolder url="file://$MODULE_DIR$/vendor/phpdocumentor/reflection-common" />
<excludeFolder url="file://$MODULE_DIR$/vendor/phpdocumentor/reflection-docblock" />
<excludeFolder url="file://$MODULE_DIR$/vendor/phpdocumentor/type-resolver" />
<excludeFolder url="file://$MODULE_DIR$/vendor/phpstan/phpdoc-parser" />
<excludeFolder url="file://$MODULE_DIR$/vendor/rector/rector" />
<excludeFolder url="file://$MODULE_DIR$/vendor/swow/psr7-plus" />
<excludeFolder url="file://$MODULE_DIR$/vendor/ta-tikoma/phpunit-architecture-test" />
<excludeFolder url="file://$MODULE_DIR$/vendor/webmozart/assert" />
<excludeFolder url="file://$MODULE_DIR$/vendor/carbonphp/carbon-doctrine-types" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-php82" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />

24
.idea/php-docker-settings.xml generated Normal file
View File

@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="PhpDockerContainerSettings">
<list>
<map>
<entry key="9fb85f67-19fd-423f-9358-1b155a12eb7d">
<value>
<DockerContainerSettings>
<option name="version" value="1" />
<option name="volumeBindings">
<list>
<DockerVolumeBindingImpl>
<option name="containerPath" value="/srv/www" />
<option name="hostPath" value="$PROJECT_DIR$" />
</DockerVolumeBindingImpl>
</list>
</option>
</DockerContainerSettings>
</value>
</entry>
</map>
</list>
</component>
</project>

198
.idea/php.xml generated
View File

@@ -20,29 +20,99 @@
</component>
<component name="PhpIncludePathManager">
<include_path>
<path value="$PROJECT_DIR$/vendor/hyperf/pool" />
<path value="$PROJECT_DIR$/vendor/doctrine/inflector" />
<path value="$PROJECT_DIR$/vendor/hyperf/event" />
<path value="$PROJECT_DIR$/vendor/doctrine/instantiator" />
<path value="$PROJECT_DIR$/vendor/hyperf/validation" />
<path value="$PROJECT_DIR$/vendor/doctrine/deprecations" />
<path value="$PROJECT_DIR$/vendor/hyperf/guzzle" />
<path value="$PROJECT_DIR$/vendor/ergebnis/http-method" />
<path value="$PROJECT_DIR$/vendor/hyperf/session" />
<path value="$PROJECT_DIR$/vendor/firebase/php-jwt" />
<path value="$PROJECT_DIR$/vendor/nesbot/carbon" />
<path value="$PROJECT_DIR$/vendor/jetbrains/phpstorm-attributes" />
<path value="$PROJECT_DIR$/vendor/php-di/phpdoc-reader" />
<path value="$PROJECT_DIR$/vendor/lizhichao/one-sm" />
<path value="$PROJECT_DIR$/vendor/phpoption/phpoption" />
<path value="$PROJECT_DIR$/vendor/ralouphie/getallheaders" />
<path value="$PROJECT_DIR$/vendor/swoole/ide-helper" />
<path value="$PROJECT_DIR$/vendor/sebastian/comparator" />
<path value="$PROJECT_DIR$/vendor/teapot/status-code" />
<path value="$PROJECT_DIR$/vendor/sebastian/global-state" />
<path value="$PROJECT_DIR$/vendor/vlucas/phpdotenv" />
<path value="$PROJECT_DIR$/vendor/sebastian/object-enumerator" />
<path value="$PROJECT_DIR$/vendor/adbario/php-dot-notation" />
<path value="$PROJECT_DIR$/vendor/sebastian/object-reflector" />
<path value="$PROJECT_DIR$/vendor/egulias/email-validator" />
<path value="$PROJECT_DIR$/vendor/sebastian/complexity" />
<path value="$PROJECT_DIR$/vendor/laminas/laminas-mime" />
<path value="$PROJECT_DIR$/vendor/sebastian/code-unit-reverse-lookup" />
<path value="$PROJECT_DIR$/vendor/laminas/laminas-stdlib" />
<path value="$PROJECT_DIR$/vendor/sebastian/diff" />
<path value="$PROJECT_DIR$/vendor/monolog/monolog" />
<path value="$PROJECT_DIR$/vendor/sebastian/recursion-context" />
<path value="$PROJECT_DIR$/vendor/myclabs/php-enum" />
<path value="$PROJECT_DIR$/vendor/sebastian/lines-of-code" />
<path value="$PROJECT_DIR$/vendor/myclabs/deep-copy" />
<path value="$PROJECT_DIR$/vendor/sebastian/type" />
<path value="$PROJECT_DIR$/vendor/sebastian/version" />
<path value="$PROJECT_DIR$/vendor/sebastian/cli-parser" />
<path value="$PROJECT_DIR$/vendor/phar-io/manifest" />
<path value="$PROJECT_DIR$/vendor/sebastian/code-unit" />
<path value="$PROJECT_DIR$/vendor/phar-io/version" />
<path value="$PROJECT_DIR$/vendor/sebastian/environment" />
<path value="$PROJECT_DIR$/vendor/phpstan/phpstan" />
<path value="$PROJECT_DIR$/vendor/sebastian/exporter" />
<path value="$PROJECT_DIR$/vendor/sebastian/resource-operations" />
<path value="$PROJECT_DIR$/vendor/phpunit/php-timer" />
<path value="$PROJECT_DIR$/vendor/phpunit/phpunit" />
<path value="$PROJECT_DIR$/vendor/guzzlehttp/promises" />
<path value="$PROJECT_DIR$/vendor/phpunit/php-text-template" />
<path value="$PROJECT_DIR$/vendor/guzzlehttp/psr7" />
<path value="$PROJECT_DIR$/vendor/phpunit/php-code-coverage" />
<path value="$PROJECT_DIR$/vendor/guzzlehttp/guzzle" />
<path value="$PROJECT_DIR$/vendor/phpunit/php-invoker" />
<path value="$PROJECT_DIR$/vendor/phpunit/php-file-iterator" />
<path value="$PROJECT_DIR$/vendor/alibabacloud/tea-xml" />
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-php73" />
<path value="$PROJECT_DIR$/vendor/alibabacloud/darabonba-openapi" />
<path value="$PROJECT_DIR$/vendor/symfony/serializer" />
<path value="$PROJECT_DIR$/vendor/alibabacloud/openapi-util" />
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-php80" />
<path value="$PROJECT_DIR$/vendor/alibabacloud/tea" />
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-ctype" />
<path value="$PROJECT_DIR$/vendor/alibabacloud/tea-utils" />
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-php81" />
<path value="$PROJECT_DIR$/vendor/alibabacloud/gateway-spi" />
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-php72" />
<path value="$PROJECT_DIR$/vendor/alibabacloud/endpoint-util" />
<path value="$PROJECT_DIR$/vendor/symfony/translation" />
<path value="$PROJECT_DIR$/vendor/alibabacloud/dysmsapi-20170525" />
<path value="$PROJECT_DIR$/vendor/symfony/translation-contracts" />
<path value="$PROJECT_DIR$/vendor/alibabacloud/credentials" />
<path value="$PROJECT_DIR$/vendor/symfony/event-dispatcher" />
<path value="$PROJECT_DIR$/vendor/friendsofphp/php-cs-fixer" />
<path value="$PROJECT_DIR$/vendor/symfony/mailer" />
<path value="$PROJECT_DIR$/vendor/justinrainbow/json-schema" />
<path value="$PROJECT_DIR$/vendor/symfony/filesystem" />
<path value="$PROJECT_DIR$/vendor/graham-campbell/result-type" />
<path value="$PROJECT_DIR$/vendor/symfony/options-resolver" />
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-intl-idn" />
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-intl-normalizer" />
<path value="$PROJECT_DIR$/vendor/symfony/event-dispatcher-contracts" />
<path value="$PROJECT_DIR$/vendor/symfony/finder" />
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-php83" />
<path value="$PROJECT_DIR$/vendor/symfony/stopwatch" />
<path value="$PROJECT_DIR$/vendor/symfony/mime" />
<path value="$PROJECT_DIR$/vendor/symfony/string" />
<path value="$PROJECT_DIR$/vendor/symfony/deprecation-contracts" />
<path value="$PROJECT_DIR$/vendor/symfony/service-contracts" />
<path value="$PROJECT_DIR$/vendor/symfony/http-foundation" />
<path value="$PROJECT_DIR$/vendor/symfony/process" />
<path value="$PROJECT_DIR$/vendor/symfony/console" />
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-mbstring" />
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-intl-grapheme" />
<path value="$PROJECT_DIR$/vendor/theseer/tokenizer" />
<path value="$PROJECT_DIR$/vendor/composer" />
<path value="$PROJECT_DIR$/vendor/fig/http-message-util" />
<path value="$PROJECT_DIR$/vendor/lmc/http-constants" />
@@ -53,6 +123,7 @@
<path value="$PROJECT_DIR$/vendor/psr/container" />
<path value="$PROJECT_DIR$/vendor/psr/http-client" />
<path value="$PROJECT_DIR$/vendor/psr/log" />
<path value="$PROJECT_DIR$/vendor/psr/clock" />
<path value="$PROJECT_DIR$/vendor/psr/http-factory" />
<path value="$PROJECT_DIR$/vendor/seld/phar-utils" />
<path value="$PROJECT_DIR$/vendor/seld/jsonlint" />
@@ -62,120 +133,65 @@
<path value="$PROJECT_DIR$/vendor/react/promise" />
<path value="$PROJECT_DIR$/vendor/roave/dont" />
<path value="$PROJECT_DIR$/vendor/hyperf/database" />
<path value="$PROJECT_DIR$/vendor/hyperf/pipeline" />
<path value="$PROJECT_DIR$/vendor/hyperf/contract" />
<path value="$PROJECT_DIR$/vendor/hyperf/collection" />
<path value="$PROJECT_DIR$/vendor/hyperf/coordinator" />
<path value="$PROJECT_DIR$/vendor/hyperf/serializer" />
<path value="$PROJECT_DIR$/vendor/hyperf/di" />
<path value="$PROJECT_DIR$/vendor/hyperf/context" />
<path value="$PROJECT_DIR$/vendor/hyperf/logger" />
<path value="$PROJECT_DIR$/vendor/hyperf/tappable" />
<path value="$PROJECT_DIR$/vendor/hyperf/http-server" />
<path value="$PROJECT_DIR$/vendor/hyperf/coroutine" />
<path value="$PROJECT_DIR$/vendor/hyperf/translation" />
<path value="$PROJECT_DIR$/vendor/hyperf/framework" />
<path value="$PROJECT_DIR$/vendor/hyperf/config" />
<path value="$PROJECT_DIR$/vendor/hyperf/redis" />
<path value="$PROJECT_DIR$/vendor/hyperf/constants" />
<path value="$PROJECT_DIR$/vendor/hyperf/codec" />
<path value="$PROJECT_DIR$/vendor/hyperf/crontab" />
<path value="$PROJECT_DIR$/vendor/hyperf/dispatcher" />
<path value="$PROJECT_DIR$/vendor/hyperf/server" />
<path value="$PROJECT_DIR$/vendor/hyperf/utils" />
<path value="$PROJECT_DIR$/vendor/hyperf/http-message" />
<path value="$PROJECT_DIR$/vendor/hyperf/exception-handler" />
<path value="$PROJECT_DIR$/vendor/hyperf/code-parser" />
<path value="$PROJECT_DIR$/vendor/hyperf/conditionable" />
<path value="$PROJECT_DIR$/vendor/hyperf/engine-contract" />
<path value="$PROJECT_DIR$/vendor/hyperf/support" />
<path value="$PROJECT_DIR$/vendor/hyperf/macroable" />
<path value="$PROJECT_DIR$/vendor/hyperf/db" />
<path value="$PROJECT_DIR$/vendor/hyperf/resource" />
<path value="$PROJECT_DIR$/vendor/hyperf/paginator" />
<path value="$PROJECT_DIR$/vendor/hyperf/engine" />
<path value="$PROJECT_DIR$/vendor/hyperf/pool" />
<path value="$PROJECT_DIR$/vendor/hyperf/event" />
<path value="$PROJECT_DIR$/vendor/hyperf/validation" />
<path value="$PROJECT_DIR$/vendor/hyperf/session" />
<path value="$PROJECT_DIR$/vendor/nesbot/carbon" />
<path value="$PROJECT_DIR$/vendor/php-di/phpdoc-reader" />
<path value="$PROJECT_DIR$/vendor/teapot/status-code" />
<path value="$PROJECT_DIR$/vendor/vlucas/phpdotenv" />
<path value="$PROJECT_DIR$/vendor/adbario/php-dot-notation" />
<path value="$PROJECT_DIR$/vendor/egulias/email-validator" />
<path value="$PROJECT_DIR$/vendor/laminas/laminas-mime" />
<path value="$PROJECT_DIR$/vendor/laminas/laminas-stdlib" />
<path value="$PROJECT_DIR$/vendor/monolog/monolog" />
<path value="$PROJECT_DIR$/vendor/myclabs/php-enum" />
<path value="$PROJECT_DIR$/vendor/myclabs/deep-copy" />
<path value="$PROJECT_DIR$/vendor/phar-io/manifest" />
<path value="$PROJECT_DIR$/vendor/phar-io/version" />
<path value="$PROJECT_DIR$/vendor/phpunit/php-timer" />
<path value="$PROJECT_DIR$/vendor/phpunit/phpunit" />
<path value="$PROJECT_DIR$/vendor/phpunit/php-text-template" />
<path value="$PROJECT_DIR$/vendor/phpunit/php-code-coverage" />
<path value="$PROJECT_DIR$/vendor/phpunit/php-invoker" />
<path value="$PROJECT_DIR$/vendor/phpunit/php-file-iterator" />
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-php73" />
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-php80" />
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-ctype" />
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-php81" />
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-php72" />
<path value="$PROJECT_DIR$/vendor/symfony/translation" />
<path value="$PROJECT_DIR$/vendor/symfony/translation-contracts" />
<path value="$PROJECT_DIR$/vendor/symfony/event-dispatcher" />
<path value="$PROJECT_DIR$/vendor/symfony/mailer" />
<path value="$PROJECT_DIR$/vendor/symfony/filesystem" />
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-intl-idn" />
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-intl-normalizer" />
<path value="$PROJECT_DIR$/vendor/symfony/event-dispatcher-contracts" />
<path value="$PROJECT_DIR$/vendor/symfony/finder" />
<path value="$PROJECT_DIR$/vendor/symfony/mime" />
<path value="$PROJECT_DIR$/vendor/symfony/string" />
<path value="$PROJECT_DIR$/vendor/symfony/deprecation-contracts" />
<path value="$PROJECT_DIR$/vendor/symfony/service-contracts" />
<path value="$PROJECT_DIR$/vendor/symfony/process" />
<path value="$PROJECT_DIR$/vendor/symfony/console" />
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-mbstring" />
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-intl-grapheme" />
<path value="$PROJECT_DIR$/vendor/theseer/tokenizer" />
<path value="$PROJECT_DIR$/vendor/hyperf/stringable" />
<path value="$PROJECT_DIR$/vendor/doctrine/lexer" />
<path value="$PROJECT_DIR$/vendor/doctrine/inflector" />
<path value="$PROJECT_DIR$/vendor/doctrine/instantiator" />
<path value="$PROJECT_DIR$/vendor/ergebnis/http-method" />
<path value="$PROJECT_DIR$/vendor/firebase/php-jwt" />
<path value="$PROJECT_DIR$/vendor/jetbrains/phpstorm-attributes" />
<path value="$PROJECT_DIR$/vendor/lizhichao/one-sm" />
<path value="$PROJECT_DIR$/vendor/phpoption/phpoption" />
<path value="$PROJECT_DIR$/vendor/sebastian/comparator" />
<path value="$PROJECT_DIR$/vendor/sebastian/global-state" />
<path value="$PROJECT_DIR$/vendor/sebastian/object-enumerator" />
<path value="$PROJECT_DIR$/vendor/sebastian/object-reflector" />
<path value="$PROJECT_DIR$/vendor/sebastian/complexity" />
<path value="$PROJECT_DIR$/vendor/sebastian/code-unit-reverse-lookup" />
<path value="$PROJECT_DIR$/vendor/sebastian/diff" />
<path value="$PROJECT_DIR$/vendor/swoole/ide-helper" />
<path value="$PROJECT_DIR$/vendor/pestphp/pest" />
<path value="$PROJECT_DIR$/vendor/swow/psr7-plus" />
<path value="$PROJECT_DIR$/vendor/hyperf/stdlib" />
<path value="$PROJECT_DIR$/vendor/hyperf/testing" />
<path value="$PROJECT_DIR$/vendor/pestphp/pest-plugin" />
<path value="$PROJECT_DIR$/vendor/filp/whoops" />
<path value="$PROJECT_DIR$/vendor/pestphp/pest" />
<path value="$PROJECT_DIR$/vendor/pestphp/pest-plugin-arch" />
<path value="$PROJECT_DIR$/vendor/phpstan/phpdoc-parser" />
<path value="$PROJECT_DIR$/vendor/webmozart/assert" />
<path value="$PROJECT_DIR$/vendor/brianium/paratest" />
<path value="$PROJECT_DIR$/vendor/fidry/cpu-core-counter" />
<path value="$PROJECT_DIR$/vendor/nunomaduro/termwind" />
<path value="$PROJECT_DIR$/vendor/nunomaduro/collision" />
<path value="$PROJECT_DIR$/vendor/phpdocumentor/reflection-common" />
<path value="$PROJECT_DIR$/vendor/phpdocumentor/type-resolver" />
<path value="$PROJECT_DIR$/vendor/phpdocumentor/reflection-docblock" />
<path value="$PROJECT_DIR$/vendor/filp/whoops" />
<path value="$PROJECT_DIR$/vendor/ta-tikoma/phpunit-architecture-test" />
<path value="$PROJECT_DIR$/vendor/jean85/pretty-package-versions" />
<path value="$PROJECT_DIR$/vendor/friendsofhyperf/pest-plugin-hyperf" />
<path value="$PROJECT_DIR$/vendor/rector/rector" />
<path value="$PROJECT_DIR$/vendor/friendsofhyperf/rector" />
<path value="$PROJECT_DIR$/vendor/spatie/test-time" />
<path value="$PROJECT_DIR$/vendor/spatie/pest-plugin-test-time" />
<path value="$PROJECT_DIR$/vendor/friendsofphp/php-cs-fixer" />
<path value="$PROJECT_DIR$/vendor/symfony/options-resolver" />
<path value="$PROJECT_DIR$/vendor/symfony/stopwatch" />
<path value="$PROJECT_DIR$/vendor/phpstan/phpstan" />
<path value="$PROJECT_DIR$/vendor/doctrine/deprecations" />
<path value="$PROJECT_DIR$/vendor/hyperf/coordinator" />
<path value="$PROJECT_DIR$/vendor/hyperf/guzzle" />
<path value="$PROJECT_DIR$/vendor/hyperf/engine-contract" />
<path value="$PROJECT_DIR$/vendor/hyperf/crontab" />
<path value="$PROJECT_DIR$/vendor/symfony/http-foundation" />
<path value="$PROJECT_DIR$/vendor/hyperf/pipeline" />
<path value="$PROJECT_DIR$/vendor/hyperf/collection" />
<path value="$PROJECT_DIR$/vendor/hyperf/tappable" />
<path value="$PROJECT_DIR$/vendor/hyperf/db" />
<path value="$PROJECT_DIR$/vendor/symfony/serializer" />
<path value="$PROJECT_DIR$/vendor/facade/ignition-contracts" />
<path value="$PROJECT_DIR$/vendor/hyperf/serializer" />
<path value="$PROJECT_DIR$/vendor/hyperf/code-parser" />
<path value="$PROJECT_DIR$/vendor/hyperf/coroutine" />
<path value="$PROJECT_DIR$/vendor/hyperf/conditionable" />
<path value="$PROJECT_DIR$/vendor/hyperf/codec" />
<path value="$PROJECT_DIR$/vendor/hyperf/stringable" />
<path value="$PROJECT_DIR$/vendor/hyperf/support" />
<path value="$PROJECT_DIR$/vendor/ralouphie/getallheaders" />
<path value="$PROJECT_DIR$/vendor/cooper/hyperf-pest" />
<path value="$PROJECT_DIR$/vendor/psr/clock" />
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-php83" />
<path value="$PROJECT_DIR$/vendor/carbonphp/carbon-doctrine-types" />
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-php82" />
</include_path>
</component>
<component name="PhpProjectSharedConfiguration" php_language_level="8.1" />

21
.idea/phpspec.xml generated
View File

@@ -26,6 +26,27 @@
<PhpSpecSuiteConfiguration>
<option name="myPath" value="$PROJECT_DIR$" />
</PhpSpecSuiteConfiguration>
<PhpSpecSuiteConfiguration>
<option name="myPath" value="$PROJECT_DIR$" />
</PhpSpecSuiteConfiguration>
<PhpSpecSuiteConfiguration>
<option name="myPath" value="$PROJECT_DIR$" />
</PhpSpecSuiteConfiguration>
<PhpSpecSuiteConfiguration>
<option name="myPath" value="$PROJECT_DIR$" />
</PhpSpecSuiteConfiguration>
<PhpSpecSuiteConfiguration>
<option name="myPath" value="$PROJECT_DIR$" />
</PhpSpecSuiteConfiguration>
<PhpSpecSuiteConfiguration>
<option name="myPath" value="$PROJECT_DIR$" />
</PhpSpecSuiteConfiguration>
<PhpSpecSuiteConfiguration>
<option name="myPath" value="$PROJECT_DIR$" />
</PhpSpecSuiteConfiguration>
<PhpSpecSuiteConfiguration>
<option name="myPath" value="$PROJECT_DIR$" />
</PhpSpecSuiteConfiguration>
</suites>
</component>
</project>

View File

@@ -1,4 +1,80 @@
# 版本更新日志
## [1.0.0-beta.0](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/compare/v1.0.0-alpha.19...v1.0.0-beta.0) (2023-12-15)
### 🐛 Bug Fixes | Bug 修复
* **bin:** 更新了迁移脚本的目录 ([01aa833](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/01aa8335371fce4f7663eb1c16e4ef7f108e2bc5))
### 📦‍ Build System | 打包构建
* **release:** 将版本号改为 beta ([cfbb770](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/cfbb770559e748c77d52e7d913398b1d2a1d8edd))
## [1.0.0-alpha.19](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/compare/v1.0.0-alpha.18...v1.0.0-alpha.19) (2023-12-15)
### ✨ Features | 新功能
* **bin:** 增加了迁移到最新版本的脚本 ([a84b812](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/a84b812dd0577186379e2df19493cb0fcf9b4fd9))
## [1.0.0-alpha.18](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/compare/v1.0.0-alpha.17...v1.0.0-alpha.18) (2023-12-14)
### 📦‍ Build System | 打包构建
* **composer:** 清理 composer 配置 ([08d00a7](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/08d00a785f3be1846333777edae94e0ae237c8a2))
### ♻️ Code Refactoring | 代码重构
* 迁移到 hyperf3.1 的写法 ([97131d2](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/97131d224cfb601ba075ff1af1c4ca333680b459))
### ✨ Features | 新功能
* **bin:** 增加了迁移到最新版本的脚本 ([7d6dc7f](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/7d6dc7fe9f9bc637755768852518420e98176d56))
## [1.0.0-alpha.17](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/compare/v1.0.0-alpha.16...v1.0.0-alpha.17) (2023-12-14)
### 🐛 Bug Fixes | Bug 修复
* **CoreMiddleware:** 修复参数类型过少的问题 ([14d28de](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/14d28deee2ec97991b7effe99a37cc03b19a291c))
### 📦‍ Build System | 打包构建
* **composer:** 更新依赖,增加 php8.2/8.3的 polyfill ([b89b218](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/b89b218eaa211d0262e2f1dff4d61f2a79eacda6))
* **ide:** 增加了docker 映射 ([cbc59cc](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/cbc59ccf74dafcedca1e4369e647ba1c003efe39))
## [1.0.0-alpha.16](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/compare/v1.0.0-alpha.15...v1.0.0-alpha.16) (2023-12-04)
### ♻️ Code Refactoring | 代码重构
* 迁移到 hyperf3.1和 pestphp2 ([eee68ca](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/eee68cab8a06833114ae19dc2c746dcd50206cb4))
## [1.0.0-alpha.15](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/compare/v1.0.0-alpha.14...v1.0.0-alpha.15) (2023-10-30)
### 📦‍ Build System | 打包构建
* **composer:** 更新依赖 ([26b55f1](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/26b55f1ca5acb8b1bac3d4c23c7154a33ba1b5e6))
### ✅ Tests | 测试
* **request:** 修复了无法使用的测试用例 ([b7d0dd8](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/b7d0dd87c5ef110c581df74ff9e1e8987a3fdc6b))
* **utils:** 增加了无极分类的测试用例 ([97848a5](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/97848a5e2299d33b46ded328ea03ac76e19c5cd0))
## [1.0.0-alpha.14](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/compare/v1.0.0-alpha.13...v1.0.0-alpha.14) (2023-10-23)
### 👷 Continuous Integration | CI 配置
* **GiteaActions:** 修复没有内容的问题 ([8e4f4d0](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/8e4f4d0d290212174d153cea7f97bc886e7194da))
## [1.0.0-alpha.13](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/compare/v1.0.0-alpha.12...v1.0.0-alpha.13) (2023-10-23)

View File

@@ -1 +1 @@
1.0.0-alpha.13
1.0.0-beta.0

19
bin/hdk-migrate-core.sh Normal file
View File

@@ -0,0 +1,19 @@
#!/bin/sh
# shellcheck disable=SC2039
LIB_HOME_DIR="$(pwd)/vendor/singularity/hdk-core"
LATEST_VERSION=$(cat "${LIB_HOME_DIR}/VERSION_TRACKER.txt")
echo -e '\033[44;34;5m=============================\033[0m'
echo ''
$(pwd)/vendor/bin/rector \
process \
--autoload-file=vendor/autoload.php \
--config="${LIB_HOME_DIR}/hyperf31_rector.php"
echo ''
echo -e '\033[44;34;5m=============================\033[0m'
echo -e '\033[;31;1m🎉Congratulations!\033[0m'
echo "Now you have been migrated to HDK-Core v${LATEST_VERSION}!"
echo ''

View File

@@ -14,66 +14,72 @@
"email": "dongyun.li@luxcreo.ai"
}
],
"bin": [
"bin/hdk-migrate-core.sh"
],
"require": {
"php": "^8.1",
"php": ">=8.1",
"ext-dom": "*",
"ext-libxml": "*",
"ext-redis": "^5.3|^6.0",
"ext-swoole": "*",
"composer/composer": ">=2.0",
"ergebnis/http-method": "^2.2",
"hyperf/config": "^3.0.18",
"hyperf/constants": "^3.0.18",
"hyperf/context": "^3.0.18",
"hyperf/di": "^3.0.18",
"hyperf/framework": "^3.0.18",
"hyperf/logger": "^3.0.18",
"hyperf/redis": "^3.0.18",
"hyperf/resource": "^3.0.18",
"hyperf/translation": "^3.0.18",
"ergebnis/http-method": "^2.5",
"friendsofhyperf/rector": "^0.1.5",
"hyperf/config": "3.1.*",
"hyperf/constants": "3.1.*",
"hyperf/context": "3.1.*",
"hyperf/di": "3.1.*",
"hyperf/framework": "3.1.*",
"hyperf/logger": "3.1.*",
"hyperf/redis": "3.1.*",
"hyperf/resource": "3.1.*",
"hyperf/translation": "3.1.*",
"jetbrains/phpstorm-attributes": "^1.0",
"lmc/http-constants": "^1.2",
"myclabs/php-enum": "^1.8",
"roave/dont": "^1.5",
"symfony/http-foundation": "^6.0",
"symfony/polyfill-php81": "^1.26",
"teapot/status-code": "^1.1",
"ext-libxml": "*",
"ext-dom": "*"
"lmc/http-constants": "^1.2.0",
"myclabs/php-enum": "^1.8.4",
"roave/dont": "^1.6.0",
"symfony/http-foundation": "^6.4",
"symfony/polyfill-php81": "^1.28",
"symfony/polyfill-php82": "^1.28",
"symfony/polyfill-php83": "^1.28",
"teapot/status-code": "^1.1.2"
},
"require-dev": {
"alibabacloud/dysmsapi-20170525": "^2.0",
"cooper/hyperf-pest": "^1.1",
"firebase/php-jwt": "^6.1",
"friendsofphp/php-cs-fixer": "^3.13",
"guzzlehttp/guzzle": "^7.5",
"hyperf/crontab": "^3.0.18",
"hyperf/database": "^3.0.18",
"hyperf/db": "^3.0.18",
"hyperf/guzzle": "^3.0.18",
"hyperf/session": "^3.0.18",
"hyperf/validation": "^3.0.18",
"pestphp/pest": "^1.22",
"phpstan/phpstan": "^1.9",
"phpunit/phpunit": "^9.5",
"firebase/php-jwt": "^6.9",
"friendsofhyperf/pest-plugin-hyperf": "3.1.*",
"friendsofphp/php-cs-fixer": "^3.41.1",
"guzzlehttp/guzzle": "^7.8",
"hyperf/crontab": "3.1.*",
"hyperf/database": "3.1.*",
"hyperf/db": "3.1.*",
"hyperf/guzzle": "3.1.*",
"hyperf/session": "3.1.*",
"hyperf/testing": "^3.1",
"hyperf/validation": "3.1.*",
"pestphp/pest": "^2.23",
"phpstan/phpstan": "^1.10.49",
"rector/rector": "^0.15.25",
"roave/security-advisories": "dev-latest",
"spatie/pest-plugin-test-time": "^1.1",
"spatie/pest-plugin-test-time": "^2.0",
"swoole/ide-helper": "*",
"symfony/mailer": "^6.0",
"symfony/serializer": "^6.0"
"symfony/mailer": "^6.4.0",
"symfony/serializer": "^6.4.1"
},
"suggest": {
"firebase/php-jwt": "JWT 鉴权必需",
"hyperf/session": "^3.0.18",
"hyperf/session": "3.1.*",
"symfony/mailer": "用于发送电子邮件",
"symfony/serializer": "处理 XML 必需",
"ext-dom": "处理 XML 必需",
"ext-libxml": "处理 XML 必需",
"hyperf/guzzle": "^3.0.18",
"hyperf/guzzle": "3.1.*",
"alibabacloud/dysmsapi-20170525": "阿里云短信服务必需"
},
"config": {
"optimize-autoloader": true,
"sort-packages": true,
"secure-http": false,
"allow-plugins": {
"pestphp/pest-plugin": true
}
@@ -88,7 +94,6 @@
"Singularity\\HDK\\Test\\Core\\": "tests/"
}
},
"minimum-stability": "alpha",
"archive": {
"exclude": [
".idea",
@@ -102,32 +107,28 @@
"phpunit.xml"
]
},
"minimum-stability": "dev",
"prefer-stable": true,
"scripts": {
"post-root-package-install": [],
"test": [
"rm -rf runtime",
"Composer\\Config::disableProcessTimeout",
"co-pest --prepend tests/bootstrap.php -c phpunit.xml --colors=always $1"
"pest --coroutine --prepend tests/bootstrap.php --colors=always"
],
"cs-fix": "vendor/bin/php-cs-fixer fix $1 --rules=@PSR12 --allow-risky=yes",
"analyse": "vendor/bin/phpstan analyse $1",
"ci": [
"@analyse publish/ src/ tests/",
"@cs-fix",
"@test --ci",
"@test",
"echo CI Success"
]
},
"repositories": {
"lux-map": {
"type": "composer",
"url": "https://satis.luxcreo.cn/"
},
"packagist": {
"type": "composer",
"url": "https://mirrors.aliyun.com/composer/"
}
},
"version": "1.0.0-alpha.13"
"version": "1.0.0-beta.0"
}

4179
composer.lock generated

File diff suppressed because it is too large Load Diff

197
hyperf31_rector.php Normal file
View File

@@ -0,0 +1,197 @@
<?php
/**
* hyperf31_rector.php@LuxLink
*
* @author 李东云 <Dongyun.Li@LuxCreo.Ai>
* Powered by PhpStorm
* Created on 2023/12/14
*/
declare(strict_types=1);
use Rector\Config\RectorConfig;
use Rector\Renaming\Rector\FuncCall\RenameFunctionRector;
use Rector\Renaming\Rector\MethodCall\RenameMethodRector;
use Rector\Renaming\Rector\Name\RenameClassRector;
use Rector\Renaming\ValueObject\MethodCallRename;
return static function (RectorConfig $rectorConfig): void {
$rectorConfig->importNames(true, false);
$rectorConfig->paths([
BASE_PATH . '/app',
BASE_PATH . '/config',
BASE_PATH . '/tests',
]);
$rectorConfig
->ruleWithConfiguration(RenameClassRector::class, [
// AsyncQueue
'Hyperf\AsyncQueue\Message' => 'Hyperf\AsyncQueue\JobMessage',
// DbConnection
'Hyperf\DbConnection\Listener\CreatingListener' => 'Hyperf\DbConnection\Listener\InitUidOnCreatingListener',
// HttpMessage
'Hyperf\HttpMessage\Server\ConnectionInterface' => 'Hyperf\Engine\Contract\Http\Writable',
'Hyperf\HttpMessage\Server\Connection\SwooleConnection' => 'Hyperf\Engine\Http\WritableConnection',
// Redis
'Hyperf\Redis\ScanCaller' => 'Hyperf\Redis\Traits\ScanCaller',
// Channel
'Hyperf\Utils\Channel\Caller' => 'Hyperf\Coroutine\Channel\Caller',
'Hyperf\Utils\Channel\ChannelManager' => 'Hyperf\Coroutine\Channel\Manager',
// Codec
'Hyperf\Utils\Codec\Base62' => 'Hyperf\Codec\Base62',
'Hyperf\Utils\Codec\Json' => 'Hyperf\Codec\Json',
'Hyperf\Utils\Codec\Xml' => 'Hyperf\Codec\Xml',
// CodeGen
'Hyperf\Utils\CodeGen\Package' => 'Hyperf\CodeParser\Package',
'Hyperf\Utils\CodeGen\PhpDocReader' => 'Hyperf\CodeParser\PhpDocReader',
'Hyperf\Utils\CodeGen\PhpDocReaderManager' => 'Hyperf\CodeParser\PhpDocReaderManager',
'Hyperf\Utils\CodeGen\PhpParser' => 'Hyperf\CodeParser\PhpParser',
'Hyperf\Utils\CodeGen\Project' => 'Hyperf\CodeParser\Project',
// Command
'Hyperf\Command\ConfirmableTrait' => 'Hyperf\Command\Concerns\Confirmable',
'Hyperf\Command\DisableEventDispatcher' => 'Hyperf\Command\Concerns\DisableEventDispatcher',
'Hyperf\Command\NullDisableEventDispatcher' => 'Hyperf\Command\Concerns\NullDisableEventDispatcher',
// Contracts
'Hyperf\Utils\Contracts\Arrayable' => 'Hyperf\Contract\Arrayable',
'Hyperf\Utils\Contracts\Jsonable' => 'Hyperf\Contract\Jsonable',
'Hyperf\Utils\Contracts\MessageBag' => 'Hyperf\Contract\MessageBag',
'Hyperf\Utils\Contracts\MessageProvider' => 'Hyperf\Contract\MessageProvider',
'Hyperf\Utils\Contracts\Xmlable' => 'Hyperf\Contract\Xmlable',
// Coordinator
'Hyperf\Utils\Coordinator\Constants' => 'Hyperf\Coordinator\Constants',
'Hyperf\Utils\Coordinator\Coordinator' => 'Hyperf\Coordinator\Coordinator',
'Hyperf\Utils\Coordinator\CoordinatorManager' => 'Hyperf\Coordinator\CoordinatorManager',
// Coroutine
'Hyperf\Utils\Coroutine\Concurrent' => 'Hyperf\Coroutine\Concurrent',
'Hyperf\Utils\Coroutine\Locker' => 'Hyperf\Coroutine\Locker',
// Exception
'Hyperf\Utils\Exception\ChannelClosedException' => 'Hyperf\Coroutine\Exception\ChannelClosedException',
'Hyperf\Utils\Exception\ExceptionThrower' => 'Hyperf\Support\Exception\ExceptionThrower',
'Hyperf\Utils\Exception\InvalidArgumentException' => 'Hyperf\Support\Exception\InvalidArgumentException',
'Hyperf\Utils\Exception\IPReadFailedException' => 'Hyperf\Support\Exception\IPReadFailedException',
'Hyperf\Utils\Exception\ParallelExecutionException' => 'Hyperf\Coroutine\Exception\ParallelExecutionException',
'Hyperf\Utils\Exception\TimeoutException' => 'Hyperf\Coroutine\Exception\TimeoutException',
'Hyperf\Utils\Exception\WaitTimeoutException' => 'Hyperf\Coroutine\Exception\WaitTimeoutException',
// Filesystem
'Hyperf\Utils\Filesystem\FileNotFoundException' => 'Hyperf\Support\Filesystem\FileNotFoundException',
'Hyperf\Utils\Filesystem\Filesystem' => 'Hyperf\Support\Filesystem\Filesystem',
// Packer
'Hyperf\Utils\Packer\JsonPacker' => 'Hyperf\Codec\Packer\JsonPacker',
'Hyperf\Utils\Packer\PhpSerializerPacker' => 'Hyperf\Codec\Packer\PhpSerializerPacker',
// Reflection
'Hyperf\Utils\Reflection\ClassInvoker' => 'Hyperf\Support\Reflection\ClassInvoker',
// Serializer
'Hyperf\Utils\Serializer\ExceptionNormalizer' => 'Hyperf\Serializer\ExceptionNormalizer',
'Hyperf\Utils\Serializer\JsonDeNormalizer' => 'Hyperf\Serializer\JsonDeNormalizer',
'Hyperf\Utils\Serializer\ScalarNormalizer' => 'Hyperf\Serializer\ScalarNormalizer',
'Hyperf\Utils\Serializer\Serializer' => 'Hyperf\Serializer\Serializer',
'Hyperf\Utils\Serializer\SerializerFactory' => 'Hyperf\Serializer\SerializerFactory',
'Hyperf\Utils\Serializer\SimpleNormalizer' => 'Hyperf\Serializer\SimpleNormalizer',
'Hyperf\Utils\Serializer\SymfonyNormalizer' => 'Hyperf\Serializer\SymfonyNormalizer',
// Traits
'Hyperf\Utils\Traits\Conditionable' => 'Hyperf\Conditionable\Conditionable',
'Hyperf\Utils\Traits\Container' => 'Hyperf\Support\Traits\Container',
'Hyperf\Utils\Traits\CoroutineProxy' => 'Hyperf\Context\Traits\CoroutineProxy',
'Hyperf\Utils\Traits\ForwardsCalls' => 'Hyperf\Support\Traits\ForwardsCalls',
'Hyperf\Utils\Traits\StaticInstance' => 'Hyperf\Support\Traits\StaticInstance',
'Hyperf\Utils\Traits\Tappable' => 'Hyperf\Tappable\Tappable',
// Utils
'Hyperf\Utils\ApplicationContext' => 'Hyperf\Context\ApplicationContext',
'Hyperf\Utils\Arr' => 'Hyperf\Collection\Arr',
'Hyperf\Utils\Backoff' => 'Hyperf\Support\Backoff',
'Hyperf\Utils\ChannelPool' => 'Hyperf\Coroutine\Channel\Pool',
'Hyperf\Utils\ClearStatCache' => 'Hyperf\Support\ClearStatCache',
'Hyperf\Utils\Collection' => 'Hyperf\Collection\Collection',
'Hyperf\Utils\Composer' => 'Hyperf\Support\Composer',
'Hyperf\Utils\Coroutine' => 'Hyperf\Coroutine\Coroutine',
'Hyperf\Utils\Fluent' => 'Hyperf\Support\Fluent',
'Hyperf\Utils\HigherOrderCollectionProxy' => 'Hyperf\Collection\HigherOrderCollectionProxy',
'Hyperf\Utils\HigherOrderTapProxy' => 'Hyperf\Tappable\HigherOrderTapProxy',
'Hyperf\Utils\InteractsWithTime' => 'Hyperf\Support\Traits\InteractsWithTime',
'Hyperf\Utils\IPReader' => 'Hyperf\Support\IPReader',
'Hyperf\Utils\MessageBag' => 'Hyperf\Support\MessageBag',
'Hyperf\Utils\MimeTypeExtensionGuesser' => 'Hyperf\Support\MimeTypeExtensionGuesser',
'Hyperf\Utils\Network' => 'Hyperf\Support\Network',
'Hyperf\Utils\Optional' => 'Hyperf\Support\Optional',
'Hyperf\Utils\Parallel' => 'Hyperf\Coroutine\Parallel',
'Hyperf\Utils\Pipeline' => 'Hyperf\Pipeline\Pipeline',
'Hyperf\Utils\Pluralizer' => 'Hyperf\Support\Pluralizer',
'Hyperf\Utils\ResourceGenerator' => 'Hyperf\Support\ResourceGenerator',
'Hyperf\Utils\SafeCaller' => 'Hyperf\Support\SafeCaller',
'Hyperf\Utils\Str' => 'Hyperf\Stringable\Str',
'Hyperf\Utils\Stringable' => 'Hyperf\Stringable\Stringable',
'Hyperf\Utils\System' => 'Hyperf\Support\System',
'Hyperf\Utils\Waiter' => 'Hyperf\Coroutine\Waiter',
'Hyperf\Utils\WaitGroup' => 'Hyperf\Coroutine\WaitGroup',
]);
$rectorConfig
->ruleWithConfiguration(RenameFunctionRector::class, [
// hyperf/config
'config' => 'Hyperf\Config\config',
// hyperf/collection
'collect' => 'Hyperf\Collection\collect',
'data_fill' => 'Hyperf\Collection\data_fill',
'data_get' => 'Hyperf\Collection\data_get',
'data_set' => 'Hyperf\Collection\data_set',
'head' => 'Hyperf\Collection\head',
'last' => 'Hyperf\Collection\last',
// hyperf/continue
'co' => 'Hyperf\Coroutine\co',
'defer' => 'Hyperf\Coroutine\defer',
'go' => 'Hyperf\Coroutine\go',
'parallel' => 'Hyperf\Coroutine\parallel',
'run' => 'Hyperf\Coroutine\run',
'wait' => 'Hyperf\Coroutine\wait',
// hyperf/tappable
'tap' => 'Hyperf\Tappable\tap',
// hyperf/translation
'__' => 'Hyperf\Translation\__',
'trans' => 'Hyperf\Translation\trans',
'trans_choice' => 'Hyperf\Translation\trans_choice',
// hyperf/utils
'value' => 'Hyperf\Support\value',
'env' => 'Hyperf\Support\env',
'retry' => 'Hyperf\Support\retry',
'with' => 'Hyperf\Support\with',
'call' => 'Hyperf\Support\call',
'class_basename' => 'Hyperf\Support\class_basename',
'trait_uses_recursive' => 'Hyperf\Support\trait_uses_recursive',
'class_uses_recursive' => 'Hyperf\Support\class_uses_recursive',
'setter' => 'Hyperf\Support\setter',
'getter' => 'Hyperf\Support\getter',
'make' => 'Hyperf\Support\make',
'swoole_hook_flags' => 'Hyperf\Support\swoole_hook_flags',
'optional' => 'Hyperf\Support\optional',
]);
$rectorConfig->ruleWithConfiguration(RenameMethodRector::class, [
new MethodCallRename('Hyperf\Dag\Dag', 'checkCircularDependences', 'checkCircularDependencies'),
// new MethodCallRename('Hyperf\DbConnection\Connection', 'isTransaction', 'transactionLevel'),
new MethodCallRename('Hyperf\Testing\Client', 'init', 'initRequest'),
new MethodCallRename('Hyperf\Cache\CacheListenerCollector', 'getListner', 'getListener'),
]);
};

View File

@@ -8,6 +8,7 @@ parameters:
- tests
ignoreErrors:
- '#Constant BASE_PATH not found#'
- '#Unknown parameter \$[a-zA-Z0-9]+ in call to callable Closure\.#'
- '#Property [a-zA-Z0-9\\_]+::\$[a-zA-Z0-9]+ is never written, only read\.#'
- '#Method [a-zA-Z0-9\\_]+::[a-zA-Z0-9]+\(\) is unused\.#'
- '#Method [a-zA-Z0-9\\_]+::[a-zA-Z0-9]+\(\) has parameter \$response with no value type specified in iterable type array\.#'

View File

@@ -1,10 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="vendor/autoload.php"
colors="true" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.5/phpunit.xsd">
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
bootstrap="./tests/bootstrap.php"
colors="true"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.4/phpunit.xsd"
cacheDirectory=".phpunit.cache"
>
<coverage/>
<testsuites>
<testsuite name="Unit">
<directory>./tests/Unit/</directory>
<testsuite name="Tests">
<directory>./tests</directory>
</testsuite>
</testsuites>
<source>
<include>
<directory>./app</directory>
</include>
</source>
</phpunit>

View File

@@ -2,4 +2,4 @@
docker run --rm -it \
-v $(pwd):/app -e "GIT_AUTHOR_NAME=$(git config user.name)" -e "EMAIL=$(git config user.email)" \
detouched/standard-version:latest -p=alpha $1
detouched/standard-version:latest -p=beta $1

View File

@@ -24,7 +24,6 @@ class ConfigProvider
/** @phpstan-ignore-next-line */
public function __invoke(): array
{
/** @noinspection PhpUndefinedConstantInspection */
return [
// 合并到 config/autoload/dependencies.php 文件
'dependencies' => [

View File

@@ -73,9 +73,9 @@ class CommonHandler extends ExceptionHandler
$is_testing = config('app_status') === true;
$this->request?->url();
$is_debug = $this->request?->hasHeader('Postman-Token') || str_starts_with(
$this->request?->header('User-Agent', ''),
'apifox'
);
$this->request?->header('User-Agent', ''),
'apifox'
);
$error_type = $throwable::class;
$request_time = Carbon::now()->toDateTimeString();
$request_data = Json::encode($this->request?->getParsedBody());
@@ -156,7 +156,9 @@ class CommonHandler extends ExceptionHandler
// 模型不存在
if ($throwable instanceof ModelNotFoundException) {
$code = empty($throwable->getCode()) ? CommonErrorCode::MODEL_NOT_FOUND : $throwable->getCode();
$message = empty($throwable->getCode()) ? CommonErrorCode::getMessage($code, ['resource' => '资源']
$message = empty($throwable->getCode()) ? CommonErrorCode::getMessage(
$code,
['resource' => '资源']
) : $throwable->getMessage();
$data = [$code_name => $code, $message_name => $message];
$status_code = RFC7231::NOT_FOUND;

View File

@@ -4,7 +4,8 @@ declare(strict_types=1);
namespace Singularity\HDK\Core\Http;
use Ergebnis\Http\Method;
use Ergebnis\Http\Method\Rfc\Rfc5789;
use Ergebnis\Http\Method\Rfc\Rfc7231;
use GuzzleHttp\Client;
use GuzzleHttp\Exception\GuzzleException;
use GuzzleHttp\Psr7\Request;
@@ -14,6 +15,8 @@ use Hyperf\Guzzle\ClientFactory;
use Psr\Http\Message\ResponseInterface;
use Singularity\HDK\Core\Service\AbstractSingleton;
use function Hyperf\Support\make;
/**
* Singularity\HDK\Core\Service\Http\RequestService@Core
*
@@ -41,13 +44,15 @@ final class RequestService extends AbstractSingleton
{
$this->setOptions($options);
/** @var ClientFactory $client */
$client = \Hyperf\Support\make(ClientFactory::class);
$client = make(ClientFactory::class);
$this->client = $client;
}
/**
* 定制 options
*
* @param Options $options
*
* @return $this
*/
public function setOptions(array $options): self
@@ -57,10 +62,11 @@ final class RequestService extends AbstractSingleton
}
/**
* @param string $url
* @param string $url
* @param array<string, string|int> $params
* @param array $data
* @param Options $options
* @param array<string, mixed> $data
* @param Options $options
*
* @return ResponseInterface
* @throws GuzzleException
*/
@@ -71,14 +77,17 @@ final class RequestService extends AbstractSingleton
array $options = []
): ResponseInterface {
$request = new Request(
method: Method\Rfc\Rfc7231::GET, uri: $url
method: Rfc7231::GET,
uri: $url
);
return $this->getClient($options)->send($request, ['query' => $params, 'json' => $data,]);
}
/**
* 工厂模式初始化请求
*
* @param Options $options
*
* @return Client
*/
private function getClient(array $options): Client
@@ -88,10 +97,11 @@ final class RequestService extends AbstractSingleton
}
/**
* @param string $url
* @param string $url
* @param array<string, string|int> $params
* @param array<string, mixed> $data
* @param Options $options
* @param array<string, mixed> $data
* @param Options $options
*
* @return ResponseInterface
* @throws GuzzleException
*/
@@ -103,7 +113,7 @@ final class RequestService extends AbstractSingleton
): ResponseInterface {
$data = Json::encode($data);
$request = new Request(
method: Method\Rfc\Rfc7231::POST,
method: Rfc7231::POST,
uri: $url,
headers: ['Content-Type' => 'application/json'],
body: Utils::streamFor($data),
@@ -112,10 +122,11 @@ final class RequestService extends AbstractSingleton
}
/**
* @param string $url
* @param array<string, mixed> $data
* @param string $url
* @param array<string, mixed> $data
* @param array<string, string|int> $params
* @param Options $options
* @param Options $options
*
* @return ResponseInterface
* @throws GuzzleException
*/
@@ -127,21 +138,23 @@ final class RequestService extends AbstractSingleton
): ResponseInterface {
$data = Json::encode($data);
$request = new Request(
method: Method\Rfc\Rfc7231::PUT,
method: Rfc7231::PUT,
uri: $url,
headers: ['Content-Type' => 'application/json'],
body: Utils::streamFor($data)
);
return $this->getClient($options)->send(
$request, ['query' => $params,]
$request,
['query' => $params,]
);
}
/**
* @param string $url
* @param array<string, mixed> $data
* @param string $url
* @param array<string, mixed> $data
* @param array<string, string|int> $params
* @param Options $options
* @param Options $options
*
* @return ResponseInterface
* @throws GuzzleException
*/
@@ -153,21 +166,23 @@ final class RequestService extends AbstractSingleton
): ResponseInterface {
$data = Json::encode($data);
$request = new Request(
method: Method\Rfc\Rfc5789::PATCH,
method: Rfc5789::PATCH,
uri: $url,
headers: ['Content-Type' => 'application/json'],
body: Utils::streamFor($data)
);
return $this->getClient($options)->send(
$request, ['query' => $params,]
$request,
['query' => $params,]
);
}
/**
* @param string $url
* @param array<string, mixed> $data
* @param string $url
* @param array<string, mixed> $data
* @param array<string, string|int> $params
* @param Options $options
* @param Options $options
*
* @return ResponseInterface
* @throws GuzzleException
*/
@@ -179,13 +194,14 @@ final class RequestService extends AbstractSingleton
): ResponseInterface {
$data = Json::encode($data);
$request = new Request(
method: Method\Rfc\Rfc7231::DELETE,
method: Rfc7231::DELETE,
uri: $url,
headers: ['Content-Type' => 'application/json'],
body: Utils::streamFor($data)
);
return $this->getClient($options)->send(
$request, ['query' => $params,]
$request,
['query' => $params,]
);
}
}

View File

@@ -15,8 +15,13 @@ use Singularity\HDK\Core\Service\AbstractFactory;
final class RequestServiceFactory extends AbstractFactory
{
/**
* @param array<string,mixed> $options
*
* @return RequestService
*/
public static function make(array $options = []): RequestService
{
return new RequestService($options);
}
}
}

View File

@@ -15,12 +15,13 @@ use Hyperf\Contract\Arrayable;
use Hyperf\Contract\Jsonable;
use Hyperf\Contract\LengthAwarePaginatorInterface;
use Hyperf\Di\Annotation\Inject;
use Hyperf\HttpMessage\Server\ResponsePlusProxy;
use Hyperf\HttpMessage\Stream\SwooleStream;
use Hyperf\HttpServer\CoreMiddleware;
use Lmc\HttpConstants\Header;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Singularity\HDK\Core\Service\UtilsService;
use Swow\Psr7\Message\ResponsePlusInterface;
use function Hyperf\Config\config;
@@ -32,7 +33,7 @@ use function Hyperf\Config\config;
* Created on 2022/4/29
*
* @deprecated
* @see CommonCoreMiddleware
* @see CommonCoreMiddleware
*/
class ClassicCoreMiddleware extends CoreMiddleware
{
@@ -43,24 +44,41 @@ class ClassicCoreMiddleware extends CoreMiddleware
* Transfer the non-standard response content to a standard response object.
* @template TKey of array-key
* @template TValue
*
* @param null|array<TKey, TValue>|Arrayable<TKey, TValue>|Jsonable|string $response
*/
protected function transferToResponse($response, ServerRequestInterface $request): ResponseInterface
{
protected function transferToResponse(
$response,
ServerRequestInterface $request
): ResponsePlusInterface {
$code_name = config('common.response.code_name');
$message_name = config('common.response.message_name');
$data_name = config('common.response.data_name');
// 分页数据
if ($response instanceof LengthAwarePaginatorInterface) {
$paginator = $response;
$fact_response = $this->response()->withHeader('Per-Page', (string)$paginator->perPage())->withHeader(
'Total',
(string)$paginator->total()
)->withHeader('Current-Page', (string)$paginator->currentPage())->withHeader(
'Total-Pages',
(string)$paginator->hasPages()
$fact_response = $this->response()
->withHeader(
'Per-Page',
(string)$paginator->perPage()
)
->withHeader(
'Total',
(string)$paginator->total()
)
->withHeader(
'Current-Page',
(string)$paginator->currentPage()
)
->withHeader(
'Total-Pages',
(string)$paginator->hasPages()
);
$fact_response = $this->utilsService->extendLinkToHeader(
$fact_response,
$paginator->nextPageUrl(),
'next'
);
$fact_response = $this->utilsService->extendLinkToHeader($fact_response, $paginator->nextPageUrl(), 'next');
$fact_response = $this->utilsService->extendLinkToHeader(
$fact_response,
$paginator->url($paginator->lastPage()),
@@ -72,23 +90,27 @@ class ClassicCoreMiddleware extends CoreMiddleware
$paginator->previousPageUrl(),
'prev'
);
return $fact_response->withAddedHeader(Header::CONTENT_TYPE, 'application/json')->withBody(
new SwooleStream(
Json::encode(
[
$code_name => 200,
$message_name => 'ok',
$data_name => $response->items(),
'meta' => [
'currentPage' => $paginator->currentPage(),
'lastPage' => $paginator->lastPage(),
'perPage' => $paginator->perPage(),
'total' => $paginator->total(),
],
]
$resp = $fact_response
->withAddedHeader(Header::CONTENT_TYPE, 'application/json')
->withBody(
new SwooleStream(
Json::encode(
[
$code_name => 200,
$message_name => 'ok',
$data_name => $response->items(),
'meta' => [
'currentPage' => $paginator->currentPage(),
'lastPage' => $paginator->lastPage(),
'perPage' => $paginator->perPage(),
'total' => $paginator->total(),
],
]
)
)
)
);
);
return new ResponsePlusProxy($resp);
}
// 普通数组
if (is_array($response) || $response instanceof Arrayable) {

View File

@@ -15,6 +15,7 @@ use Hyperf\Contract\Arrayable;
use Hyperf\Contract\Jsonable;
use Hyperf\Contract\LengthAwarePaginatorInterface;
use Hyperf\Di\Annotation\Inject;
use Hyperf\HttpMessage\Server\ResponsePlusProxy;
use Hyperf\HttpMessage\Stream\SwooleStream;
use Hyperf\HttpServer\CoreMiddleware;
use Lmc\HttpConstants\Header;
@@ -22,6 +23,7 @@ use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Singularity\HDK\Core\Service\ApiStyleService;
use Singularity\HDK\Core\Service\UtilsService;
use Swow\Psr7\Message\ResponsePlusInterface;
use function Hyperf\Config\config;
@@ -43,24 +45,31 @@ class CommonCoreMiddleware extends CoreMiddleware
/**
* @inheritDoc
*/
protected function transferToResponse($response, ServerRequestInterface $request): ResponseInterface
{
protected function transferToResponse(
$response,
ServerRequestInterface $request
): ResponsePlusInterface {
$style = $this->apiStyleService->get();
if ($style === ApiStyleService::RESTFUL) {
return $this->transferToRestfulResponse($response, $request);
$response = $this->transferToRestfulResponse($response, $request);
} else {
return $this->transferToClassicResponse($response, $request);
$response = $this->transferToClassicResponse($response, $request);
}
return new ResponsePlusProxy($response);
}
/**
* @param array|string|Arrayable|Jsonable|null $response
* @param ServerRequestInterface $request
* @param null|array|Arrayable|Jsonable|ResponseInterface|string $response
* @param ServerRequestInterface $request
*
* @return ResponseInterface
*/
protected function transferToRestfulResponse(Arrayable|Jsonable|array|string|null $response, ServerRequestInterface $request): ResponseInterface
{
protected function transferToRestfulResponse(
null|array|Arrayable|Jsonable|ResponseInterface|string $response,
ServerRequestInterface $request
): ResponseInterface {
// 分页数据
if ($response instanceof LengthAwarePaginatorInterface) {
$fact_response = $this->response()
@@ -87,12 +96,13 @@ class CommonCoreMiddleware extends CoreMiddleware
}
/**
* @param array|string|Arrayable|Jsonable|null $response
* @param ServerRequestInterface $request
* @param null|array|Arrayable|Jsonable|ResponseInterface|string $response
* @param ServerRequestInterface $request
*
* @return ResponseInterface
*/
protected function transferToClassicResponse(
Arrayable|Jsonable|array|string|null $response,
null|array|Arrayable|Jsonable|ResponseInterface|string $response,
ServerRequestInterface $request
): ResponseInterface {
$code_name = config('common.response.code_name');

View File

@@ -13,10 +13,11 @@ use Hyperf\Contract\Arrayable;
use Hyperf\Contract\Jsonable;
use Hyperf\Contract\LengthAwarePaginatorInterface;
use Hyperf\Di\Annotation\Inject;
use Hyperf\HttpMessage\Server\ResponsePlusProxy;
use Hyperf\HttpServer\CoreMiddleware;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Singularity\HDK\Core\Service\UtilsService;
use Swow\Psr7\Message\ResponsePlusInterface;
/**
* Singularity\HDK\Core\Middleware\RestfulCoreMiddleware@HDK-Core
@@ -26,7 +27,7 @@ use Singularity\HDK\Core\Service\UtilsService;
* Created on 2023/1/14
*
* @deprecated
* @see CommonCoreMiddleware
* @see CommonCoreMiddleware
*/
class RestfulCoreMiddleware extends CoreMiddleware
{
@@ -37,11 +38,14 @@ class RestfulCoreMiddleware extends CoreMiddleware
* @template TKey of array-key
* @template TValue
* @param null|array<TKey, TValue>|Arrayable<TKey, TValue>|Jsonable|string $response
* @param ServerRequestInterface $request
* @return ResponseInterface
* @param ServerRequestInterface $request
*
* @return ResponsePlusInterface
*/
protected function transferToResponse($response, ServerRequestInterface $request): ResponseInterface
{
protected function transferToResponse(
$response,
ServerRequestInterface $request
): ResponsePlusInterface {
// 分页数据
if ($response instanceof LengthAwarePaginatorInterface) {
$fact_response = $this->response()
@@ -56,11 +60,12 @@ class RestfulCoreMiddleware extends CoreMiddleware
'last'
);
$fact_response = $this->utilsService->extendLinkToHeader($fact_response, $response->url(1), 'first');
return $this->utilsService->extendLinkToHeader(
$resp = $this->utilsService->extendLinkToHeader(
$fact_response,
$response->previousPageUrl(),
'prev'
);
return new ResponsePlusProxy($resp);
}
return parent::transferToResponse($response, $request);

View File

@@ -86,7 +86,7 @@ class SessionMiddleware implements MiddlewareInterface
/**
* Store the current URL for the request if necessary.
*/
private function storeCurrentUrl(RequestInterface $request, SessionInterface $session)
private function storeCurrentUrl(RequestInterface $request, SessionInterface $session): void
{
if ($request->getMethod() === 'GET') {
$session->setPreviousUrl($this->fullUrl($request));
@@ -155,7 +155,7 @@ class SessionMiddleware implements MiddlewareInterface
return rtrim(preg_replace('/\?.*/', '', (string)$request->getUri()));
}
private function auth(SessionInterface $session)
private function auth(SessionInterface $session): bool
{
return $session->has('userInfo');
}

View File

@@ -13,6 +13,7 @@ namespace Singularity\HDK\Core\Service;
use Dont\DontCall;
use Dont\DontInstantiate;
use Singularity\HDK\Core\Http\RequestService;
/**
* Singularity\HDK\Core\Service\AbstractFactory@Core
@@ -26,5 +27,5 @@ abstract class AbstractFactory
use DontInstantiate;
use DontCall;
abstract static function make();
}
abstract public static function make(): RequestService;
}

View File

@@ -23,4 +23,4 @@ abstract class AbstractSingleton
{
use DontCallStatic;
use DontClone;
}
}

View File

@@ -4,7 +4,7 @@ declare(strict_types=1);
namespace Singularity\HDK\Core\Service;
use Ergebnis\Http\Method;
use Ergebnis\Http\Method\Rfc\Rfc7231;
use GuzzleHttp\Client;
use GuzzleHttp\Exception\GuzzleException;
use GuzzleHttp\Psr7\Request;
@@ -16,6 +16,7 @@ use Psr\Http\Message\ResponseInterface;
/**
* 发起 Http 请求的类
*
* @deprecated since version 1.0-alpha.3, to be removed in 1.0
*/
class HttpRequestService
@@ -31,15 +32,16 @@ class HttpRequestService
private array $options = [];
/**
* @param string $url
* @param string $url
* @param array<string, string|int> $params
* @param array $data
* @param array<string, mixed> $data
*
* @return ResponseInterface
* @throws GuzzleException
*/
public function requestGet(string $url, array $params = [], array $data = []): ResponseInterface
{
$request = new Request(Method\Rfc\Rfc7231::GET, $url);
$request = new Request(Rfc7231::GET, $url);
return $this->getClient()->send($request, [
'query' => $params,
'json' => $data,
@@ -52,9 +54,10 @@ class HttpRequestService
}
/**
* @param string $url
* @param array<string, mixed> $data
* @param string $url
* @param array<string, mixed> $data
* @param array<string, string|int> $params
*
* @return ResponseInterface
* @throws GuzzleException
*/
@@ -74,9 +77,10 @@ class HttpRequestService
/**
* @param string $url
* @param array<string, mixed> $data
* @param string $url
* @param array<string, mixed> $data
* @param array<string, string|int> $params
*
* @return ResponseInterface
* @throws GuzzleException
*/
@@ -91,7 +95,9 @@ class HttpRequestService
/**
* 定制 options
*
* @param array<string, mixed> $options
*
* @return $this
*/
public function setOptions(array $options): HttpRequestService

View File

@@ -10,11 +10,11 @@
namespace Singularity\HDK\Core\Traits;
use Closure;
use Hyperf\Contract\LengthAwarePaginatorInterface;
use Hyperf\Database\Model\Builder;
use Hyperf\Database\Model\Relations\Relation;
use Hyperf\Di\Annotation\Inject;
use Hyperf\HttpServer\Contract\RequestInterface;
use Hyperf\Paginator\AbstractPaginator;
use Hyperf\Stringable\Str;
use Singularity\HDK\Core\Service\ExtendService;
@@ -25,7 +25,7 @@ trait RestfulList
#[Inject]
protected RequestInterface $request;
protected function restSelect(Closure $callback, ?Closure $filter = null)
protected function restSelect(Closure $callback, ?Closure $filter = null): mixed
{
$parsed_options = [];
$result = $this->parseParameters(
@@ -52,11 +52,18 @@ trait RestfulList
return $callback(query: $query, options: $options);
}
/**
* @param array<string, mixed> $options
* @param Builder|Relation $builder
* @param Closure|null $filter
*
* @return mixed
*/
protected function responseFormatter(
array $options,
Builder|Relation $builder,
?Closure $filter = null
) {
): mixed {
$perPage = $options['size'] ?? null;
$order = $options['order'] ?? 'created_at';
$sort = $options['sort'] ?? 'desc';
@@ -70,7 +77,7 @@ trait RestfulList
return $result;
}
if ($result instanceof LengthAwarePaginatorInterface) {
if ($result instanceof AbstractPaginator) {
$collection = $result->getCollection();
$collection = $filter($collection);
@@ -78,4 +85,4 @@ trait RestfulList
}
return $filter($result);
}
}
}

View File

@@ -26,7 +26,7 @@ it('assertions that send HTML is available', function () use ($email) {
HTML
);
expect($result)->toBeTrue();
});
})->skip();
it('assertions that send Text is available', function () use ($email) {
$result = $email->sendText(
@@ -37,7 +37,7 @@ it('assertions that send Text is available', function () use ($email) {
Text
);
expect($result)->toBeTrue();
});
})->skip();
it('assertions Error Receiver can be catch', function () use ($email) {
try {
@@ -62,4 +62,4 @@ Text
} catch (TransportException $t) {
expect($t->getCode())->toBe(554);
}
});
})->skip('会报错必须运行在协程环境下');

View File

@@ -13,6 +13,8 @@ use Hyperf\Context\Context;
use Singularity\HDK\Core\Service\ExtendService;
use Singularity\HDK\Core\Service\UtilsService;
use function Hyperf\Support\make;
/** @var ExtendService $service */
$service = make(ExtendService::class, ['utils' => new UtilsService()]);
it('asserts no parameters can be parsed.', function (ExtendService $service, $params) {

View File

@@ -9,8 +9,12 @@
*/
namespace Singularity\HDK\Test\Core\Unit;
use Singularity\HDK\Core\Http\RequestService;
use Singularity\HDK\Core\Http\RequestServiceFactory;
use Teapot\StatusCode\RFC\RFC7231;
use function Hyperf\Support\make;
class RequestServiceTest
{
@@ -29,13 +33,9 @@ class RequestServiceTest
test('Http 请求服务可以正常使用', function () {
/** @var RequestServiceTest $class */
$class = \Hyperf\Support\make(RequestServiceTest::class);
$response = $class->getInstance()->requestGet('http://baidu.com/');
$content = $response->getBody()->getContents();
expect($content)->toBe(<<<HTML
<html>
<meta http-equiv="refresh" content="0;url=http://www.baidu.com/">
</html>
HTML);
$class = make(RequestServiceTest::class);
$response = $class->getInstance()->setOptions([
'allow_redirects' => false,
])->requestGet('https://www.baidu.com');
expect($response->getStatusCode())->toBe(RFC7231::OK);
});

View File

@@ -7,14 +7,172 @@
* Created on 2023/1/12
*/
use Hyperf\Codec\Json;
use Singularity\HDK\Core\Service\UtilsService;
$utils = new UtilsService();
use function Hyperf\Support\make;
$utils = new UtilsService();
dataset('categories', [
[
'source' => <<<JSON
[
{
"id": 200002538,
"name": "空心菜类",
"level": 3,
"namePath": "蔬菜/豆制品,叶菜类,空心菜类"
},
{
"id": 200002537,
"name": "香菜类",
"level": 3,
"namePath": "蔬菜/豆制品,葱姜蒜椒/调味菜,香菜类"
},
{
"id": 200002536,
"name": "紫苏/苏子叶",
"level": 3,
"namePath": "蔬菜/豆制品,叶菜类,紫苏/苏子叶"
},
{
"id": 200002543,
"name": "乌塌菜/塌菜/乌菜",
"level": 3,
"namePath": "蔬菜/豆制品,叶菜类,乌塌菜/塌菜/乌菜"
},
{
"id": 200002542,
"name": "菜心/菜苔类",
"level": 3,
"namePath": "蔬菜/豆制品,叶菜类,菜心/菜苔类"
},
{
"id": 200002540,
"name": "马兰头/马兰/红梗菜",
"level": 3,
"namePath": "蔬菜/豆制品,叶菜类,马兰头/马兰/红梗菜"
},
{
"id": 200002531,
"name": "苋菜类",
"level": 3,
"namePath": "蔬菜/豆制品,叶菜类,苋菜类"
},
{
"id": 200002528,
"name": "其他叶菜类",
"level": 3,
"namePath": "蔬菜/豆制品,叶菜类,其他叶菜类"
}
]
JSON,
'expected' => <<<JSON
[
{
"id": "e485b0bb87",
"id_path": ",e485b0bb87,",
"level": 1,
"name": "蔬菜/豆制品",
"name_path": "蔬菜/豆制品",
"parent_id": 0,
"children": [
{
"id": "bf1753faa2",
"id_path": ",e485b0bb87,bf1753faa2,",
"level": 2,
"name": "叶菜类",
"name_path": "蔬菜/豆制品,叶菜类",
"parent_id": "e485b0bb87",
"children": [
{
"id": "b8c8b14630",
"id_path": ",e485b0bb87,bf1753faa2,b8c8b14630,",
"level": 3,
"name": "空心菜类",
"name_path": "蔬菜/豆制品,叶菜类,空心菜类",
"parent_id": "bf1753faa2"
},
{
"id": "78c941ae91",
"id_path": ",e485b0bb87,bf1753faa2,78c941ae91,",
"level": 3,
"name": "紫苏/苏子叶",
"name_path": "蔬菜/豆制品,叶菜类,紫苏/苏子叶",
"parent_id": "bf1753faa2"
},
{
"id": "eccbf542f9",
"id_path": ",e485b0bb87,bf1753faa2,eccbf542f9,",
"level": 3,
"name": "乌塌菜/塌菜/乌菜",
"name_path": "蔬菜/豆制品,叶菜类,乌塌菜/塌菜/乌菜",
"parent_id": "bf1753faa2"
},
{
"id": "3621a8c3dc",
"id_path": ",e485b0bb87,bf1753faa2,3621a8c3dc,",
"level": 3,
"name": "菜心/菜苔类",
"name_path": "蔬菜/豆制品,叶菜类,菜心/菜苔类",
"parent_id": "bf1753faa2"
},
{
"id": "aad334b5a0",
"id_path": ",e485b0bb87,bf1753faa2,aad334b5a0,",
"level": 3,
"name": "马兰头/马兰/红梗菜",
"name_path": "蔬菜/豆制品,叶菜类,马兰头/马兰/红梗菜",
"parent_id": "bf1753faa2"
},
{
"id": "70d40b44f2",
"id_path": ",e485b0bb87,bf1753faa2,70d40b44f2,",
"level": 3,
"name": "苋菜类",
"name_path": "蔬菜/豆制品,叶菜类,苋菜类",
"parent_id": "bf1753faa2"
},
{
"id": "45623d0c88",
"id_path": ",e485b0bb87,bf1753faa2,45623d0c88,",
"level": 3,
"name": "其他叶菜类",
"name_path": "蔬菜/豆制品,叶菜类,其他叶菜类",
"parent_id": "bf1753faa2"
}
]
},
{
"id": "188ae68906",
"id_path": ",e485b0bb87,188ae68906,",
"level": 2,
"name": "葱姜蒜椒/调味菜",
"name_path": "蔬菜/豆制品,葱姜蒜椒/调味菜",
"parent_id": "e485b0bb87",
"children": [
{
"id": "4c64873413",
"id_path": ",e485b0bb87,188ae68906,4c64873413,",
"level": 3,
"name": "香菜类",
"name_path": "蔬菜/豆制品,葱姜蒜椒/调味菜,香菜类",
"parent_id": "188ae68906"
}
]
}
]
}
]
JSON
],
]);
$length_data = [];
for ($i = 0; $i < 5; $i++) {
try {
$length_data[] = random_int(1, 9);
$length_data[(string)$i] = [
'length' => random_int(1, 9)
];
} catch (Exception $e) {
continue;
}
@@ -58,7 +216,7 @@ test('断言可以根据参数构建 URL', function (string $url, array $params,
['c' => 'd'],
true,
'http://username:password@127.0.0.1/git/resp?id=1#/page?a=b&c=d',
]
],
])->group('pure', 'utils');
test('断言可以判断是否是数组中的元素', function (
@@ -79,3 +237,42 @@ test('断言可以判断是否是数组中的元素', function (
['1', ['1', 2, 3], true, false],
[[1, 2, 3], ['1', 2, 3], false, true],
])->group('pure', 'utils');
test('无极分类', function (string $source, string $expected) {
$tree = [];
foreach (Json::decode($source) as $item) {
$path_array = explode(',', $item['namePath']);
$parent_id = 0;
$name_path = [];
$id_path = ',';
foreach ($path_array as $i => $name) {
$name_path[] = $name;
$level = $i + 1;
$id = substr(md5($level . $name), 0, 10);
$id_path .= $id . ',';
$new_item = [
'id' => $id,
'id_path' => $id_path,
'level' => $level,
'name' => $name,
'name_path' => join(',', $name_path + [$name]),
'parent_id' => $parent_id,
];
$tree[$id] = $new_item;
$parent_id = $id;
}
}
/** @var UtilsService $utils */
$utils = make(UtilsService::class);
usort($tree, fn ($prevent, $current) => $current['level'] <=> $prevent['level']);
$tree = array_column($tree, null, 'id');
$utils->unlimitedSubCategoriesQuicklyWithLevel(list: $tree);
expect($tree)->toBe(Json::decode($expected));
})->with('categories');

View File

@@ -1,19 +1,13 @@
<?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
*/
use Hyperf\Context\ApplicationContext;
use Hyperf\Di\ClassLoader;
use Hyperf\Di\Container;
use Hyperf\Di\Definition\DefinitionSource;
use Psr\Container\ContainerInterface;
use Swoole\Runtime;
ini_set('display_errors', 'on');
ini_set('display_startup_errors', 'on');
@@ -25,13 +19,13 @@ date_default_timezone_set('Asia/Shanghai');
!defined('BASE_PATH') && define('BASE_PATH', dirname(__DIR__, 1));
!defined('SWOOLE_HOOK_FLAGS') && define('SWOOLE_HOOK_FLAGS', SWOOLE_HOOK_ALL);
Swoole\Runtime::enableCoroutine(true);
Runtime::enableCoroutine(true);
require BASE_PATH . '/vendor/autoload.php';
Hyperf\Di\ClassLoader::init();
ClassLoader::init();
$container = new Container(new DefinitionSource([]));
if (!$container instanceof ContainerInterface) {
throw new RuntimeException('The dependency injection container is invalid.');
}
$container = ApplicationContext::setContainer($container);
$container = ApplicationContext::setContainer($container);