From 144dd408663fe643adaa0fdc92f39667b21be384 Mon Sep 17 00:00:00 2001 From: sebprt Date: Fri, 14 Apr 2023 16:18:33 +0200 Subject: [PATCH 1/6] Using the RunnableInterface provided by php-etl/job-contracts --- src/Action.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Action.php b/src/Action.php index ca1e5f6..9ae6bae 100644 --- a/src/Action.php +++ b/src/Action.php @@ -6,8 +6,8 @@ use Kiboko\Contract\Action\ActionInterface; use Kiboko\Contract\Action\ExecutingActionInterface; -use Kiboko\Contract\Action\RunnableInterface; use Kiboko\Contract\Action\StateInterface; +use Kiboko\Contract\Job\RunnableInterface; use Psr\Log\LoggerInterface; use Psr\Log\NullLogger; From 9e74efed73f9ac55c835ce3eacd2aa9ce267ead1 Mon Sep 17 00:00:00 2001 From: sebprt Date: Tue, 18 Apr 2023 17:06:30 +0200 Subject: [PATCH 2/6] Added php-etl/satellite-contracts --- composer.json | 3 ++- composer.lock | 54 +++++++++++++++++++++++++++++++++++++++++++++++++- src/Action.php | 8 ++++---- 3 files changed, 59 insertions(+), 6 deletions(-) diff --git a/composer.json b/composer.json index 506eae0..5a945ac 100644 --- a/composer.json +++ b/composer.json @@ -18,7 +18,8 @@ "require": { "php": "^8.2", "psr/log": "^3.0", - "php-etl/action-contracts": "0.1.*" + "php-etl/action-contracts": "0.1.*", + "php-etl/satellite-contracts": "0.1.*" }, "require-dev": { "rector/rector": "^0.15.0" diff --git a/composer.lock b/composer.lock index e848eab..96d16d3 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": "e7449bf0fe0f2ab2610cf67b6a489706", + "content-hash": "da2db606018dbbd04c7cafd36f4b9096", "packages": [ { "name": "php-etl/action-contracts", @@ -113,6 +113,58 @@ }, "time": "2023-04-03T12:42:10+00:00" }, + { + "name": "php-etl/satellite-contracts", + "version": "v0.1.0", + "source": { + "type": "git", + "url": "https://github.com/php-etl/satellite-contracts.git", + "reference": "1d2bc6822bfdb3efc6a1f490e706db995c99ef41" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-etl/satellite-contracts/zipball/1d2bc6822bfdb3efc6a1f490e706db995c99ef41", + "reference": "1d2bc6822bfdb3efc6a1f490e706db995c99ef41", + "shasum": "" + }, + "require": { + "php": "^8.2" + }, + "require-dev": { + "rector/rector": "^0.15.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "0.1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Kiboko\\Contract\\Satellite\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Kiboko SAS", + "homepage": "http://kiboko.fr" + }, + { + "name": "Grégory Planchat", + "email": "gregory@kiboko.fr" + } + ], + "description": "This library describes contracts for defining satellite formats", + "support": { + "issues": "https://github.com/php-etl/satellite-contracts/issues", + "source": "https://github.com/php-etl/satellite-contracts/tree/v0.1.0" + }, + "time": "2023-04-18T13:53:22+00:00" + }, { "name": "psr/log", "version": "3.0.0", diff --git a/src/Action.php b/src/Action.php index 9ae6bae..b218659 100644 --- a/src/Action.php +++ b/src/Action.php @@ -7,14 +7,14 @@ use Kiboko\Contract\Action\ActionInterface; use Kiboko\Contract\Action\ExecutingActionInterface; use Kiboko\Contract\Action\StateInterface; -use Kiboko\Contract\Job\RunnableInterface; +use Kiboko\Contract\Satellite\RunnableInterface; use Psr\Log\LoggerInterface; use Psr\Log\NullLogger; -class Action implements ExecutingActionInterface, RunnableInterface +readonly class Action implements ExecutingActionInterface, RunnableInterface { public function __construct( - private readonly LoggerInterface $logger = new NullLogger(), + private LoggerInterface $logger = new NullLogger(), ) { } @@ -42,7 +42,7 @@ public function execute(ActionInterface $action, StateInterface $state): Executi return $this; } - public function run(): int + public function run(int $interval = 1000): int { return 1; } From dd1a6d6dad183ab2aa1a4af1f249da4b9da81045 Mon Sep 17 00:00:00 2001 From: sebprt Date: Tue, 18 Apr 2023 17:14:37 +0200 Subject: [PATCH 3/6] Removed token from the rector ci --- .github/workflows/rector.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/rector.yaml b/.github/workflows/rector.yaml index 23508e6..ae8da90 100644 --- a/.github/workflows/rector.yaml +++ b/.github/workflows/rector.yaml @@ -11,9 +11,6 @@ jobs: - if: github.event.pull_request.head.repo.full_name == github.repository uses: actions/checkout@v3 - with: - # Must be used to trigger workflow after push - token: ${{ secrets.ACCESS_TOKEN }} - uses: shivammathur/setup-php@v2 From 6903a5ec678f530651b1ee57997162b8e9a620c7 Mon Sep 17 00:00:00 2001 From: sebprt Date: Tue, 18 Apr 2023 17:27:11 +0200 Subject: [PATCH 4/6] Added php-cs-fixer rule --- .php-cs-fixer.dist.php | 1 + 1 file changed, 1 insertion(+) diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index fe5d2d6..2a172a0 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -7,6 +7,7 @@ return (new PhpCsFixer\Config()) ->setRiskyAllowed(true) ->setRules([ + '@PHP82Migration' => true, '@PHP81Migration' => true, '@PHP80Migration:risky' => true, '@PHPUnit84Migration:risky' => true, From 748cd0706fd760721c30823fb96244a59256ffd7 Mon Sep 17 00:00:00 2001 From: sebprt Date: Wed, 19 Apr 2023 10:48:12 +0200 Subject: [PATCH 5/6] Updated dependencies --- composer.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/composer.lock b/composer.lock index 96d16d3..7a019e2 100644 --- a/composer.lock +++ b/composer.lock @@ -12,12 +12,12 @@ "source": { "type": "git", "url": "https://github.com/php-etl/action-contracts.git", - "reference": "63c12030c0bf3cbbe918a0b0c0793e1565b7bf15" + "reference": "42b3f800ab4898e06249b73afad852160d225884" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-etl/action-contracts/zipball/63c12030c0bf3cbbe918a0b0c0793e1565b7bf15", - "reference": "63c12030c0bf3cbbe918a0b0c0793e1565b7bf15", + "url": "https://api.github.com/repos/php-etl/action-contracts/zipball/42b3f800ab4898e06249b73afad852160d225884", + "reference": "42b3f800ab4898e06249b73afad852160d225884", "shasum": "" }, "require": { @@ -57,7 +57,7 @@ "issues": "https://github.com/php-etl/action-contracts/issues", "source": "https://github.com/php-etl/action-contracts/tree/v0.1.0" }, - "time": "2023-04-14T09:58:24+00:00" + "time": "2023-04-18T15:03:09+00:00" }, { "name": "php-etl/bucket-contracts", From c6eda097c1bd2556242460464508d6c014517d1b Mon Sep 17 00:00:00 2001 From: sebprt Date: Wed, 19 Apr 2023 11:10:22 +0200 Subject: [PATCH 6/6] Updated php-cs-fixer action --- .github/workflows/quality.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/quality.yaml b/.github/workflows/quality.yaml index 2e2a411..fe10ea4 100644 --- a/.github/workflows/quality.yaml +++ b/.github/workflows/quality.yaml @@ -5,6 +5,9 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + - uses: shivammathur/setup-php@v2 + with: + php-version: '8.2' - name: Cs-Fixer run: | wget -q https://cs.symfony.com/download/php-cs-fixer-v3.phar -O php-cs-fixer