Skip to content

Commit d189d71

Browse files
authored
refactor: Fixes strings to prevent PHP 8.2 notices (#140)
PHP 8.2 throws deprecation notices on this string interpolation syntax. Does not affect the environment variable syntax in the config settings. No functional changes, backward compatible with PHP 7.
1 parent c8b67ba commit d189d71

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

examples/InvokableScripts.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
$tables = $scriptsApi->invokeScript($createdScript->getId(), ["bucket_name" => $bucket]);
7575
foreach ($tables as $table) {
7676
foreach ($table->records as $record) {
77-
print "\n${record['time']} ${record['location']}: ${record['_field']} ${record['_value']}";
77+
print "\n{$record['time']} {$record['location']}: {$record['_field']} {$record['_value']}";
7878
}
7979
}
8080

@@ -85,7 +85,7 @@
8585
print "\n------- Invoke to Stream of FluxRecords -------\n";
8686
$records = $scriptsApi->invokeScriptStream($createdScript->getId(), ["bucket_name" => $bucket]);
8787
foreach ($records->each() as $record) {
88-
print "\n${record['time']} ${record['location']}: ${record['_field']} ${record['_value']}";
88+
print "\n{$record['time']} {$record['location']}: {$record['_field']} {$record['_value']}";
8989
}
9090

9191
//
@@ -94,7 +94,7 @@
9494
print "\n";
9595
print "\n------- Invoke to Raw-------\n";
9696
$raw = $scriptsApi->invokeScriptRaw($createdScript->getId(), ["bucket_name" => $bucket]);
97-
print "RAW output:\n\n ${raw}";
97+
print "RAW output:\n\n {$raw}";
9898

9999
//
100100
// List scripts

src/InfluxDB2/DefaultApi.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ function ($v, $k) {
200200
$this->options,
201201
array_keys($this->options)
202202
));
203-
throw new InvalidArgumentException("The '${key}' should be defined as argument or default option: {$options}");
203+
throw new InvalidArgumentException("The '{$key}' should be defined as argument or default option: {$options}");
204204
}
205205
}
206206

src/InfluxDB2/InvokableScriptsApi.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,6 @@ public function invokeScriptRaw(string $scriptId, array $params = null): ?string
133133

134134
private function _invokeScript(ScriptInvocationParams $invocation_params, string $scriptId): StreamInterface
135135
{
136-
return $this->post($invocation_params->__toString(), "/api/v2/scripts/${scriptId}/invoke", [])->getBody();
136+
return $this->post($invocation_params->__toString(), "/api/v2/scripts/{$scriptId}/invoke", [])->getBody();
137137
}
138138
}

0 commit comments

Comments
 (0)