From 0ec2ac76d88f87a177b4fd18e0ba0c61e4464bf1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=A3=E8=A8=80=E5=B0=B1=E6=98=AFSiam?= <59419979@qq.com> Date: Tue, 19 Mar 2024 17:04:52 +0800 Subject: [PATCH] Fixed sentry logger handle (#594) * Get sentry current hub * CS Fxied --------- Co-authored-by: hzh --- output/Hyperf/Collection/Collection.php | 8 ++++---- output/Hyperf/HttpServer/Contract/RequestInterface.php | 4 ++-- output/Hyperf/Stringable/Str.php | 2 +- src/CollectionMixin.php | 8 ++++---- src/RequestMixin.php | 4 ++-- src/StrMixin.php | 2 +- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/output/Hyperf/Collection/Collection.php b/output/Hyperf/Collection/Collection.php index 77531a1..d2f9ef3 100644 --- a/output/Hyperf/Collection/Collection.php +++ b/output/Hyperf/Collection/Collection.php @@ -201,7 +201,7 @@ public function value($key, $default = null) * @param (callable($this): TWhenEmptyReturnType)|null $default * @return $this|TWhenEmptyReturnType */ - public function whenEmpty(callable $callback, callable $default = null) + public function whenEmpty(callable $callback, ?callable $default = null) { } @@ -214,7 +214,7 @@ public function whenEmpty(callable $callback, callable $default = null) * @param (callable($this): TWhenNotEmptyReturnType)|null $default * @return $this|TWhenNotEmptyReturnType */ - public function whenNotEmpty(callable $callback, callable $default = null) + public function whenNotEmpty(callable $callback, ?callable $default = null) { } @@ -227,7 +227,7 @@ public function whenNotEmpty(callable $callback, callable $default = null) * @param (callable($this): TUnlessEmptyReturnType)|null $default * @return $this|TUnlessEmptyReturnType */ - public function unlessEmpty(callable $callback, callable $default = null) + public function unlessEmpty(callable $callback, ?callable $default = null) { } @@ -240,7 +240,7 @@ public function unlessEmpty(callable $callback, callable $default = null) * @param (callable($this): TUnlessNotEmptyReturnType)|null $default * @return $this|TUnlessNotEmptyReturnType */ - public function unlessNotEmpty(callable $callback, callable $default = null) + public function unlessNotEmpty(callable $callback, ?callable $default = null) { } } diff --git a/output/Hyperf/HttpServer/Contract/RequestInterface.php b/output/Hyperf/HttpServer/Contract/RequestInterface.php index ce9ecd5..6bee7ea 100644 --- a/output/Hyperf/HttpServer/Contract/RequestInterface.php +++ b/output/Hyperf/HttpServer/Contract/RequestInterface.php @@ -142,14 +142,14 @@ public function wantsJson(): bool; * * @return $this|mixed */ - public function whenFilled(string $key, callable $callback, callable $default = null); + public function whenFilled(string $key, callable $callback, ?callable $default = null); /** * Apply the callback if the request contains the given input item key. * * @return $this|mixed */ - public function whenHas(string $key, callable $callback, callable $default = null); + public function whenHas(string $key, callable $callback, ?callable $default = null); /** * Determine if the request is sending JSON. diff --git a/output/Hyperf/Stringable/Str.php b/output/Hyperf/Stringable/Str.php index e47f4eb..3202ff6 100644 --- a/output/Hyperf/Stringable/Str.php +++ b/output/Hyperf/Stringable/Str.php @@ -28,7 +28,7 @@ public static function apa($value) /** * Set the callable that will be used to generate UUIDs. */ - public static function createUuidsUsing(callable $factory = null) + public static function createUuidsUsing(?callable $factory = null) { } diff --git a/src/CollectionMixin.php b/src/CollectionMixin.php index f823f56..08eb702 100644 --- a/src/CollectionMixin.php +++ b/src/CollectionMixin.php @@ -188,21 +188,21 @@ public function value() public function whenEmpty() { - return fn (callable $callback, callable $default = null) => $this->when($this->isEmpty(), $callback, $default); + return fn (callable $callback, ?callable $default = null) => $this->when($this->isEmpty(), $callback, $default); } public function whenNotEmpty() { - return fn (callable $callback, callable $default = null) => $this->when($this->isNotEmpty(), $callback, $default); + return fn (callable $callback, ?callable $default = null) => $this->when($this->isNotEmpty(), $callback, $default); } public function unlessEmpty() { - return fn (callable $callback, callable $default = null) => $this->whenNotEmpty($callback, $default); /* @phpstan-ignore-line */ + return fn (callable $callback, ?callable $default = null) => $this->whenNotEmpty($callback, $default); /* @phpstan-ignore-line */ } public function unlessNotEmpty() { - return fn (callable $callback, callable $default = null) => $this->whenEmpty($callback, $default); /* @phpstan-ignore-line */ + return fn (callable $callback, ?callable $default = null) => $this->whenEmpty($callback, $default); /* @phpstan-ignore-line */ } } diff --git a/src/RequestMixin.php b/src/RequestMixin.php index 7b69f8b..9421f81 100644 --- a/src/RequestMixin.php +++ b/src/RequestMixin.php @@ -309,7 +309,7 @@ public function wantsJson() public function whenFilled() { - return function ($key, callable $callback, callable $default = null) { + return function ($key, callable $callback, ?callable $default = null) { if ($this->filled($key)) { return $callback(data_get($this->all(), $key)) ?: $this; } @@ -324,7 +324,7 @@ public function whenFilled() public function whenHas() { - return function ($key, callable $callback, callable $default = null) { + return function ($key, callable $callback, ?callable $default = null) { if ($this->has($key)) { return $callback(data_get($this->all(), $key)) ?: $this; } diff --git a/src/StrMixin.php b/src/StrMixin.php index 6f92b4d..7ad965a 100644 --- a/src/StrMixin.php +++ b/src/StrMixin.php @@ -76,7 +76,7 @@ public function createUuidsNormally() public function createUuidsUsing() { - return fn (callable $factory = null) => UuidContainer::$uuidFactory = $factory; + return fn (?callable $factory = null) => UuidContainer::$uuidFactory = $factory; } public function headline()