Skip to content

Commit

Permalink
Merge pull request #3 from andrewmy/add-sf7
Browse files Browse the repository at this point in the history
Allow symfony/messenger 7
  • Loading branch information
fjogeleit authored Dec 14, 2023
2 parents 6182cbc + 80ea972 commit d2c4322
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"require": {
"php": ">=7.2.5",
"promphp/prometheus_client_php": "^2.0",
"symfony/messenger": "^5.0|^6.0"
"symfony/messenger": "^5.0 || ^6.0 || ^7.0"
},
"require-dev": {
"roave/security-advisories": "dev-master"
Expand Down
15 changes: 13 additions & 2 deletions src/Exception/InvalidNameException.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,22 @@ class InvalidNameException extends InvalidArgumentException
{
public static function with(string $busName, string $metricName): self
{
// Compatibility with promphp/prometheus_client_php < 2.8.0
if (defined('\Prometheus\Collector::RE_METRIC_LABEL_NAME')) {
return new self(sprintf(
'Invalid character in your BusName %s or MetricName %s, ensure this values pass the following RegEx %s',
$busName,
$metricName,
Collector::RE_METRIC_LABEL_NAME
));
}

return new self(sprintf(
'Invalid character in your BusName %s or MetricName %s, ensure this values pass the following RegEx %s',
'Invalid character in your BusName %s or MetricName %s, ensure the BusName value passes the RegEx %s and MetricName — %s',
$busName,
$metricName,
Collector::RE_METRIC_LABEL_NAME
Collector::RE_LABEL_NAME,
Collector::RE_METRIC_NAME,
));
}
}

0 comments on commit d2c4322

Please sign in to comment.