Skip to content

Commit

Permalink
Updated code to be compatible with php-etl/action-contracts:0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
gplanchat committed Nov 21, 2023
1 parent a4ef866 commit cbf14e1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/ActionState.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,27 @@ final class ActionState implements StateInterface
{
private string $status = 'pending';

public function __construct(
private readonly StateInterface $decorated
) {
}

public function initialize(): void
{
$this->status = 'running';
$this->decorated?->initialize();

Check failure on line 21 in src/ActionState.php

View workflow job for this annotation

GitHub Actions / phpstan

Using nullsafe method call on non-nullable type Kiboko\Contract\Action\StateInterface. Use -> instead.

Check failure on line 21 in src/ActionState.php

View workflow job for this annotation

GitHub Actions / phpstan

Using nullsafe method call on non-nullable type Kiboko\Contract\Action\StateInterface. Use -> instead.

Check failure on line 21 in src/ActionState.php

View workflow job for this annotation

GitHub Actions / phpstan

Using nullsafe method call on non-nullable type Kiboko\Contract\Action\StateInterface. Use -> instead.

Check failure on line 21 in src/ActionState.php

View workflow job for this annotation

GitHub Actions / phpstan

Using nullsafe method call on non-nullable type Kiboko\Contract\Action\StateInterface. Use -> instead.

Check failure on line 21 in src/ActionState.php

View workflow job for this annotation

GitHub Actions / phpstan

Using nullsafe method call on non-nullable type Kiboko\Contract\Action\StateInterface. Use -> instead.

Check failure on line 21 in src/ActionState.php

View workflow job for this annotation

GitHub Actions / phpstan

Using nullsafe method call on non-nullable type Kiboko\Contract\Action\StateInterface. Use -> instead.

Check failure on line 21 in src/ActionState.php

View workflow job for this annotation

GitHub Actions / phpstan

Using nullsafe method call on non-nullable type Kiboko\Contract\Action\StateInterface. Use -> instead.

Check failure on line 21 in src/ActionState.php

View workflow job for this annotation

GitHub Actions / phpstan

Using nullsafe method call on non-nullable type Kiboko\Contract\Action\StateInterface. Use -> instead.
}

public function success(): void
{
$this->status = 'success';
$this->decorated?->success();

Check failure on line 27 in src/ActionState.php

View workflow job for this annotation

GitHub Actions / phpstan

Using nullsafe method call on non-nullable type Kiboko\Contract\Action\StateInterface. Use -> instead.

Check failure on line 27 in src/ActionState.php

View workflow job for this annotation

GitHub Actions / phpstan

Using nullsafe method call on non-nullable type Kiboko\Contract\Action\StateInterface. Use -> instead.

Check failure on line 27 in src/ActionState.php

View workflow job for this annotation

GitHub Actions / phpstan

Using nullsafe method call on non-nullable type Kiboko\Contract\Action\StateInterface. Use -> instead.

Check failure on line 27 in src/ActionState.php

View workflow job for this annotation

GitHub Actions / phpstan

Using nullsafe method call on non-nullable type Kiboko\Contract\Action\StateInterface. Use -> instead.

Check failure on line 27 in src/ActionState.php

View workflow job for this annotation

GitHub Actions / phpstan

Using nullsafe method call on non-nullable type Kiboko\Contract\Action\StateInterface. Use -> instead.

Check failure on line 27 in src/ActionState.php

View workflow job for this annotation

GitHub Actions / phpstan

Using nullsafe method call on non-nullable type Kiboko\Contract\Action\StateInterface. Use -> instead.

Check failure on line 27 in src/ActionState.php

View workflow job for this annotation

GitHub Actions / phpstan

Using nullsafe method call on non-nullable type Kiboko\Contract\Action\StateInterface. Use -> instead.

Check failure on line 27 in src/ActionState.php

View workflow job for this annotation

GitHub Actions / phpstan

Using nullsafe method call on non-nullable type Kiboko\Contract\Action\StateInterface. Use -> instead.
}

public function failure(): void
{
$this->status = 'failure';
$this->decorated?->failure();

Check failure on line 33 in src/ActionState.php

View workflow job for this annotation

GitHub Actions / phpstan

Using nullsafe method call on non-nullable type Kiboko\Contract\Action\StateInterface. Use -> instead.

Check failure on line 33 in src/ActionState.php

View workflow job for this annotation

GitHub Actions / phpstan

Using nullsafe method call on non-nullable type Kiboko\Contract\Action\StateInterface. Use -> instead.

Check failure on line 33 in src/ActionState.php

View workflow job for this annotation

GitHub Actions / phpstan

Using nullsafe method call on non-nullable type Kiboko\Contract\Action\StateInterface. Use -> instead.

Check failure on line 33 in src/ActionState.php

View workflow job for this annotation

GitHub Actions / phpstan

Using nullsafe method call on non-nullable type Kiboko\Contract\Action\StateInterface. Use -> instead.

Check failure on line 33 in src/ActionState.php

View workflow job for this annotation

GitHub Actions / phpstan

Using nullsafe method call on non-nullable type Kiboko\Contract\Action\StateInterface. Use -> instead.

Check failure on line 33 in src/ActionState.php

View workflow job for this annotation

GitHub Actions / phpstan

Using nullsafe method call on non-nullable type Kiboko\Contract\Action\StateInterface. Use -> instead.

Check failure on line 33 in src/ActionState.php

View workflow job for this annotation

GitHub Actions / phpstan

Using nullsafe method call on non-nullable type Kiboko\Contract\Action\StateInterface. Use -> instead.

Check failure on line 33 in src/ActionState.php

View workflow job for this annotation

GitHub Actions / phpstan

Using nullsafe method call on non-nullable type Kiboko\Contract\Action\StateInterface. Use -> instead.
}

public function observeState(): callable
Expand Down

0 comments on commit cbf14e1

Please sign in to comment.