diff --git a/.travis.yml b/.travis.yml index 4769405..74d10cd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 @@ -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 diff --git a/composer.json b/composer.json index 34b830e..6f7821d 100644 --- a/composer.json +++ b/composer.json @@ -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" }, @@ -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": { diff --git a/src/OpenTracing.php b/src/OpenTracing.php index 44a2342..e507ef3 100644 --- a/src/OpenTracing.php +++ b/src/OpenTracing.php @@ -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 @@ -48,7 +48,7 @@ public function init() */ protected function initTracer() { - $this->setTracer(NoopTracer::create()); + $this->setTracer(new NoopTracer()); } /** @@ -72,6 +72,7 @@ public function getTracer() /** * @param Tracer $tracer + * * @return $this */ public function setTracer(Tracer $tracer) @@ -85,6 +86,7 @@ public function setTracer(Tracer $tracer) /** * @param string $operationName * @param array $options + * * @return Scope */ public function startActiveSpan(string $operationName, array $options = []) @@ -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) { @@ -196,6 +199,7 @@ private function setSentryTag(Span $span) /** * @param \CEvent $event + * * @return string */ private function operationNameFromBeginRequestEvent(\CEvent $event) @@ -216,6 +220,7 @@ private function operationNameFromBeginRequestEvent(\CEvent $event) /** * @param \CEvent $event + * * @return array */ private function spanOptionsFromBeginRequestEvent(\CEvent $event) diff --git a/tests/ActiveRecordBehaviorTest.php b/tests/ActiveRecordBehaviorTest.php index c30b2f3..caab51e 100644 --- a/tests/ActiveRecordBehaviorTest.php +++ b/tests/ActiveRecordBehaviorTest.php @@ -74,7 +74,7 @@ public function testTraceDelete() $activeRecord->delete(); } - protected function setUp() + protected function setUp(): void { parent::setUp(); diff --git a/tests/Support/TestCase/DatabaseIntegrationTestCase.php b/tests/Support/TestCase/DatabaseIntegrationTestCase.php index 8191343..4cbd3d6 100644 --- a/tests/Support/TestCase/DatabaseIntegrationTestCase.php +++ b/tests/Support/TestCase/DatabaseIntegrationTestCase.php @@ -6,7 +6,7 @@ abstract class DatabaseIntegrationTestCase extends TestCase { - protected function setUp() + protected function setUp():void { parent::setUp(); diff --git a/tests/Support/TestCase/TestCase.php b/tests/Support/TestCase/TestCase.php index 5d14d49..f09fb6d 100644 --- a/tests/Support/TestCase/TestCase.php +++ b/tests/Support/TestCase/TestCase.php @@ -6,7 +6,7 @@ abstract class TestCase extends \PHPUnit\Framework\TestCase { - protected function tearDown() + protected function tearDown(): void { $this->destroyApplication();