-
Removed the
HubInterface::getCurrentHub()andHubInterface::setCurrentHub()methods. UseSentrySdk::getCurrentHub()andSentrySdk::setCurrentHub()instead -
Removed the
ErrorHandler::registerOnce()method, useErrorHandler::register*Handler()instead -
Removed the
ErrorHandler::addErrorListenermethod, useErrorHandler::addErrorHandlerListener()instead -
Removed the
ErrorHandler::addFatalErrorListenermethod, useErrorHandler::addFatalErrorHandlerListener()instead -
Removed the
ErrorHandler::addExceptionListenermethod, 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
ErrorListenerIntegrationintegration does not get called anymore when a fatal error occurs -
The default value of the
error_typesoption changed to the value get fromerror_reporting() -
The signature of the
capture*()global functions changed to return an instance of theEventIdclass instead of astring -
The signature of the
ClientInterface::capture*()methods changed to return an instance of theEventIdclass instead of astring -
The signature of the
HubInterface::capture*e()methods changed to return an instance of theEventIdclass instead of astring -
The signature of the
Event::getId()method changed to return an instance of theEventIdclass instead of astring -
The signature of the
Options::getDsn()method changed to always return an instance of theDsnclass instead of astring -
Removed the
Options::getProjectId,Options::getPublicKeyandOptions::getSecretKeymethods, useOptions::getDsn()instead -
Removed the
Breadcrumb::LEVEL_CRITICALconstant, useBreadcrumb::LEVEL_FATALinstead -
Removed the
Breadcrumb::levelFromErrorException()method -
Removed the
PluggableHttpClientFactoryclass -
Removed the following methods from the
ClientBuilderInterfaceinterface, useClientBuilderInterface::setTransportFactory()instead:ClientBuilderInterface::setUriFactory()ClientBuilderInterface::setMessageFactory()ClientBuilderInterface::setTransport()ClientBuilderInterface::setHttpClient()ClientBuilderInterface::addHttpClientPlugin()ClientBuilderInterface::removeHttpClientPlugin().
-
Removed the following methods from the
Optionsclass, use theIgnoreErrorsIntegrationintegration 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_OSconstants -
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\StreamFactoryInterfaceinterface 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,ExtraContextandContextclasses, data is now stored in a plain array -
Renamed the
ServerOsContextclass toOsContext -
The
OsContextandRuntimeContextclasses do not implement anymore theArrayAccess,IteratorAggregateandJsonSerializableinterfaces and becamefinal -
The following methods have been removed from the
OsContextandRuntimeContextclasses:*Context::merge()*Context::setData()*Context::replaceData()*Context::clear()*Context::isEmpty()*Context::toArray()
-
Removed the
UserContextclass, useUserDataBaginstead -
The signature of the constructor of the
RuntimeContextclass changed toRuntimeContext::__construct(string $name, ?string $version = null) -
The signature of the constructor of the
OsContextclass 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
FlushableClientInterfaceandClosableTransportInterfaceinterfaces. Their methods have been moved to the correspondingClientInterfaceandTransportInterfaceinterfaces -
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
SpoolTransportclass and theSpoolInterfaceinterface 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
EventHintas the second parameter, callable should now have the signaturecallable(Event $event, EventHint $hint)