Skip to content

Commit

Permalink
Adds symfony 5 support (#3)
Browse files Browse the repository at this point in the history
* Adds symfony 5 support
* Fix lint errors
  • Loading branch information
kimpepper authored Jan 6, 2021
1 parent 7aea656 commit 6fdec13
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
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

0 comments on commit 6fdec13

Please sign in to comment.