From d7c070b22bc187db45b20937a85fbf01d652ee7c Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sun, 9 Apr 2023 21:29:16 +0300 Subject: [PATCH] make phpstan happy --- backend.php | 6 ++++++ classes/tracer.php | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/backend.php b/backend.php index 9fa30db38..8b3a3e061 100644 --- a/backend.php +++ b/backend.php @@ -52,6 +52,7 @@ header("Content-Type: text/json"); print Errors::to_json(Errors::E_UNAUTHORIZED); + $scope->getSpan()->setTag('error', Errors::E_UNAUTHORIZED); $scope->close(); return; } @@ -60,6 +61,8 @@ if (Config::is_migration_needed()) { print Errors::to_json(Errors::E_SCHEMA_MISMATCH); + + $scope->getSpan()->setTag('error', Errors::E_SCHEMA_MISMATCH); $scope->close(); return; } @@ -122,11 +125,14 @@ user_error("Refusing to invoke method $method of handler $op which starts with underscore.", E_USER_WARNING); header("Content-Type: text/json"); print Errors::to_json(Errors::E_UNAUTHORIZED); + + $scope->getSpan()->setTag('error', Errors::E_UNAUTHORIZED); $scope->close(); return; } if ($override) { + /** @var Plugin|IHandler|ICatchall $handler */ $handler = $override; } else { $reflection = new ReflectionClass($op); diff --git a/classes/tracer.php b/classes/tracer.php index 1326f4344..eb3c58113 100644 --- a/classes/tracer.php +++ b/classes/tracer.php @@ -37,7 +37,7 @@ class Tracer { /** * @param string $name - * @param array $options + * @param array|array> $options * @param array $args * @return Scope */ @@ -51,12 +51,12 @@ class Tracer { /** * @param string $name - * @param array $options + * @param array|array> $options * @param array $args * @return Scope */ public static function start(string $name, array $options = [], array $args = []) : Scope { - return self::get_instance()->_start($name, $options); + return self::get_instance()->_start($name, $options, $args); } public static function get_instance() : Tracer {