Skip to content

Commit c2183e1

Browse files
committed
use property promotion for options
1 parent cf84371 commit c2183e1

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

lib/Providers/Time/HttpTimeProvider.php

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,16 @@
1212
*/
1313
class HttpTimeProvider implements ITimeProvider
1414
{
15-
/** @var array<string, mixed> */
16-
public array $options;
17-
1815
/**
1916
* @param array<string, mixed> $options
2017
*/
2118
public function __construct(
2219
public string $url = 'https://google.com',
2320
public string $expectedtimeformat = 'D, d M Y H:i:s O+',
24-
?array $options = null,
21+
public ?array $options = null,
2522
) {
26-
if ($options === null) {
27-
$options = array(
23+
if ($this->options === null) {
24+
$this->options = array(
2825
'http' => array(
2926
'method' => 'HEAD',
3027
'follow_location' => false,
@@ -39,7 +36,6 @@ public function __construct(
3936
),
4037
);
4138
}
42-
$this->options = $options;
4339
}
4440

4541
/**

0 commit comments

Comments
 (0)