From c1608c2b1675ac3c78192d98ed898e43443e650e Mon Sep 17 00:00:00 2001 From: Sasaya Date: Thu, 28 Sep 2023 17:29:06 +0800 Subject: [PATCH 01/10] feat: add ci script --- .github/workflows/tests.yml | 43 +++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 00000000..c6f7dd25 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,43 @@ +name: tests + +on: + push: + pull_request: + +jobs: + linux_tests: + runs-on: ubuntu-latest + if: "!contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, '[ci skip]')" + + strategy: + fail-fast: true + matrix: + include: + - php: "8.1" + swoole: "4.8.13" + - php: "8.1" + swoole: "5.0.3" + - php: "8.2" + swoole: "4.8.13" + - php: "8.2" + swoole: "5.0.3" + + name: PHP ${{ matrix.php }} (swoole-(${{ matrix.swoole }}) + + steps: + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + extensions: swoole-${{ matrix.swoole }} + coverage: none + + - name: Checkout code + uses: actions/checkout@v2 + + - name: Install dependencies + run: | + COMPOSER_MEMORY_LIMIT=-1 composer install --prefer-dist -n -o + + - name: Execute tests + run: vendor/bin/phpunit From 24da35f9a93357b56f4e92da23bdc27081269fd7 Mon Sep 17 00:00:00 2001 From: Sasaya Date: Thu, 28 Sep 2023 17:33:29 +0800 Subject: [PATCH 02/10] fix: typo --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c6f7dd25..87e28305 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -22,7 +22,7 @@ jobs: - php: "8.2" swoole: "5.0.3" - name: PHP ${{ matrix.php }} (swoole-(${{ matrix.swoole }}) + name: PHP ${{ matrix.php }} (swoole-${{ matrix.swoole }}) steps: - name: Setup PHP From 2a0bb4ee837ce94588a1b6280c5c7bb1f5b891f4 Mon Sep 17 00:00:00 2001 From: Sasaya Date: Mon, 2 Oct 2023 14:44:43 +0800 Subject: [PATCH 03/10] feat: modify composer json --- composer.json | 110 ++++++++++++++++++++++++++++++---------- src/auth/composer.json | 8 +-- src/cache/composer.json | 9 ++-- src/jwt/composer.json | 2 +- 4 files changed, 93 insertions(+), 36 deletions(-) diff --git a/composer.json b/composer.json index 7083436b..81f95f62 100644 --- a/composer.json +++ b/composer.json @@ -22,8 +22,28 @@ }, "autoload": { "psr-4": { - "SwooleTW\\Hyperf\\": "src/" - } + "SwooleTW\\Hyperf\\Auth\\": "src/auth/src/", + "SwooleTW\\Hyperf\\Cache\\": "src/cache/src/", + "SwooleTW\\Hyperf\\Container\\": "src/container/src/", + "SwooleTW\\Hyperf\\Cookie\\": "src/cookie/src/", + "SwooleTW\\Hyperf\\Database\\": "src/sqlite/src/", + "SwooleTW\\Hyperf\\Dispatcher\\": "src/dispatcher/src/", + "SwooleTW\\Hyperf\\Encryption\\": "src/encryption/src/", + "SwooleTW\\Hyperf\\Foundation\\": "src/foundation/src/", + "SwooleTW\\Hyperf\\Hashing\\": "src/hashing/src/", + "SwooleTW\\Hyperf\\JWT\\": "src/jwt/src/", + "SwooleTW\\Hyperf\\Log\\": "src/log/src/", + "SwooleTW\\Hyperf\\ObjectPool\\": "src/object-pool/src/", + "SwooleTW\\Hyperf\\Router\\": "src/router/src/", + "SwooleTW\\Hyperf\\Support\\": "src/support/src/" + }, + "files": [ + "src/auth/src/Functions.php", + "src/cache/src/Functions.php", + "src/foundation/src/helpers.php", + "src/router/src/Functions.php", + "src/support/src/helpers.php" + ] }, "autoload-dev": { "psr-4": { @@ -32,29 +52,59 @@ }, "require": { "php": "^8.1", + "ext-hash": "*", + "ext-mbstring": "*", + "ext-openssl": "*", + "hyperf/async-queue": "^3.1", + "hyperf/collection": "^3.1", + "hyperf/command": "^3.1", + "hyperf/config": "^3.1", "hyperf/context": "^3.1", + "hyperf/contract": "^3.1", + "hyperf/coordinator": "^3.1", + "hyperf/coroutine": "^3.1", + "hyperf/crontab": "^3.1", + "hyperf/database": "^3.1", + "hyperf/db-connection": "^3.1", "hyperf/di": "^3.1", - "hyperf/redis": "^3.1", - "swooletw/hyperf-auth": "@dev", - "swooletw/hyperf-cache": "@dev", - "swooletw/hyperf-container": "@dev", - "swooletw/hyperf-cookie": "@dev", - "swooletw/hyperf-dispatcher": "@dev", - "swooletw/hyperf-encryption": "@dev", - "swooletw/hyperf-foundation": "@dev", - "swooletw/hyperf-hashing": "@dev", - "swooletw/hyperf-jwt": "@dev", - "swooletw/hyperf-log": "@dev", - "swooletw/hyperf-object-pool": "@dev", - "swooletw/hyperf-router": "@dev", - "swooletw/hyperf-sqlite": "@dev", - "swooletw/hyperf-support": "@dev" + "hyperf/engine": "^2.1", + "hyperf/http-message": "^3.1", + "hyperf/http-server": "^3.1", + "hyperf/macroable": "^3.1", + "hyperf/signal": "^3.1", + "hyperf/stringable": "^3.1", + "hyperf/support": "^3.1", + "hyperf/tappable": "^3.1", + "lcobucci/jwt": "^5.0", + "monolog/monolog": "^3.1", + "nesbot/carbon": "^2.16", + "psr/simple-cache": "^3.0", + "ramsey/uuid": "^4.7" + }, + "replace": { + "swooletw/hyperf-auth": "self.version", + "swooletw/hyperf-cache": "self.version", + "swooletw/hyperf-container": "self.version", + "swooletw/hyperf-cookie": "self.version", + "swooletw/hyperf-dispatcher": "self.version", + "swooletw/hyperf-encryption": "self.version", + "swooletw/hyperf-foundation": "self.version", + "swooletw/hyperf-hashing": "self.version", + "swooletw/hyperf-jwt": "self.version", + "swooletw/hyperf-log": "self.version", + "swooletw/hyperf-object-pool": "self.version", + "swooletw/hyperf-router": "self.version", + "swooletw/hyperf-sqlite": "self.version", + "swooletw/hyperf-support": "self.version" }, "suggest": { - "doctrine/dbal": "Required to rename SQLite indexs (^3.5.1)." + "doctrine/dbal": "Required to rename SQLite indexs (^3.5.1).", + "hyperf/redis": "Required to use redis driver. (^3.1)", + "hyperf/session": "Required to use session guard. (^3.1)" }, "require-dev": { "friendsofphp/php-cs-fixer": "dev-master", + "hyperf/redis": "^3.1", "mockery/mockery": "^1.5.1", "phpunit/phpunit": "^10.0.7" }, @@ -62,18 +112,22 @@ "sort-packages": true }, "extra": { + "hyperf": [ + "SwooleTW\\Hyperf\\Auth\\ConfigProvider", + "SwooleTW\\Hyperf\\Cache\\ConfigProvider", + "SwooleTW\\Hyperf\\Cookie\\ConfigProvider", + "SwooleTW\\Hyperf\\Database\\ConfigProvider", + "SwooleTW\\Hyperf\\Dispatcher\\ConfigProvider", + "SwooleTW\\Hyperf\\Encryption\\ConfigProvider", + "SwooleTW\\Hyperf\\Foundation\\ConfigProvider", + "SwooleTW\\Hyperf\\Hashing\\ConfigProvider", + "SwooleTW\\Hyperf\\JWT\\ConfigProvider", + "SwooleTW\\Hyperf\\Log\\ConfigProvider", + "SwooleTW\\Hyperf\\Router\\ConfigProvider" + ], "branch-alias": { "dev-main": "3.1-dev" } }, - "minimum-stability": "dev", - "repositories": [ - { - "type": "path", - "url": "src/*", - "options": { - "symlink": true - } - } - ] + "minimum-stability": "dev" } diff --git a/src/auth/composer.json b/src/auth/composer.json index 46161c80..26474150 100644 --- a/src/auth/composer.json +++ b/src/auth/composer.json @@ -30,11 +30,11 @@ "hyperf/config": "^3.1", "hyperf/database": "^3.1", "hyperf/http-server": "^3.1", - "swooletw/hyperf-hashing": "^3.1|dev-master", - "swooletw/hyperf-jwt": "^3.1|dev-master" + "swooletw/hyperf-hashing": "^3.1", + "swooletw/hyperf-jwt": "^3.1" }, "suggest": { - "hyperf/session": "Required to use session guard." + "hyperf/session": "Required to use session guard. (^3.1)" }, "autoload": { "psr-4": { @@ -56,4 +56,4 @@ "sort-packages": true }, "minimum-stability": "dev" -} \ No newline at end of file +} diff --git a/src/cache/composer.json b/src/cache/composer.json index 11feade5..6b45e609 100644 --- a/src/cache/composer.json +++ b/src/cache/composer.json @@ -34,8 +34,11 @@ "hyperf/support": "^3.1", "psr/simple-cache": "^3.0" }, - "suggests": { - "hyperf/redis": "Required to use redis driver. (^2.0)" + "require-dev": { + "hyperf/redis": "^3.1" + }, + "suggest": { + "hyperf/redis": "Required to use redis driver. (^3.1)" }, "config": { "sort-packages": true @@ -48,4 +51,4 @@ "dev-main": "3.1-dev" } } -} \ No newline at end of file +} diff --git a/src/jwt/composer.json b/src/jwt/composer.json index 20b174f4..ed43a57e 100644 --- a/src/jwt/composer.json +++ b/src/jwt/composer.json @@ -28,7 +28,7 @@ "psr/simple-cache": "^3.0", "hyperf/stringable": "^3.1", "ramsey/uuid": "^4.7", - "swooletw/hyperf-cache": "^3.1|dev-master" + "swooletw/hyperf-cache": "^3.1" }, "autoload": { "psr-4": { From 5474f044cd718ca1e1e713ef051279724688fd57 Mon Sep 17 00:00:00 2001 From: Sasaya Date: Mon, 2 Oct 2023 14:57:02 +0800 Subject: [PATCH 04/10] fix: ext-swoole must >= 5.0 --- .github/workflows/tests.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 87e28305..0b60bc4b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -13,12 +13,8 @@ jobs: fail-fast: true matrix: include: - - php: "8.1" - swoole: "4.8.13" - php: "8.1" swoole: "5.0.3" - - php: "8.2" - swoole: "4.8.13" - php: "8.2" swoole: "5.0.3" From 38321462200ca0d4cbd8e9894adb47b42271abb6 Mon Sep 17 00:00:00 2001 From: Sasaya Date: Mon, 2 Oct 2023 14:59:34 +0800 Subject: [PATCH 05/10] feat: remove useless require --- src/cache/composer.json | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/cache/composer.json b/src/cache/composer.json index 6b45e609..8e0dda67 100644 --- a/src/cache/composer.json +++ b/src/cache/composer.json @@ -34,9 +34,6 @@ "hyperf/support": "^3.1", "psr/simple-cache": "^3.0" }, - "require-dev": { - "hyperf/redis": "^3.1" - }, "suggest": { "hyperf/redis": "Required to use redis driver. (^3.1)" }, From 8d104fedb92b99f33f05fc68d7928f16943b3eb1 Mon Sep 17 00:00:00 2001 From: Sasaya Date: Mon, 2 Oct 2023 15:07:06 +0800 Subject: [PATCH 06/10] feat: phpunit config --- .github/workflows/tests.yml | 3 ++- phpunit.xml.dist.xml | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0b60bc4b..1ecb5eaf 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -36,4 +36,5 @@ jobs: COMPOSER_MEMORY_LIMIT=-1 composer install --prefer-dist -n -o - name: Execute tests - run: vendor/bin/phpunit + run: | + vendor/bin/phpunit -c phpunit.xml.dist.xml diff --git a/phpunit.xml.dist.xml b/phpunit.xml.dist.xml index ce3b2b72..1f12f298 100644 --- a/phpunit.xml.dist.xml +++ b/phpunit.xml.dist.xml @@ -5,13 +5,14 @@ processIsolation="false" stopOnError="false" stopOnFailure="false" - backupStaticProperties="false"> + backupStaticProperties="false" + displayDetailsOnTestsThatTriggerDeprecations="true"> - + ./tests - \ No newline at end of file + From ea7f1d08cf426e066bc6676c0a6f86c7ceecdb0b Mon Sep 17 00:00:00 2001 From: Sasaya Date: Mon, 2 Oct 2023 15:21:26 +0800 Subject: [PATCH 07/10] feat: remove useless testing --- tests/Cache/RedisCacheIntegrationTest.php | 64 ------------ tests/Cache/Stub/InteractsWithRedis.php | 117 ---------------------- 2 files changed, 181 deletions(-) delete mode 100644 tests/Cache/RedisCacheIntegrationTest.php delete mode 100644 tests/Cache/Stub/InteractsWithRedis.php diff --git a/tests/Cache/RedisCacheIntegrationTest.php b/tests/Cache/RedisCacheIntegrationTest.php deleted file mode 100644 index 75cbb35c..00000000 --- a/tests/Cache/RedisCacheIntegrationTest.php +++ /dev/null @@ -1,64 +0,0 @@ -setUpRedis(); - } - - protected function tearDown(): void - { - parent::tearDown(); - $this->tearDownRedis(); - } - - public function testRedisCacheAddTwice() - { - $store = new RedisStore($this->factory); - $repository = new Repository($store); - $this->assertTrue($repository->add('k', 'v', 3600)); - $this->assertFalse($repository->add('k', 'v', 3600)); - $this->assertGreaterThan(3500, $this->redis->ttl('k')); - } - - /** - * Breaking change. - */ - public function testRedisCacheAddFalse() - { - $store = new RedisStore($this->factory); - $repository = new Repository($store); - $repository->forever('k', false); - $this->assertFalse($repository->add('k', 'v', 60)); - $this->assertEquals(-1, $this->redis->ttl('k')); - } - - /** - * Breaking change. - */ - public function testRedisCacheAddNull() - { - $store = new RedisStore($this->factory); - $repository = new Repository($store); - $repository->forever('k', null); - $this->assertFalse($repository->add('k', 'v', 60)); - } -} diff --git a/tests/Cache/Stub/InteractsWithRedis.php b/tests/Cache/Stub/InteractsWithRedis.php deleted file mode 100644 index e1f49302..00000000 --- a/tests/Cache/Stub/InteractsWithRedis.php +++ /dev/null @@ -1,117 +0,0 @@ -factory = $this->getRedisFactory(); - $this->redis = $this->factory->get('default'); - $this->redis->flushDB(); - } - - /** - * Teardown redis connection. - */ - public function tearDownRedis() - { - $this->redis->flushDB(); - } - - /** - * Run test if redis is available. - * - * @param callable $callback - */ - public function ifRedisAvailable($callback) - { - $this->setUpRedis(); - - $callback(); - - $this->tearDownRedis(); - } - - private function getRedisFactory($optinos = []) - { - $container = Mockery::mock(Container::class); - $container->shouldReceive('get')->with(ConfigInterface::class)->andReturn($config = new Config([ - 'redis' => [ - 'default' => [ - 'host' => '127.0.0.1', - 'auth' => null, - 'port' => 6379, - 'db' => 0, - 'options' => $optinos, - 'pool' => [ - 'min_connections' => 1, - 'max_connections' => 30, - 'connect_timeout' => 10.0, - 'wait_timeout' => 3.0, - 'heartbeat' => -1, - 'max_idle_time' => 60, - ], - ], - ], - ])); - $frequency = Mockery::mock(LowFrequencyInterface::class); - $frequency->shouldReceive('isLowFrequency')->andReturn(false); - $container->shouldReceive('make')->with(Frequency::class, Mockery::any())->andReturn($frequency); - $container->shouldReceive('make')->with(RedisPool::class, ['name' => 'default'])->andReturnUsing(function () use ($container) { - return new RedisPool($container, 'default'); - }); - $container->shouldReceive('make')->with(Channel::class, ['size' => 30])->andReturn(new Channel(30)); - $container->shouldReceive('make')->with(PoolOption::class, Mockery::any())->andReturnUsing(function ($class, $args) { - return new PoolOption(...array_values($args)); - }); - $container->shouldReceive('get')->with(StdoutLoggerInterface::class)->andReturnUsing(function () { - $logger = Mockery::mock(StdoutLoggerInterface::class); - $logger->shouldReceive('warning')->withAnyArgs()->andReturnUsing(function ($args) { - var_dump($args); - }); - return $logger; - }); - ApplicationContext::setContainer($container); - - $factory = new PoolFactory($container); - $container->shouldReceive('make')->with(RedisProxy::class, Mockery::any())->andReturnUsing(function ($_, $args) use ($factory) { - return new RedisProxy($factory, $args['pool']); - }); - - return new RedisFactory($config); - } -} From 82dc95b0bda6ae116c305b7ec7de35609a064e62 Mon Sep 17 00:00:00 2001 From: Sasaya Date: Mon, 2 Oct 2023 15:26:07 +0800 Subject: [PATCH 08/10] feat: add php-cs-fix --- .github/workflows/tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 1ecb5eaf..a2c20f69 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -37,4 +37,5 @@ jobs: - name: Execute tests run: | + vendor/bin/php-cs-fixer fix --dry-run --diff vendor/bin/phpunit -c phpunit.xml.dist.xml From 9ca9f92ee5f82c31cdf84a7787d77bf0221d607b Mon Sep 17 00:00:00 2001 From: Sasaya Date: Mon, 2 Oct 2023 15:27:10 +0800 Subject: [PATCH 09/10] chore: apply coding style --- src/auth/src/Contracts/Authorizable.php | 2 + src/auth/src/Guards/JwtGuard.php | 3 +- src/auth/src/Middleware/Authenticate.php | 3 +- .../src/Providers/DatabaseUserProvider.php | 3 +- .../src/Providers/EloquentUserProvider.php | 3 +- src/cache/src/CacheManager.php | 3 +- .../src/Contracts/LockTimeoutException.php | 4 +- src/cache/src/Events/CacheMissed.php | 4 +- src/cache/src/Events/KeyForgotten.php | 4 +- .../Exceptions/InvalidArgumentException.php | 4 +- .../src/Exceptions/NotSupportedException.php | 4 +- src/cache/src/NoLock.php | 4 +- src/cache/src/NullStore.php | 4 +- src/cache/src/Repository.php | 2 - src/cookie/src/CookieManager.php | 3 +- .../Middleware/AddQueuedCookiesToResponse.php | 3 +- .../class_map/HttpRequestHandler.php | 1 - .../src/Exceptions/DecryptException.php | 4 +- .../src/Exceptions/EncryptException.php | 4 +- .../HttpMessage/ResponsePlusProxy.php | 5 +- src/foundation/src/Console/Kernel.php | 7 +-- .../src/Console/Scheduling/Schedule.php | 3 +- .../src/Contracts/Queue/Queueable.php | 4 +- src/foundation/src/Event/EventDispatcher.php | 3 +- .../Testing/Constraints/CountInDatabase.php | 4 -- .../src/Testing/Constraints/HasInDatabase.php | 3 +- .../Constraints/NotSoftDeletedInDatabase.php | 3 +- .../Constraints/SoftDeletedInDatabase.php | 3 +- src/foundation/src/Testing/TestCase.php | 2 - src/jwt/src/Blacklist.php | 3 +- src/jwt/src/Exceptions/PayloadException.php | 4 +- .../Exceptions/TokenBlacklistedException.php | 4 +- .../src/Exceptions/TokenExpiredException.php | 4 +- .../src/Exceptions/TokenInvalidException.php | 4 +- .../Exceptions/UserNotDefinedException.php | 4 +- src/jwt/src/Providers/Provider.php | 3 +- src/jwt/src/Storage/PsrCache.php | 3 +- src/jwt/src/Storage/TaggedCache.php | 3 +- .../src/Validations/AbstractValidation.php | 3 +- src/log/src/LogManager.php | 2 - src/log/src/Logger.php | 3 +- src/support/src/Facades/File.php | 4 +- src/support/src/ServiceProvider.php | 7 +-- tests/Auth/AuthEloquentUserProviderTest.php | 4 +- tests/Container/ContainerTest.php | 50 ++++++------------- tests/JWT/Providers/LcobucciTest.php | 1 - tests/Router/NamedRouteCollectorTest.php | 1 - 47 files changed, 57 insertions(+), 149 deletions(-) diff --git a/src/auth/src/Contracts/Authorizable.php b/src/auth/src/Contracts/Authorizable.php index 6211993f..1753849e 100644 --- a/src/auth/src/Contracts/Authorizable.php +++ b/src/auth/src/Contracts/Authorizable.php @@ -1,5 +1,7 @@ getContainer(); - $container->bind(ContainerConcreteStub::class, function () { - }); + $container->bind(ContainerConcreteStub::class, function () {}); $this->assertTrue($container->bound(ContainerConcreteStub::class)); $this->assertFalse($container->bound(IContainerContractStub::class)); @@ -294,13 +293,11 @@ public function testReboundListeners() unset($_SERVER['__test.rebind']); $container = $this->getContainer(); - $container->bind('foo', function () { - }); + $container->bind('foo', function () {}); $container->rebinding('foo', function () { $_SERVER['__test.rebind'] = true; }); - $container->bind('foo', function () { - }); + $container->bind('foo', function () {}); $this->assertTrue($_SERVER['__test.rebind']); } @@ -310,13 +307,11 @@ public function testReboundListenersOnInstances() unset($_SERVER['__test.rebind']); $container = $this->getContainer(); - $container->instance('foo', function () { - }); + $container->instance('foo', function () {}); $container->rebinding('foo', function () { $_SERVER['__test.rebind'] = true; }); - $container->instance('foo', function () { - }); + $container->instance('foo', function () {}); $this->assertTrue($_SERVER['__test.rebind']); } @@ -329,8 +324,7 @@ public function testReboundListenersOnInstancesOnlyFiresIfWasAlreadyBound() $container->rebinding('foo', function () { $_SERVER['__test.rebind'] = true; }); - $container->instance('foo', function () { - }); + $container->instance('foo', function () {}); $this->assertFalse($_SERVER['__test.rebind']); } @@ -618,40 +612,26 @@ protected function getContainer(array $dependencies = []) class CircularAStub { - public function __construct(CircularBStub $b) - { - } + public function __construct(CircularBStub $b) {} } class CircularBStub { - public function __construct(CircularCStub $c) - { - } + public function __construct(CircularCStub $c) {} } class CircularCStub { - public function __construct(CircularAStub $a) - { - } + public function __construct(CircularAStub $a) {} } -class ContainerConcreteStub -{ -} +class ContainerConcreteStub {} -interface IContainerContractStub -{ -} +interface IContainerContractStub {} -class ContainerImplementationStub implements IContainerContractStub -{ -} +class ContainerImplementationStub implements IContainerContractStub {} -class ContainerImplementationStubTwo implements IContainerContractStub -{ -} +class ContainerImplementationStubTwo implements IContainerContractStub {} class ContainerDependentStub { @@ -724,9 +704,7 @@ public function __construct(ContainerConcreteStub $concrete, $something) class ContainerContextualBindingCallTarget { - public function __construct() - { - } + public function __construct() {} public function work(IContainerContractStub $stub) { diff --git a/tests/JWT/Providers/LcobucciTest.php b/tests/JWT/Providers/LcobucciTest.php index 4eee079f..f2e8ffa3 100644 --- a/tests/JWT/Providers/LcobucciTest.php +++ b/tests/JWT/Providers/LcobucciTest.php @@ -5,7 +5,6 @@ namespace SwooleTW\Hyperf\Tests\JWT\Providers; use Carbon\Carbon; -use Mockery; use SwooleTW\Hyperf\JWT\Exceptions\JWTException; use SwooleTW\Hyperf\JWT\Exceptions\TokenInvalidException; use SwooleTW\Hyperf\JWT\Providers\Lcobucci; diff --git a/tests/Router/NamedRouteCollectorTest.php b/tests/Router/NamedRouteCollectorTest.php index 6ee5e357..2f9f0856 100644 --- a/tests/Router/NamedRouteCollectorTest.php +++ b/tests/Router/NamedRouteCollectorTest.php @@ -7,7 +7,6 @@ use FastRoute\DataGenerator\GroupCountBased as DataGenerator; use FastRoute\RouteParser\Std; use Hyperf\HttpServer\MiddlewareManager; -use Mockery; use SwooleTW\Hyperf\Router\NamedRouteCollector; use SwooleTW\Hyperf\Tests\Router\Stub\RouteCollectorStub; use SwooleTW\Hyperf\Tests\TestCase; From 3681a9a5e877c18f10dc4ea3cbbda3fadfde40a9 Mon Sep 17 00:00:00 2001 From: Sasaya Date: Mon, 2 Oct 2023 16:41:12 +0800 Subject: [PATCH 10/10] fix: hyperf config --- composer.json | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/composer.json b/composer.json index 81f95f62..8d58981d 100644 --- a/composer.json +++ b/composer.json @@ -112,19 +112,21 @@ "sort-packages": true }, "extra": { - "hyperf": [ - "SwooleTW\\Hyperf\\Auth\\ConfigProvider", - "SwooleTW\\Hyperf\\Cache\\ConfigProvider", - "SwooleTW\\Hyperf\\Cookie\\ConfigProvider", - "SwooleTW\\Hyperf\\Database\\ConfigProvider", - "SwooleTW\\Hyperf\\Dispatcher\\ConfigProvider", - "SwooleTW\\Hyperf\\Encryption\\ConfigProvider", - "SwooleTW\\Hyperf\\Foundation\\ConfigProvider", - "SwooleTW\\Hyperf\\Hashing\\ConfigProvider", - "SwooleTW\\Hyperf\\JWT\\ConfigProvider", - "SwooleTW\\Hyperf\\Log\\ConfigProvider", - "SwooleTW\\Hyperf\\Router\\ConfigProvider" - ], + "hyperf": { + "config": [ + "SwooleTW\\Hyperf\\Auth\\ConfigProvider", + "SwooleTW\\Hyperf\\Cache\\ConfigProvider", + "SwooleTW\\Hyperf\\Cookie\\ConfigProvider", + "SwooleTW\\Hyperf\\Database\\ConfigProvider", + "SwooleTW\\Hyperf\\Dispatcher\\ConfigProvider", + "SwooleTW\\Hyperf\\Encryption\\ConfigProvider", + "SwooleTW\\Hyperf\\Foundation\\ConfigProvider", + "SwooleTW\\Hyperf\\Hashing\\ConfigProvider", + "SwooleTW\\Hyperf\\JWT\\ConfigProvider", + "SwooleTW\\Hyperf\\Log\\ConfigProvider", + "SwooleTW\\Hyperf\\Router\\ConfigProvider" + ] + }, "branch-alias": { "dev-main": "3.1-dev" }