Skip to content

Commit

Permalink
Merge pull request #5 from php-etl/feature/actions
Browse files Browse the repository at this point in the history
Using the RunnableInterface provided by php-etl/job-contracts
  • Loading branch information
sebprt authored Apr 19, 2023
2 parents 73c4006 + c6eda09 commit e3a3baa
Show file tree
Hide file tree
Showing 6 changed files with 67 additions and 13 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/quality.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/rector.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
return (new PhpCsFixer\Config())
->setRiskyAllowed(true)
->setRules([
'@PHP82Migration' => true,
'@PHP81Migration' => true,
'@PHP80Migration:risky' => true,
'@PHPUnit84Migration:risky' => true,
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
62 changes: 57 additions & 5 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions src/Action.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@

use Kiboko\Contract\Action\ActionInterface;
use Kiboko\Contract\Action\ExecutingActionInterface;
use Kiboko\Contract\Action\RunnableInterface;
use Kiboko\Contract\Action\StateInterface;
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(),
) {
}

Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit e3a3baa

Please sign in to comment.