From fe4e3aa5df905f1d65681ad2192c94bef2692680 Mon Sep 17 00:00:00 2001 From: Greg Anderson Date: Mon, 13 Nov 2023 15:12:13 -0800 Subject: [PATCH] Fixed PHP 8.2 deprecations [continuation] (#2514) * Fixed PHP 8.2 deprecations * Fix (unrelated) code style --------- Co-authored-by: Damien McKenna --- src/Config/DefaultsConfig.php | 2 ++ src/Config/DotEnvConfig.php | 2 ++ src/Config/EnvConfig.php | 2 ++ src/Config/YamlConfig.php | 2 ++ src/Request/Request.php | 8 ++++---- 5 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/Config/DefaultsConfig.php b/src/Config/DefaultsConfig.php index fec838fea..8f9b955fe 100644 --- a/src/Config/DefaultsConfig.php +++ b/src/Config/DefaultsConfig.php @@ -15,6 +15,8 @@ class DefaultsConfig extends TerminusConfig */ protected $source_name = 'Default'; + protected $defaults = []; + /** * DefaultsConfig constructor. */ diff --git a/src/Config/DotEnvConfig.php b/src/Config/DotEnvConfig.php index 2d558e577..5c5b4d21a 100644 --- a/src/Config/DotEnvConfig.php +++ b/src/Config/DotEnvConfig.php @@ -13,6 +13,8 @@ class DotEnvConfig extends TerminusConfig */ protected $file; + protected $defaults = []; + /** * DotEnvConfig constructor. */ diff --git a/src/Config/EnvConfig.php b/src/Config/EnvConfig.php index d3ed64ca2..0ea5be2fa 100644 --- a/src/Config/EnvConfig.php +++ b/src/Config/EnvConfig.php @@ -10,6 +10,8 @@ class EnvConfig extends TerminusConfig { protected $source_name = 'Environment Variable'; + protected $defaults = []; + /** * EnvConfig constructor. */ diff --git a/src/Config/YamlConfig.php b/src/Config/YamlConfig.php index 2b5b294c3..5abdbef76 100644 --- a/src/Config/YamlConfig.php +++ b/src/Config/YamlConfig.php @@ -10,6 +10,8 @@ */ class YamlConfig extends TerminusConfig { + protected $defaults = []; + /** * YamlConfig constructor. * @param string $yml_path The path to the yaml file. diff --git a/src/Request/Request.php b/src/Request/Request.php index b2525b8df..60fabfd7a 100755 --- a/src/Request/Request.php +++ b/src/Request/Request.php @@ -70,9 +70,9 @@ class Request implements private static $TRACE_ID = null; - /** - * Generate UUID for use as distributed tracing ID and assign to static class variable - */ + /** + * Generate UUID for use as distributed tracing ID and assign to static class variable + */ public static function generateTraceId() { self::$TRACE_ID = vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(bin2hex(random_bytes(16)), 4)); @@ -193,7 +193,7 @@ private function createRetryDecider(): callable $maxRetries, $logWarning ) { - $logWarningOnRetry = fn(string $reason) => 0 === $retry + $logWarningOnRetry = fn (string $reason) => 0 === $retry ? $logWarning( sprintf( 'HTTP request %s %s has failed: %s',