Skip to content

Commit

Permalink
Merge pull request #7 from flownative/task/php8
Browse files Browse the repository at this point in the history
Allow use with PHP 8
  • Loading branch information
robertlemke authored Feb 4, 2022
2 parents d6d0072 + 07bf41c commit 6cc22bb
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Classes/Renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ private function renderSample(SampleCollection $sampleCollection, Sample $sample
{
$labelStatements = [];
foreach ($sample->getLabels() as $labelName => $labelValue) {
$labelStatements[] = $labelName . '="' . $this->escapeLabelValue($labelValue) . '"';
$labelStatements[] = $labelName . '="' . $this->escapeLabelValue((string)$labelValue) . '"';
}
return $sample->getName() . ($labelStatements ? '{' . implode(',', $labelStatements) . '}' : '') . ' ' . $sample->getValue();
}
Expand Down
4 changes: 2 additions & 2 deletions Classes/Storage/AbstractStorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ protected function encodeLabels(array $labels): string
ksort($labels);
$encodedLabels = json_encode($labels);
if ($encodedLabels === false) {
throw new \Exception(json_last_error());
throw new \RuntimeException(json_last_error_msg());
}
return base64_encode($encodedLabels);
}
Expand All @@ -36,7 +36,7 @@ protected function decodeLabels(string $encodedLabels): array
{
$decodedLabels = json_decode(base64_decode($encodedLabels), true);
if ($decodedLabels === NULL) {
throw new \Exception(json_last_error());
throw new \RuntimeException(json_last_error_msg());
}
return $decodedLabels;
}
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
],
"require": {
"neos/flow": "7.* || @dev",
"php": "7.4.*",
"php": "^7.4 || ^8.0",
"ext-zlib": "*",
"predis/predis": "^1.1"
},
Expand Down

0 comments on commit 6cc22bb

Please sign in to comment.