Skip to content

Commit

Permalink
add function_exists
Browse files Browse the repository at this point in the history
  • Loading branch information
sy-records committed Sep 6, 2020
1 parent d504013 commit 4c06073
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 0 additions & 2 deletions phpstan.neon
Expand Up @@ -41,5 +41,3 @@ parameters:
- '#Method Hyperf\\Utils\\Serializer\\ScalarNormalizer::denormalize\(\) should return array\|object but returns#'
- '#Function get_debug_type invoked with 1 parameter, 0 required#'
- '#gc_status not found#'
- '#Used function getSwooleTracker.* not found#'
- '#Function getSwooleTracker.* not found#'
4 changes: 2 additions & 2 deletions src/swoole-tracker/src/Aspect/CoroutineHandlerAspect.php
Expand Up @@ -42,8 +42,8 @@ public function process(ProceedingJoinPoint $proceedingJoinPoint)
if ($client instanceof Client) {
$client->setHeaders(array_merge(
[
'x-swoole-traceid' => getSwooleTrackerTraceId(),
'x-swoole-spanid' => getSwooleTrackerSpanId(),
'x-swoole-traceid' => function_exists('getSwooleTrackerTraceId') ? getSwooleTrackerTraceId() : '',
'x-swoole-spanid' => function_exists('getSwooleTrackerSpanId') ? getSwooleTrackerSpanId() : '',
],
$client->requestHeaders
));
Expand Down

0 comments on commit 4c06073

Please sign in to comment.