Skip to content

Commit

Permalink
update for php 8.3 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
dbhynds committed Jan 12, 2024
1 parent a503bf4 commit 1619633
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion demo.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public function __construct()
'demo.log'
]);

echo "Logging to ${logFile}\n";
echo "Logging to {$logFile}\n";

LoggerFactory::setup((new MonologLoggerFactory())
->setDefaultHandlers([
Expand Down
2 changes: 1 addition & 1 deletion src/Rox/Core/CustomProperties/DeviceProperty.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ class DeviceProperty extends CustomProperty
public function getName()
{
$name = parent::getName();
return "rox.${name}";
return "rox.{$name}";
}
}
4 changes: 2 additions & 2 deletions src/Rox/Core/Entities/RoxStringBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ protected function checkValueType($value)
{
$converter = $this->getConverter();
if (!$converter->isValid($value)) {
throw new InvalidArgumentException("Invalid value type: ${value}");
throw new InvalidArgumentException("Invalid value type: {$value}");
}
return $converter->convertToString($value);
}
Expand All @@ -107,7 +107,7 @@ protected function checkVariationsType(array $variations)
return !$converter->isValid($value);
})) {
$invalidValue = array_shift($invalidVariations);
throw new InvalidArgumentException("Invalid variation type: ${invalidValue}");
throw new InvalidArgumentException("Invalid variation type: {$invalidValue}");
}
return array_map(function ($v) use ($converter) {
return $converter->convertToString($v);
Expand Down
4 changes: 2 additions & 2 deletions src/Rox/Core/Network/GuzzleHttpClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ function postJson($uri, array $data)
RequestOptions::TIMEOUT => $this->_timeout,
]));
} catch (GuzzleException $e) {
$this->_log->error("Failed to send data to ${uri}: {$e->getMessage()}", [
$this->_log->error("Failed to send data to {$uri}: {$e->getMessage()}", [
'exception' => $e
]);
return new HttpErrorResponse($e->getCode(), $e->getMessage());
Expand All @@ -142,7 +142,7 @@ function postJson($uri, array $data)
*/
private function _handleError($uri, GuzzleException $e)
{
$this->_log->error("Failed to send data to ${uri}: {$e->getMessage()}", [
$this->_log->error("Failed to send data to {$uri}: {$e->getMessage()}", [
'exception' => $e
]);
return new HttpErrorResponse($e->getCode(), $e->getMessage());
Expand Down
6 changes: 3 additions & 3 deletions src/Rox/Core/Register/Registerer.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,17 @@ public function registerInstance($container, $ns)
}
} catch (ReflectionException $e) {
$type = get_class($container);
$this->_log->error("Failed to obtain properties of class ${type}", [
$this->_log->error("Failed to obtain properties of class {$type}", [
'exception' => $e
]);
throw new RuntimeException(
"Failed to obtain properties of class ${type}. See inner exception for details.", 0, $e);
"Failed to obtain properties of class {$type}. See inner exception for details.", 0, $e);
}

foreach ($properties as $name => $value) {
if ($value instanceof RoxStringBase) {
if ($ns) {
$name = "${ns}.${name}";
$name = "{$ns}.{$name}";
}
$this->_flagRepository->addFlag($value, $name);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Rox/Core/Roxx/ExperimentsExtensions.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function extend()
$this->_parser->addOperator("mergeSeed", function (ParserInterface $parser, StackInterface $stack, ContextInterface $context) {
$seed1 = (string)$stack->pop();
$seed2 = (string)$stack->pop();
$stack->push("${seed1}.${seed2}");
$stack->push("{$seed1}.{$seed2}");
});

$this->_parser->addOperator("isInPercentage", function (ParserInterface $parser, StackInterface $stack, ContextInterface $context) {
Expand Down
2 changes: 1 addition & 1 deletion src/Rox/Core/Roxx/Parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ public function evaluateExpression($expression, $context = null, $evaluationCont

} catch (Exception $exception) {

$this->_log->warning("Roxx Exception: Failed evaluate expression ${expression}", [
$this->_log->warning("Roxx Exception: Failed evaluate expression {$expression}", [
'exception' => $exception
]);
}
Expand Down
4 changes: 2 additions & 2 deletions src/Rox/Core/Roxx/RegularExpressionExtensions.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ function (ParserInterface $parser, StackInterface $stack, ContextInterface $cont
}

if ($flag == 'n') {
$this->_log->warning("Regexp flag ${flag} is not supported.");
$this->_log->warning("Regexp flag {$flag} is not supported.");
}
}

$stack->push(preg_match("/${pattern}/${filteredFlags}", $str) === 1);
$stack->push(preg_match("/{$pattern}/{$filteredFlags}", $str) === 1);
});
}
}
2 changes: 1 addition & 1 deletion src/Rox/Core/XPack/Analytics/AnalyticsClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ private function _flushBatch(array $messages)
if (200 == $statusCode) {
return true;
}
$this->_log->error("Failed to post data to ${url}: HTTP response code ${statusCode} ({$response->getContent()->readAsString()})");
$this->_log->error("Failed to post data to {$url}: HTTP response code {$statusCode} ({$response->getContent()->readAsString()})");

return false;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Rox/Core/XPack/Security/XSignatureVerifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function verify($data, $signatureBase64)
return true;
}
$cert = chunk_split(self::ROXCertificateBase64);
$publicKey = openssl_pkey_get_public("-----BEGIN CERTIFICATE-----\n${cert}-----END CERTIFICATE-----");
$publicKey = openssl_pkey_get_public("-----BEGIN CERTIFICATE-----\n{$cert}-----END CERTIFICATE-----");
$signature = base64_decode($signatureBase64);
return openssl_verify($data, $signature, $publicKey, OPENSSL_ALGO_SHA256) === 1;
}
Expand Down

0 comments on commit 1619633

Please sign in to comment.