Skip to content

Commit a18fe4c

Browse files
fix time class (#150)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Refactor** * Updated type hints for constructor parameters to use nullable shorthand for improved code clarity. * Simplified import statements for the Time class across multiple files. * **Chores** * Updated PHP include path configuration to add new vendor directories. <!-- end of auto-generated comment: release notes by coderabbit.ai --> Signed-off-by: Robert Landers <landers.robert@gmail.com>
1 parent f8ddf68 commit a18fe4c

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

.idea/php.xml

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/RetryOptions.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
/*
34
* Copyright ©2024 Robert Landers
45
*
@@ -23,7 +24,7 @@
2324

2425
namespace Bottledcode\DurablePhp;
2526

26-
use Withinboredom\Time\Time;
27+
use Withinboredom\Time;
2728

2829
use function Withinboredom\Time\Hours;
2930

@@ -32,9 +33,9 @@ class RetryOptions
3233
public function __construct(
3334
public Time $firstRetryInterval,
3435
public int $maxNumberAttempts,
35-
public Time|null $maxRetryInterval = null,
36+
public ?Time $maxRetryInterval = null,
3637
public float $backoffCoefficient = 1.0,
37-
public Time|null $retryTimeout = null,
38+
public ?Time $retryTimeout = null,
3839
) {
3940
$this->maxRetryInterval = Hours(1);
4041
$this->retryTimeout = Hours(1);

src/State/Attributes/TimeToLive.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
/*
34
* Copyright ©2024 Robert Landers
45
*
@@ -24,7 +25,7 @@
2425
namespace Bottledcode\DurablePhp\State\Attributes;
2526

2627
use Attribute;
27-
use Withinboredom\Time\Time;
28+
use Withinboredom\Time;
2829

2930
#[Attribute(Attribute::TARGET_CLASS)]
3031
readonly class TimeToLive

0 commit comments

Comments
 (0)