Skip to content

Commit 830e20c

Browse files
committed
replace get_debug_type
1 parent 636c716 commit 830e20c

8 files changed

Lines changed: 10 additions & 12 deletions

File tree

src/Event.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -802,7 +802,7 @@ public function setExceptions(array $exceptions): self
802802
{
803803
foreach ($exceptions as $exception) {
804804
if (!$exception instanceof ExceptionDataBag) {
805-
throw new \UnexpectedValueException(\sprintf('Expected an instance of the "%s" class. Got: "%s".', ExceptionDataBag::class, get_debug_type($exception)));
805+
throw new \UnexpectedValueException(\sprintf('Expected an instance of the "%s" class. Got: "%s".', ExceptionDataBag::class, \gettype($exception)));
806806
}
807807
}
808808

src/EventHint.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,19 +56,19 @@ public static function fromArray(array $hintData): self
5656
$extra = $hintData['extra'] ?? [];
5757

5858
if ($exception !== null && !$exception instanceof \Throwable) {
59-
throw new \InvalidArgumentException(\sprintf('The value of the "exception" field must be an instance of a class implementing the "%s" interface. Got: "%s".', \Throwable::class, get_debug_type($exception)));
59+
throw new \InvalidArgumentException(\sprintf('The value of the "exception" field must be an instance of a class implementing the "%s" interface. Got: "%s".', \Throwable::class, \gettype($exception)));
6060
}
6161

6262
if ($mechanism !== null && !$mechanism instanceof ExceptionMechanism) {
63-
throw new \InvalidArgumentException(\sprintf('The value of the "mechanism" field must be an instance of the "%s" class. Got: "%s".', ExceptionMechanism::class, get_debug_type($mechanism)));
63+
throw new \InvalidArgumentException(\sprintf('The value of the "mechanism" field must be an instance of the "%s" class. Got: "%s".', ExceptionMechanism::class, \gettype($mechanism)));
6464
}
6565

6666
if ($stacktrace !== null && !$stacktrace instanceof Stacktrace) {
67-
throw new \InvalidArgumentException(\sprintf('The value of the "stacktrace" field must be an instance of the "%s" class. Got: "%s".', Stacktrace::class, get_debug_type($stacktrace)));
67+
throw new \InvalidArgumentException(\sprintf('The value of the "stacktrace" field must be an instance of the "%s" class. Got: "%s".', Stacktrace::class, \gettype($stacktrace)));
6868
}
6969

7070
if (!\is_array($extra)) {
71-
throw new \InvalidArgumentException(\sprintf('The value of the "extra" field must be an array. Got: "%s".', get_debug_type($extra)));
71+
throw new \InvalidArgumentException(\sprintf('The value of the "extra" field must be an array. Got: "%s".', \gettype($extra)));
7272
}
7373

7474
$hint->exception = $exception;

src/Integration/IntegrationRegistry.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ private function getIntegrationsToSetup(Options $options): array
123123
$integrations = $userIntegrations($defaultIntegrations);
124124

125125
if (!\is_array($integrations)) {
126-
throw new \UnexpectedValueException(\sprintf('Expected the callback set for the "integrations" option to return a list of integrations. Got: "%s".', get_debug_type($integrations)));
126+
throw new \UnexpectedValueException(\sprintf('Expected the callback set for the "integrations" option to return a list of integrations. Got: "%s".', \gettype($integrations)));
127127
}
128128
}
129129

src/SentryOptionResolver.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,6 @@ class SentryOptionResolver
3737
*/
3838
private $normalizers = [];
3939

40-
/**
41-
* @param array $defaults
42-
*/
4340
public function setDefaults(array $defaults): void
4441
{
4542
$processed = [];

src/Stacktrace.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function __construct(array $frames)
3131

3232
foreach ($frames as $frame) {
3333
if (!$frame instanceof Frame) {
34-
throw new \UnexpectedValueException(\sprintf('Expected an instance of the "%s" class. Got: "%s".', Frame::class, get_debug_type($frame)));
34+
throw new \UnexpectedValueException(\sprintf('Expected an instance of the "%s" class. Got: "%s".', Frame::class, \gettype($frame)));
3535
}
3636
}
3737

src/State/Scope.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ public function getUser(): ?UserDataBag
208208
public function setUser($user): self
209209
{
210210
if (!\is_array($user) && !$user instanceof UserDataBag) {
211-
throw new \TypeError(\sprintf('The $user argument must be either an array or an instance of the "%s" class. Got: "%s".', UserDataBag::class, get_debug_type($user)));
211+
throw new \TypeError(\sprintf('The $user argument must be either an array or an instance of the "%s" class. Got: "%s".', UserDataBag::class, \gettype($user)));
212212
}
213213

214214
if (\is_array($user)) {

src/UserDataBag.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ public function getId()
123123
public function setId($id): self
124124
{
125125
if ($id !== null && !\is_string($id) && !\is_int($id)) {
126-
throw new \UnexpectedValueException(\sprintf('Expected an integer or string value for the $id argument. Got: "%s".', get_debug_type($id)));
126+
throw new \UnexpectedValueException(\sprintf('Expected an integer or string value for the $id argument. Got: "%s".', \gettype($id)));
127127
}
128128

129129
$this->id = $id;

tests/SentryOptionResolverTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,7 @@ public function testDebugLogsProduced()
258258
{
259259
$logger = new class extends AbstractLogger {
260260
private $logs = [];
261+
261262
public function log($level, $message, array $context = []): void
262263
{
263264
$this->logs[] = $message;

0 commit comments

Comments
 (0)