Skip to content

Commit cb92fdc

Browse files
committed
Code style fixes
1 parent fbc3017 commit cb92fdc

12 files changed

Lines changed: 47 additions & 47 deletions

src/Client/ClientInterface.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
interface ClientInterface
99
{
10-
public function add(SpanInterface $span) : ClientInterface;
10+
public function add(SpanInterface $span): ClientInterface;
1111

12-
public function flush() : ClientInterface;
12+
public function flush(): ClientInterface;
1313
}

src/Codec/CodecInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
interface CodecInterface
99
{
10-
public function decode($data) : ?SpanContext;
10+
public function decode($data): ?SpanContext;
1111

1212
public function encode(SpanContext $context);
1313
}

src/Codec/TextCodec.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,6 @@
77

88
class TextCodec implements CodecInterface
99
{
10-
public function convertInt64(string $hex): int
11-
{
12-
$hex8byte = str_pad($hex, 16, '0', STR_PAD_LEFT);
13-
14-
return unpack('Jint64', pack('H*', $hex8byte))['int64'];
15-
}
16-
1710
public function decode($data): ?SpanContext
1811
{
1912
if (false === is_string($data)) {
@@ -32,6 +25,13 @@ public function decode($data): ?SpanContext
3225
);
3326
}
3427

28+
public function convertInt64(string $hex): int
29+
{
30+
$hex8byte = str_pad($hex, 16, '0', STR_PAD_LEFT);
31+
32+
return unpack('Jint64', pack('H*', $hex8byte))['int64'];
33+
}
34+
3535
public function encode(SpanContext $context)
3636
{
3737
return sprintf(

src/Id/IdGeneratorInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55

66
interface IdGeneratorInterface
77
{
8-
public function next() : int;
8+
public function next(): int;
99
}

src/Sampler/AbstractSampler.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77

88
abstract class AbstractSampler implements SamplerInterface
99
{
10-
abstract public function doDecide(int $tracerId, string $operationName): SamplerResult;
11-
1210
public function decide(int $traceId, string $operationName, string $debugId): SamplerResult
1311
{
1412
if ('' === $debugId) {
@@ -27,4 +25,6 @@ public function decide(int $traceId, string $operationName, string $debugId): Sa
2725
]
2826
);
2927
}
28+
29+
abstract public function doDecide(int $tracerId, string $operationName): SamplerResult;
3030
}

src/Sampler/SamplerInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55

66
interface SamplerInterface
77
{
8-
public function decide(int $traceId, string $operationName, string $debugId) : SamplerResult;
8+
public function decide(int $traceId, string $operationName, string $debugId): SamplerResult;
99
}

src/Sampler/SamplerResult.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public function __construct(bool $sampled, int $flags, array $tags = [])
1818
$this->tags = $tags;
1919
}
2020

21-
public function getFlags() : int
21+
public function getFlags(): int
2222
{
2323
return $this->flags;
2424
}

src/Span/Context/SpanContext.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public function getFlags(): int
5454
return $this->flags;
5555
}
5656

57-
public function getBaggage() : array
57+
public function getBaggage(): array
5858
{
5959
return $this->baggage;
6060
}

src/Span/Span.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33

44
namespace Jaeger\Span;
55

6+
use Jaeger\Span\Context\SpanContext;
67
use Jaeger\Tag\ErrorTag;
78
use Jaeger\Tag\OutOfScopeTag;
89
use Jaeger\Thrift\Log;
910
use Jaeger\Thrift\Tag;
10-
use Jaeger\Span\Context\SpanContext;
1111
use Jaeger\Tracer\TracerInterface;
1212

1313
class Span extends \Jaeger\Thrift\Span implements SpanInterface
@@ -62,7 +62,7 @@ public function isSampled(): bool
6262
return (bool)($this->flags & 1);
6363
}
6464

65-
public function start(int $startTimeUsec) : SpanInterface
65+
public function start(int $startTimeUsec): SpanInterface
6666
{
6767
$this->startTime = $startTimeUsec;
6868

src/Span/SpanInterface.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33

44
namespace Jaeger\Span;
55

6+
use Jaeger\Span\Context\ContextAwareInterface;
67
use Jaeger\Thrift\Log;
78
use Jaeger\Thrift\Tag;
8-
use Jaeger\Span\Context\ContextAwareInterface;
99

1010
interface SpanInterface extends ContextAwareInterface
1111
{
12-
public function start(int $startTimeUsec) : SpanInterface;
12+
public function start(int $startTimeUsec): SpanInterface;
1313

14-
public function finish(int $durationUsec = 0) : SpanInterface;
14+
public function finish(int $durationUsec = 0): SpanInterface;
1515

1616
public function addTag(Tag $tag): SpanInterface;
1717

0 commit comments

Comments
 (0)