Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
}
],
"require": {
"php": "^7.1",
"php": "^7.2",
"ext-json": "*",
"symfony/property-access": "^3.4||^4.4",
"symfony/serializer": "^3.4||^4.4"
"symfony/property-access": "^3.4||^4.4||^5.0",
"symfony/serializer": "^3.4||^4.4||^5.0"
},
"require-dev": {
"drupal/coder": "^8.3.8",
Expand Down
4 changes: 1 addition & 3 deletions src/Counter.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

namespace PNX\Prometheus;

use InvalidArgumentException;

/**
* Value object representing a Prometheus counter type.
*/
Expand Down Expand Up @@ -31,7 +29,7 @@ public function getType(): string {
*/
public function set($value, array $labels = []) {
if (!$this->isValidValue($value)) {
throw new InvalidArgumentException("A count value must be a positive integer.");
throw new \InvalidArgumentException("A count value must be a positive integer.");
}
$key = $this->getKey($labels);
$this->labelledValues[$key] = new LabelledValue($this->getName(), $value, $labels);
Expand Down
4 changes: 1 addition & 3 deletions src/Metric.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

namespace PNX\Prometheus;

use InvalidArgumentException;

/**
* Value object to represent a prometheus metric.
*/
Expand Down Expand Up @@ -98,7 +96,7 @@ public function getLabelledValues() {
*/
protected function validateName($name): void {
if (!preg_match(self::METRIC_NAME_REGEX, $name)) {
throw new InvalidArgumentException("Invalid name: '" . $name . "'");
throw new \InvalidArgumentException("Invalid name: '" . $name . "'");
}
}

Expand Down