Skip to content

Commit

Permalink
Fix empty spans (openzipkin#122)
Browse files Browse the repository at this point in the history
* fix empty spans

* Uses `count` instead of `empty` as it is not recommended in PHP 7.x
  • Loading branch information
jcchavezs authored Jul 30, 2019
1 parent b1188c9 commit fe8a275
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Zipkin/Reporters/Http.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ public function __construct(
*/
public function report(array $spans)
{
if (count($spans) === 0) {
return;
}

$payload = json_encode(array_map(function (Span $span) {
return $span->toArray();
}, $spans));
Expand Down

0 comments on commit fe8a275

Please sign in to comment.