Skip to content

Commit

Permalink
Merge pull request #12 from websupport-sk/updateOpenTracing
Browse files Browse the repository at this point in the history
Updated open tracing to stable, updated phpunit
  • Loading branch information
pistej authored Feb 24, 2021
2 parents cd1753c + f27a94b commit 3dd3c23
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 12 deletions.
5 changes: 2 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
language: php

php:
- '7.0'
- '7.1'
- '7.2'
- '7.3'
- '7.4'

before_install:
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
Expand All @@ -17,7 +16,7 @@ before_script:
- ./cc-test-reporter before-build

script:
- ./vendor/bin/phpunit --coverage-clover clover.xml
- XDEBUG_MODE=coverage ./vendor/bin/phpunit --coverage-clover clover.xml

after_script:
- ./cc-test-reporter after-build --coverage-input-type clover --exit-code $TRAVIS_TEST_RESULT
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
],
"license": "BSD-3-Clause",
"require": {
"php": ">=7.0",
"opentracing/opentracing": "^1.0.0@dev",
"php": ">=7.2",
"opentracing/opentracing": "^1.0.0",
"ralouphie/getallheaders": "^2.0 || ^3.0",
"yiisoft/yii": "^1.1.18"
},
Expand All @@ -22,7 +22,7 @@
},
"require-dev": {
"jonahgeorge/jaeger-client-php": "dev-master",
"phpunit/phpunit": "^6.5.14",
"phpunit/phpunit": "^8.5.0",
"roave/security-advisories": "dev-master"
},
"suggest": {
Expand Down
11 changes: 8 additions & 3 deletions src/OpenTracing.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

namespace Websupport\OpenTracing;

use OpenTracing\Exceptions\UnsupportedFormat;
use OpenTracing\Formats;
use OpenTracing\GlobalTracer;
use OpenTracing\NoopTracer;
use OpenTracing\Scope;
use OpenTracing\Span;
use OpenTracing\Tracer;
use OpenTracing\UnsupportedFormatException;
use Yii;

class OpenTracing extends \CApplicationComponent
Expand Down Expand Up @@ -48,7 +48,7 @@ public function init()
*/
protected function initTracer()
{
$this->setTracer(NoopTracer::create());
$this->setTracer(new NoopTracer());
}

/**
Expand All @@ -72,6 +72,7 @@ public function getTracer()

/**
* @param Tracer $tracer
*
* @return $this
*/
public function setTracer(Tracer $tracer)
Expand All @@ -85,6 +86,7 @@ public function setTracer(Tracer $tracer)
/**
* @param string $operationName
* @param array $options
*
* @return Scope
*/
public function startActiveSpan(string $operationName, array $options = [])
Expand All @@ -99,7 +101,8 @@ public function startActiveSpan(string $operationName, array $options = [])
/**
* @param string $format
* @param mixed $carrier
* @throws UnsupportedFormat
*
* @throws UnsupportedFormatException
*/
public function injectActiveSpan(string $format, &$carrier)
{
Expand Down Expand Up @@ -196,6 +199,7 @@ private function setSentryTag(Span $span)

/**
* @param \CEvent $event
*
* @return string
*/
private function operationNameFromBeginRequestEvent(\CEvent $event)
Expand All @@ -216,6 +220,7 @@ private function operationNameFromBeginRequestEvent(\CEvent $event)

/**
* @param \CEvent $event
*
* @return array
*/
private function spanOptionsFromBeginRequestEvent(\CEvent $event)
Expand Down
2 changes: 1 addition & 1 deletion tests/ActiveRecordBehaviorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public function testTraceDelete()
$activeRecord->delete();
}

protected function setUp()
protected function setUp(): void
{
parent::setUp();

Expand Down
2 changes: 1 addition & 1 deletion tests/Support/TestCase/DatabaseIntegrationTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

abstract class DatabaseIntegrationTestCase extends TestCase
{
protected function setUp()
protected function setUp():void
{
parent::setUp();

Expand Down
2 changes: 1 addition & 1 deletion tests/Support/TestCase/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

abstract class TestCase extends \PHPUnit\Framework\TestCase
{
protected function tearDown()
protected function tearDown(): void
{
$this->destroyApplication();

Expand Down

0 comments on commit 3dd3c23

Please sign in to comment.