From 63fab19e1482b28608163a2381529d039a983757 Mon Sep 17 00:00:00 2001 From: Greg Bowler Date: Thu, 16 Apr 2026 17:14:26 +0100 Subject: [PATCH 1/4] tidy: move to GT prefix --- composer.json | 2 ++ example/01-delay-1-5-10-seconds.php | 6 +++--- example/02-countdown.php | 8 ++++---- example/03-promise.php | 4 ++-- src/Event/Event.php | 2 +- src/Event/EventDispatcher.php | 2 +- src/Loop.php | 6 +++--- src/Timer/IndividualTimer.php | 2 +- src/Timer/PeriodicTimer.php | 2 +- src/Timer/Timer.php | 2 +- src/Timer/TimerOrder.php | 2 +- test/phpunit/Event/EventDispatcherTest.php | 6 +++--- test/phpunit/LoopTest.php | 6 +++--- test/phpunit/Timer/IndividualTimerTest.php | 6 +++--- test/phpunit/Timer/PeriodicTimerTest.php | 6 +++--- 15 files changed, 32 insertions(+), 30 deletions(-) diff --git a/composer.json b/composer.json index d3fc5bb..9f79141 100644 --- a/composer.json +++ b/composer.json @@ -17,11 +17,13 @@ "autoload": { "psr-4": { + "GT\\Async\\": "./src", "Gt\\Async\\": "./src" } }, "autoload-dev": { "psr-4": { + "GT\\Async\\Test\\": "./test/phpunit", "Gt\\Async\\Test\\": "./test/phpunit" } }, diff --git a/example/01-delay-1-5-10-seconds.php b/example/01-delay-1-5-10-seconds.php index 35ac337..48cfa8b 100644 --- a/example/01-delay-1-5-10-seconds.php +++ b/example/01-delay-1-5-10-seconds.php @@ -7,8 +7,8 @@ * the IndividualTimer object. */ -use Gt\Async\Loop; -use Gt\Async\Timer\IndividualTimer; +use GT\Async\Loop; +use GT\Async\Timer\IndividualTimer; require("../vendor/autoload.php"); $timeAtScriptStart = microtime(true); @@ -27,4 +27,4 @@ $loop = new Loop(); $loop->addTimer($timer); echo "Starting...", PHP_EOL; -$loop->run(); \ No newline at end of file +$loop->run(); diff --git a/example/02-countdown.php b/example/02-countdown.php index b6ad868..f914134 100644 --- a/example/02-countdown.php +++ b/example/02-countdown.php @@ -9,9 +9,9 @@ * imagine the concurrent timers being used to execute actual workloads. */ -use Gt\Async\Loop; -use Gt\Async\Timer\IndividualTimer; -use Gt\Async\Timer\PeriodicTimer; +use GT\Async\Loop; +use GT\Async\Timer\IndividualTimer; +use GT\Async\Timer\PeriodicTimer; require("../vendor/autoload.php"); @@ -38,4 +38,4 @@ $loop->addTimer($tinyTickTimer); $loop->addTimer($stopTimer); echo "Starting...", PHP_EOL; -$loop->run(); \ No newline at end of file +$loop->run(); diff --git a/example/03-promise.php b/example/03-promise.php index 5d62089..df36dba 100644 --- a/example/03-promise.php +++ b/example/03-promise.php @@ -11,8 +11,8 @@ * framework could offer promise-driven filesystem functionality. */ -use Gt\Async\Loop; -use Gt\Async\Timer\PeriodicTimer; +use GT\Async\Loop; +use GT\Async\Timer\PeriodicTimer; use Gt\Promise\Deferred; use Gt\Promise\PromiseInterface; diff --git a/src/Event/Event.php b/src/Event/Event.php index d6709ec..0c2f78f 100644 --- a/src/Event/Event.php +++ b/src/Event/Event.php @@ -1,5 +1,5 @@ > */ diff --git a/src/Loop.php b/src/Loop.php index 4da4bf6..c8e1def 100644 --- a/src/Loop.php +++ b/src/Loop.php @@ -1,8 +1,8 @@ tick(); self::assertEquals(1, $exampleCallbackCount); } -} \ No newline at end of file +} diff --git a/test/phpunit/Timer/PeriodicTimerTest.php b/test/phpunit/Timer/PeriodicTimerTest.php index e629433..201b7fb 100644 --- a/test/phpunit/Timer/PeriodicTimerTest.php +++ b/test/phpunit/Timer/PeriodicTimerTest.php @@ -1,7 +1,7 @@ Date: Mon, 4 May 2026 17:19:07 +0100 Subject: [PATCH 2/4] build: php 8.1 compat --- composer.lock | 122 ++++++++++++++++++++++++++------------------------ 1 file changed, 63 insertions(+), 59 deletions(-) diff --git a/composer.lock b/composer.lock index 919b890..693b4b1 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "e3a2a09974f94992d8370292ce7f8fb1", + "content-hash": "45d67bb75e3afc68e6dc283f8d6cb421", "packages": [ { "name": "phpgt/promise", @@ -2212,34 +2212,34 @@ }, { "name": "symfony/config", - "version": "v7.4.8", + "version": "v6.4.37", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "2d19dde43fa2ff720b9a40763ace7226594f503b" + "reference": "ee615e8352db9c5f0b7b149154a3f654dc72042b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/2d19dde43fa2ff720b9a40763ace7226594f503b", - "reference": "2d19dde43fa2ff720b9a40763ace7226594f503b", + "url": "https://api.github.com/repos/symfony/config/zipball/ee615e8352db9c5f0b7b149154a3f654dc72042b", + "reference": "ee615e8352db9c5f0b7b149154a3f654dc72042b", "shasum": "" }, "require": { - "php": ">=8.2", + "php": ">=8.1", "symfony/deprecation-contracts": "^2.5|^3", - "symfony/filesystem": "^7.1|^8.0", + "symfony/filesystem": "^5.4|^6.0|^7.0", "symfony/polyfill-ctype": "~1.8" }, "conflict": { - "symfony/finder": "<6.4", + "symfony/finder": "<5.4", "symfony/service-contracts": "<2.5" }, "require-dev": { - "symfony/event-dispatcher": "^6.4|^7.0|^8.0", - "symfony/finder": "^6.4|^7.0|^8.0", - "symfony/messenger": "^6.4|^7.0|^8.0", + "symfony/event-dispatcher": "^5.4|^6.0|^7.0", + "symfony/finder": "^5.4|^6.0|^7.0", + "symfony/messenger": "^5.4|^6.0|^7.0", "symfony/service-contracts": "^2.5|^3", - "symfony/yaml": "^6.4|^7.0|^8.0" + "symfony/yaml": "^5.4|^6.0|^7.0" }, "type": "library", "autoload": { @@ -2267,7 +2267,7 @@ "description": "Helps you find, load, combine, autofill and validate configuration values of any kind", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/config/tree/v7.4.8" + "source": "https://github.com/symfony/config/tree/v6.4.37" }, "funding": [ { @@ -2287,43 +2287,44 @@ "type": "tidelift" } ], - "time": "2026-03-24T13:12:05+00:00" + "time": "2026-04-29T10:19:30+00:00" }, { "name": "symfony/dependency-injection", - "version": "v7.4.8", + "version": "v6.4.37", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "f7025fd7b687c240426562f86ada06a93b1e771d" + "reference": "4f66d607578c9d0546b1750262a6140e552e346d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/f7025fd7b687c240426562f86ada06a93b1e771d", - "reference": "f7025fd7b687c240426562f86ada06a93b1e771d", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/4f66d607578c9d0546b1750262a6140e552e346d", + "reference": "4f66d607578c9d0546b1750262a6140e552e346d", "shasum": "" }, "require": { - "php": ">=8.2", + "php": ">=8.1", "psr/container": "^1.1|^2.0", "symfony/deprecation-contracts": "^2.5|^3", - "symfony/service-contracts": "^3.6", - "symfony/var-exporter": "^6.4.20|^7.2.5|^8.0" + "symfony/service-contracts": "^2.5|^3.0", + "symfony/var-exporter": "^6.4.20|^7.2.5" }, "conflict": { "ext-psr": "<1.1|>=2", - "symfony/config": "<6.4", - "symfony/finder": "<6.4", - "symfony/yaml": "<6.4" + "symfony/config": "<6.1", + "symfony/finder": "<5.4", + "symfony/proxy-manager-bridge": "<6.3", + "symfony/yaml": "<5.4" }, "provide": { "psr/container-implementation": "1.1|2.0", "symfony/service-implementation": "1.1|2.0|3.0" }, "require-dev": { - "symfony/config": "^6.4|^7.0|^8.0", - "symfony/expression-language": "^6.4|^7.0|^8.0", - "symfony/yaml": "^6.4|^7.0|^8.0" + "symfony/config": "^6.1|^7.0", + "symfony/expression-language": "^5.4|^6.0|^7.0", + "symfony/yaml": "^5.4|^6.0|^7.0" }, "type": "library", "autoload": { @@ -2351,7 +2352,7 @@ "description": "Allows you to standardize and centralize the way objects are constructed in your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/dependency-injection/tree/v7.4.8" + "source": "https://github.com/symfony/dependency-injection/tree/v6.4.37" }, "funding": [ { @@ -2371,7 +2372,7 @@ "type": "tidelift" } ], - "time": "2026-03-31T06:50:29+00:00" + "time": "2026-04-30T17:50:20+00:00" }, { "name": "symfony/deprecation-contracts", @@ -2442,25 +2443,25 @@ }, { "name": "symfony/filesystem", - "version": "v7.4.8", + "version": "v6.4.37", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "58b9790d12f9670b7f53a1c1738febd3108970a5" + "reference": "29f792d7dc30cc670fc4cdd50d7c6653d067ce7b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/58b9790d12f9670b7f53a1c1738febd3108970a5", - "reference": "58b9790d12f9670b7f53a1c1738febd3108970a5", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/29f792d7dc30cc670fc4cdd50d7c6653d067ce7b", + "reference": "29f792d7dc30cc670fc4cdd50d7c6653d067ce7b", "shasum": "" }, "require": { - "php": ">=8.2", + "php": ">=8.1", "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-mbstring": "~1.8" }, "require-dev": { - "symfony/process": "^6.4|^7.0|^8.0" + "symfony/process": "^5.4|^6.4|^7.0" }, "type": "library", "autoload": { @@ -2488,7 +2489,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v7.4.8" + "source": "https://github.com/symfony/filesystem/tree/v6.4.37" }, "funding": [ { @@ -2508,20 +2509,20 @@ "type": "tidelift" } ], - "time": "2026-03-24T13:12:05+00:00" + "time": "2026-04-13T15:27:04+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.33.0", + "version": "v1.37.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638" + "reference": "141046a8f9477948ff284fa65be2095baafb94f2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/a3cc8b044a6ea513310cbd48ef7333b384945638", - "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/141046a8f9477948ff284fa65be2095baafb94f2", + "reference": "141046a8f9477948ff284fa65be2095baafb94f2", "shasum": "" }, "require": { @@ -2571,7 +2572,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.33.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.37.0" }, "funding": [ { @@ -2591,20 +2592,20 @@ "type": "tidelift" } ], - "time": "2024-09-09T11:45:10+00:00" + "time": "2026-04-10T16:19:22+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.33.0", + "version": "v1.37.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "6d857f4d76bd4b343eac26d6b539585d2bc56493" + "reference": "6a21eb99c6973357967f6ce3708cd55a6bec6315" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/6d857f4d76bd4b343eac26d6b539585d2bc56493", - "reference": "6d857f4d76bd4b343eac26d6b539585d2bc56493", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/6a21eb99c6973357967f6ce3708cd55a6bec6315", + "reference": "6a21eb99c6973357967f6ce3708cd55a6bec6315", "shasum": "" }, "require": { @@ -2656,7 +2657,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.33.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.37.0" }, "funding": [ { @@ -2676,7 +2677,7 @@ "type": "tidelift" } ], - "time": "2024-12-23T08:48:59+00:00" + "time": "2026-04-10T17:25:58+00:00" }, { "name": "symfony/service-contracts", @@ -2767,26 +2768,26 @@ }, { "name": "symfony/var-exporter", - "version": "v7.4.8", + "version": "v6.4.37", "source": { "type": "git", "url": "https://github.com/symfony/var-exporter.git", - "reference": "398907e89a2a56fe426f7955c6fa943ec0c77225" + "reference": "34f6957deffacabd1b1c579a312daa481e3e99ca" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-exporter/zipball/398907e89a2a56fe426f7955c6fa943ec0c77225", - "reference": "398907e89a2a56fe426f7955c6fa943ec0c77225", + "url": "https://api.github.com/repos/symfony/var-exporter/zipball/34f6957deffacabd1b1c579a312daa481e3e99ca", + "reference": "34f6957deffacabd1b1c579a312daa481e3e99ca", "shasum": "" }, "require": { - "php": ">=8.2", + "php": ">=8.1", "symfony/deprecation-contracts": "^2.5|^3" }, "require-dev": { - "symfony/property-access": "^6.4|^7.0|^8.0", - "symfony/serializer": "^6.4|^7.0|^8.0", - "symfony/var-dumper": "^6.4|^7.0|^8.0" + "symfony/property-access": "^6.4|^7.0", + "symfony/serializer": "^6.4|^7.0", + "symfony/var-dumper": "^5.4|^6.0|^7.0" }, "type": "library", "autoload": { @@ -2824,7 +2825,7 @@ "serialize" ], "support": { - "source": "https://github.com/symfony/var-exporter/tree/v7.4.8" + "source": "https://github.com/symfony/var-exporter/tree/v6.4.37" }, "funding": [ { @@ -2844,7 +2845,7 @@ "type": "tidelift" } ], - "time": "2026-03-24T13:12:05+00:00" + "time": "2026-04-14T12:12:40+00:00" }, { "name": "theseer/tokenizer", @@ -2907,5 +2908,8 @@ "ext-dom": "*" }, "platform-dev": {}, + "platform-overrides": { + "php": "8.1" + }, "plugin-api-version": "2.9.0" } From cf77f9faae2ea089656b7eacc3858705180d38af Mon Sep 17 00:00:00 2001 From: Greg Bowler Date: Mon, 4 May 2026 17:20:32 +0100 Subject: [PATCH 3/4] ci: improve workflow --- .github/workflows/ci.yml | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 104bb5f..b71fd6f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,6 +38,7 @@ jobs: with: name: build-artifact-${{ matrix.php }} path: /tmp/github-actions + retention-days: 1 phpunit: runs-on: ubuntu-latest @@ -93,9 +94,10 @@ jobs: run: cat "_coverage/coverage.txt" - name: Upload to Codecov - uses: codecov/codecov-action@v5 + uses: codecov/codecov-action@v6 with: token: ${{ secrets.CODECOV_TOKEN }} + slug: ${{ github.repository }} phpstan: runs-on: ubuntu-latest @@ -167,21 +169,3 @@ jobs: php_version: ${{ matrix.php }} path: src/ standard: phpcs.xml - - remove_old_artifacts: - runs-on: ubuntu-latest - - permissions: - actions: write - - steps: - - name: Remove old artifacts for prior workflow runs on this repository - env: - GH_TOKEN: ${{ github.token }} - run: | - gh api "/repos/${{ github.repository }}/actions/artifacts" | jq ".artifacts[] | select(.name | startswith(\"build-artifact\")) | .id" > artifact-id-list.txt - while read id - do - echo -n "Deleting artifact ID $id ... " - gh api --method DELETE /repos/${{ github.repository }}/actions/artifacts/$id && echo "Done" - done Date: Mon, 4 May 2026 17:27:28 +0100 Subject: [PATCH 4/4] ci: codacy --- .codacy.yml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 .codacy.yml diff --git a/.codacy.yml b/.codacy.yml new file mode 100644 index 0000000..008d53b --- /dev/null +++ b/.codacy.yml @@ -0,0 +1,4 @@ +exclude_paths: + - ".github/**" + - "example/**" + - "test/**"