From c2183e16b372bf7c3303d437f00a326ca964771e Mon Sep 17 00:00:00 2001 From: Mark Magyar <14284867+xHeaven@users.noreply.github.com> Date: Sun, 28 May 2023 18:46:07 +0200 Subject: [PATCH] use property promotion for options --- lib/Providers/Time/HttpTimeProvider.php | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/lib/Providers/Time/HttpTimeProvider.php b/lib/Providers/Time/HttpTimeProvider.php index 47058c5..55c20f6 100644 --- a/lib/Providers/Time/HttpTimeProvider.php +++ b/lib/Providers/Time/HttpTimeProvider.php @@ -12,19 +12,16 @@ use Exception; */ class HttpTimeProvider implements ITimeProvider { - /** @var array */ - public array $options; - /** * @param array $options */ public function __construct( public string $url = 'https://google.com', public string $expectedtimeformat = 'D, d M Y H:i:s O+', - ?array $options = null, + public ?array $options = null, ) { - if ($options === null) { - $options = array( + if ($this->options === null) { + $this->options = array( 'http' => array( 'method' => 'HEAD', 'follow_location' => false, @@ -39,7 +36,6 @@ class HttpTimeProvider implements ITimeProvider ), ); } - $this->options = $options; } /**