Skip to content

Commit 7820516

Browse files
authored
fix: Implicitly marking parameter as nullable is deprecated (#894)
1 parent 5f8da13 commit 7820516

8 files changed

+8
-8
lines changed

src/Tracing/Cache/TraceableCacheAdapterForV2.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function __construct(HubInterface $hub, AdapterInterface $decoratedAdapte
4040
*
4141
* @return mixed
4242
*/
43-
public function get(string $key, callable $callback, float $beta = null, array &$metadata = null)
43+
public function get(string $key, callable $callback, ?float $beta = null, ?array &$metadata = null)
4444
{
4545
return $this->traceFunction('cache.get_item', function () use ($key, $callback, $beta, &$metadata) {
4646
if (!$this->decoratedAdapter instanceof CacheInterface) {

src/Tracing/Cache/TraceableCacheAdapterForV3.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function __construct(HubInterface $hub, AdapterInterface $decoratedAdapte
3838
*
3939
* @param mixed[] $metadata
4040
*/
41-
public function get(string $key, callable $callback, float $beta = null, array &$metadata = null): mixed
41+
public function get(string $key, callable $callback, ?float $beta = null, ?array &$metadata = null): mixed
4242
{
4343
return $this->traceFunction('cache.get_item', function () use ($key, $callback, $beta, &$metadata) {
4444
if (!$this->decoratedAdapter instanceof CacheInterface) {

src/Tracing/Cache/TraceableCacheAdapterTrait.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ public function reset(): void
168168
*
169169
* @phpstan-return TResult
170170
*/
171-
private function traceFunction(string $spanOperation, \Closure $callback, string $spanDescription = null)
171+
private function traceFunction(string $spanOperation, \Closure $callback, ?string $spanDescription = null)
172172
{
173173
$span = $this->hub->getSpan();
174174

src/Tracing/Cache/TraceableTagAwareCacheAdapterForV2.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function __construct(HubInterface $hub, TagAwareAdapterInterface $decorat
4141
*
4242
* @return mixed
4343
*/
44-
public function get(string $key, callable $callback, float $beta = null, array &$metadata = null)
44+
public function get(string $key, callable $callback, ?float $beta = null, ?array &$metadata = null)
4545
{
4646
return $this->traceFunction('cache.get_item', function () use ($key, $callback, $beta, &$metadata) {
4747
if (!$this->decoratedAdapter instanceof CacheInterface) {

src/Tracing/Cache/TraceableTagAwareCacheAdapterForV3.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function __construct(HubInterface $hub, TagAwareAdapterInterface $decorat
3939
*
4040
* @param mixed[] $metadata
4141
*/
42-
public function get(string $key, callable $callback, float $beta = null, array &$metadata = null): mixed
42+
public function get(string $key, callable $callback, ?float $beta = null, ?array &$metadata = null): mixed
4343
{
4444
return $this->traceFunction('cache.get_item', function () use ($key, $callback, $beta, &$metadata) {
4545
if (!$this->decoratedAdapter instanceof CacheInterface) {

src/Tracing/HttpClient/AbstractTraceableHttpClient.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public function request(string $method, string $url, array $options = []): Respo
107107
/**
108108
* {@inheritdoc}
109109
*/
110-
public function stream($responses, float $timeout = null): ResponseStreamInterface
110+
public function stream($responses, ?float $timeout = null): ResponseStreamInterface
111111
{
112112
if ($responses instanceof AbstractTraceableResponse) {
113113
$responses = [$responses];

src/Tracing/HttpClient/TraceableResponseForV6.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ final class TraceableResponseForV6 extends AbstractTraceableResponse implements
1414
/**
1515
* {@inheritdoc}
1616
*/
17-
public function getInfo(string $type = null): mixed
17+
public function getInfo(?string $type = null): mixed
1818
{
1919
return $this->response->getInfo($type);
2020
}

src/Twig/SentryExtension.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ final class SentryExtension extends AbstractExtension
1717
/**
1818
* @param HubInterface $hub The current hub
1919
*/
20-
public function __construct(HubInterface $hub = null)
20+
public function __construct(?HubInterface $hub = null)
2121
{
2222
}
2323

0 commit comments

Comments
 (0)