Skip to content

Commit

Permalink
well..
Browse files Browse the repository at this point in the history
  • Loading branch information
simPod committed Jul 10, 2020
1 parent 115d36f commit 0c3d771
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/Transport/ValueParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,11 @@ public static function parse(string $rawValue)
case 'Counter64':
case 'IpAddress':
case 'OID':
case 'STRING':
return $value;
case 'Hex-STRING':
return str_replace("\n", '', $value);
case 'STRING':
return substr($value, 1, -1);
case 'INTEGER':
case 'Counter32':
case 'Gauge32':
Expand Down
2 changes: 1 addition & 1 deletion tests/Transport/ValueParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function providerParse() : iterable
yield 'Hex-STRING' => ['Hex-STRING: A1 B2 C3', 'A1 B2 C3'];
yield 'IpAddress' => ['IpAddress: 127.0.0.1', '127.0.0.1'];
yield 'OID' => ['OID: .1.2.3', '.1.2.3'];
yield 'STRING' => ['STRING: "abc"', '"abc"'];
yield 'STRING' => ['STRING: "abc"', 'abc'];
yield 'STRING 2' => ['STRING: Intel(R) Xeon(R) CPU D-1527 @ 2.20GHz', 'Intel(R) Xeon(R) CPU D-1527 @ 2.20GHz'];
yield 'empty string' => ['""', ''];
yield 'INTEGER' => ['INTEGER: 123', 123];
Expand Down

0 comments on commit 0c3d771

Please sign in to comment.