Skip to content

Commit 6fdec13

Browse files
authored
Adds symfony 5 support (#3)
* Adds symfony 5 support * Fix lint errors
1 parent 7aea656 commit 6fdec13

File tree

3 files changed

+5
-9
lines changed

3 files changed

+5
-9
lines changed

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
}
1010
],
1111
"require": {
12-
"php": "^7.1",
12+
"php": "^7.2",
1313
"ext-json": "*",
14-
"symfony/property-access": "^3.4||^4.4",
15-
"symfony/serializer": "^3.4||^4.4"
14+
"symfony/property-access": "^3.4||^4.4||^5.0",
15+
"symfony/serializer": "^3.4||^4.4||^5.0"
1616
},
1717
"require-dev": {
1818
"drupal/coder": "^8.3.8",

src/Counter.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
namespace PNX\Prometheus;
44

5-
use InvalidArgumentException;
6-
75
/**
86
* Value object representing a Prometheus counter type.
97
*/
@@ -31,7 +29,7 @@ public function getType(): string {
3129
*/
3230
public function set($value, array $labels = []) {
3331
if (!$this->isValidValue($value)) {
34-
throw new InvalidArgumentException("A count value must be a positive integer.");
32+
throw new \InvalidArgumentException("A count value must be a positive integer.");
3533
}
3634
$key = $this->getKey($labels);
3735
$this->labelledValues[$key] = new LabelledValue($this->getName(), $value, $labels);

src/Metric.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
namespace PNX\Prometheus;
44

5-
use InvalidArgumentException;
6-
75
/**
86
* Value object to represent a prometheus metric.
97
*/
@@ -98,7 +96,7 @@ public function getLabelledValues() {
9896
*/
9997
protected function validateName($name): void {
10098
if (!preg_match(self::METRIC_NAME_REGEX, $name)) {
101-
throw new InvalidArgumentException("Invalid name: '" . $name . "'");
99+
throw new \InvalidArgumentException("Invalid name: '" . $name . "'");
102100
}
103101
}
104102

0 commit comments

Comments
 (0)