-
Removed the
HubInterface::getCurrentHub()
andHubInterface::setCurrentHub()
methods. UseSentrySdk::getCurrentHub()
andSentrySdk::setCurrentHub()
instead -
Removed the
ErrorHandler::registerOnce()
method, useErrorHandler::register*Handler()
instead -
Removed the
ErrorHandler::addErrorListener
method, useErrorHandler::addErrorHandlerListener()
instead -
Removed the
ErrorHandler::addFatalErrorListener
method, useErrorHandler::addFatalErrorHandlerListener()
instead -
Removed the
ErrorHandler::addExceptionListener
method, useErrorHandler::addExceptionHandlerListener()
instead -
The signature of the
ErrorListenerIntegration::__construct()
method changed to not accept any parameter -
The signature of the
FatalErrorListenerIntegration::__construct()
method changed to not accept any parameter -
The
ErrorListenerIntegration
integration does not get called anymore when a fatal error occurs -
The default value of the
error_types
option changed to the value get fromerror_reporting()
-
The signature of the
capture*()
global functions changed to return an instance of theEventId
class instead of astring
-
The signature of the
ClientInterface::capture*()
methods changed to return an instance of theEventId
class instead of astring
-
The signature of the
HubInterface::capture*e()
methods changed to return an instance of theEventId
class instead of astring
-
The signature of the
Event::getId()
method changed to return an instance of theEventId
class instead of astring
-
The signature of the
Options::getDsn()
method changed to always return an instance of theDsn
class instead of astring
-
Removed the
Options::getProjectId
,Options::getPublicKey
andOptions::getSecretKey
methods, useOptions::getDsn()
instead -
Removed the
Breadcrumb::LEVEL_CRITICAL
constant, useBreadcrumb::LEVEL_FATAL
instead -
Removed the
Breadcrumb::levelFromErrorException()
method -
Removed the
PluggableHttpClientFactory
class -
Removed the following methods from the
ClientBuilderInterface
interface, useClientBuilderInterface::setTransportFactory()
instead:ClientBuilderInterface::setUriFactory()
ClientBuilderInterface::setMessageFactory()
ClientBuilderInterface::setTransport()
ClientBuilderInterface::setHttpClient()
ClientBuilderInterface::addHttpClientPlugin()
ClientBuilderInterface::removeHttpClientPlugin()
.
-
Removed the following methods from the
Options
class, use theIgnoreErrorsIntegration
integration instead:Options::getExcludedExceptions()
Options::setExcludedExceptions()
Options::isExcludedException()
Options::getProjectRoot()
Options::setProjectRoot()
-
Removed the
Context::CONTEXT_USER
,Context::CONTEXT_RUNTIME
,Context::CONTEXT_TAGS
,Context::CONTEXT_EXTRA
,Context::CONTEXT_SERVER_OS
constants -
The signature of the
Scope::setUser()
method changed tosetUser(array|Sentry\UserDataBag $user)
-
The signature of the
TransportInterface::send()
method changed to return a promise instead of the event ID -
The signature of the
HttpClientFactory::__construct()
method changed to accept instances of the PSR-17 factories in place of Httplug's ones -
The signature of the
DefaultTransportFactory::__construct()
method changed to accept instances of the PSR-17 factories in place of Httplug's ones -
The signature of the
GzipEncoderPlugin::__construct()
method changed to accept an instance of thePsr\Http\Message\StreamFactoryInterface
interface only -
The Monolog handler does not set anymore the tags and extras on the event by extracting automatically the data from the record payload. You can decorate the class and set such data on the scope as shown below:
use Monolog\Handler\HandlerInterface; use Sentry\State\Scope; use function Sentry\withScope; final class MonologHandler implements HandlerInterface { private $decoratedHandler; public function __construct(HandlerInterface $decoratedHandler) { $this->decoratedHandler = $decoratedHandler; } public function isHandling(array $record): bool { return $this->decoratedHandler->isHandling($record); } public function handle(array $record): bool { $result = false; withScope(function (Scope $scope) use ($record, &$result): void { $scope->setTags(...); $scope->setExtras(...); $result = $this->decoratedHandler->handle($record); }); return $result; } public function handleBatch(array $records): void { $this->decoratedHandler->handleBatch($records); } public function close(): void { $this->decoratedHandler->close(); } }
-
Removed the
TagsContext
,ExtraContext
andContext
classes, data is now stored in a plain array -
Renamed the
ServerOsContext
class toOsContext
-
The
OsContext
andRuntimeContext
classes do not implement anymore theArrayAccess
,IteratorAggregate
andJsonSerializable
interfaces and becamefinal
-
The following methods have been removed from the
OsContext
andRuntimeContext
classes:*Context::merge()
*Context::setData()
*Context::replaceData()
*Context::clear()
*Context::isEmpty()
*Context::toArray()
-
Removed the
UserContext
class, useUserDataBag
instead -
The signature of the constructor of the
RuntimeContext
class changed toRuntimeContext::__construct(string $name, ?string $version = null)
-
The signature of the constructor of the
OsContext
class changed toOsContext::__construct(string $name, ?string $version = null, ?string $build = null, ?string $kernelVersion = null)
-
Removed the
Event::getExtraContext()
method, useEvent::getExtra()
instead -
Removed the
Event::getTagsContext()
method, useEvent::getTags()
instead -
Removed the
Event::getUserContext()
method, useEvent::getUser()
instead -
Renamed the
Event::getServerOsContext()
method toEvent::getOsContext()
-
The signature of the
Scope::setUser()
method changed to accept a plain array -
Removed the
FlushableClientInterface
andClosableTransportInterface
interfaces. Their methods have been moved to the correspondingClientInterface
andTransportInterface
interfaces -
Removed the
Event::toArray()
andEvent::jsonSerialize()
methods, usePayloadSerializerInterface::serialize()
instead -
Removed the
Breadcrumb::toArray()
andBreadcrumb::jsonSerialize()
methods -
Removed the
Frame::toArray()
andFrame::jsonSerialize()
methods -
Removed the
Stacktrace::toArray()
andStacktrace::jsonSerialize()
methods -
Removed the
SpoolTransport
class and theSpoolInterface
interface with related implementation -
Made the
Event::__construct()
methodprivate
, use the named constructors instead -
The signature of
ClientInterface::captureEvent()
changed toClientInterface::captureEvent(Event $event, ?EventHint $hint = null, ?Scope $scope = null)
-
The signature of
HubInterface::captureEvent()
changed toHubInterface::captureEvent(Event $event, ?EventHint $hint = null)
-
The signature of
captureEvent()
changed tocaptureEvent(Event $event, ?EventHint $hint = null)
-
The signature of
Scope::applyToEvent()
changed toScope::applyToEvent(Event $event, ?EventHint $hint = null)
-
Global and scope event processors will now receive a
EventHint
as the second parameter, callable should now have the signaturecallable(Event $event, EventHint $hint)