Skip to content

Commit f532335

Browse files
committed
fix: allow attribute server.port as a return type integer
1 parent 829157c commit f532335

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Instrumentation/Doctrine/src/AttributesResolver.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ final class AttributesResolver
4141
'trino',
4242
];
4343

44-
public static function get(string $attributeName, array $params): string
44+
public static function get(string $attributeName, array $params)
4545
{
4646
$method = 'get' . str_replace('.', '', ucwords($attributeName, '.'));
4747

@@ -63,9 +63,9 @@ private static function getServerAddress(array $params): string
6363
/**
6464
* Resolve attribute `server.port`
6565
*/
66-
private static function getServerPort(array $params): string
66+
private static function getServerPort(array $params): int
6767
{
68-
return $params[1][0]['port'] ?? 'unknown';
68+
return (int)($params[1][0]['port'] ?? null);
6969
}
7070

7171
/**

0 commit comments

Comments
 (0)