Skip to content

Commit

Permalink
Fixed sentry logger handle (#594)
Browse files Browse the repository at this point in the history
* Get sentry current hub

* CS Fxied

---------

Co-authored-by: hzh <[email protected]>
  • Loading branch information
xuanyanwow and hzh committed Mar 19, 2024
1 parent cfe7d35 commit 0ec2ac7
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
8 changes: 4 additions & 4 deletions output/Hyperf/Collection/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
}

Expand All @@ -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)
{
}

Expand All @@ -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)
{
}

Expand All @@ -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)
{
}
}
4 changes: 2 additions & 2 deletions output/Hyperf/HttpServer/Contract/RequestInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion output/Hyperf/Stringable/Str.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
}

Expand Down
8 changes: 4 additions & 4 deletions src/CollectionMixin.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
}
}
4 changes: 2 additions & 2 deletions src/RequestMixin.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion src/StrMixin.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 0ec2ac7

Please sign in to comment.