Releases: brick/app
0.8.1
0.8.0
💥 Breaking changes
- minimum PHP version is now 8.0
- Doctrine annotations have been converted to PHP attributes
- attributes now live in
Brick\App\Controller\Attribute
- attribute constructors have changed, check their signatures!
- Plugins supporting attributes do not take an annotation reader in their constructor anymore
AnnotationRouteCompiler
does not take an annotation reader in its constructor anymoreAnnotationRoute
has been renamed toAttributeRoute
AnnotationRouteCompiler
has been renamed toAttributeRouteCompiler
AttributeRouteCompiler::processAttribute()
is now private
💥 Removed functionality
- The
TransactionalPlugin
has been removed
0.7.1
0.7.0
💥 Breaking changes
- minimum PHP version is now 7.4
- based on
brick/http: ~0.3.0
with immutable requests/responses ExceptionCaughtEvent
has been removed; useHttpExceptionEvent
insteadAnnotationRouteCompiler::processAnnotation()
is now privateAnnotationRouteCompiler::compile()
now returns a priority as well; routes have to be re-builtSession::handleRequest()
is now calledreadSessionIdFromRequest()
Session::handleResponse()
is now calledwriteSessionIdToResponse()
and returns aResponse
objectResponseReceivedEvent
is not triggered anymore after anHttpException
🗑 Deprecations
- The
TransactionalPlugin
has been deprecated, and will be removed in 0.8.0
✨ New features
-
Annotation routes now support priorities
-
The exception handling has been split into 2 events:
UncaughtExceptionEvent
converts an uncaught exception to anHttpException
HttpExceptionEvent
converts anHttpException
to aResponse
-
ResponseReceivedEvent
now has asetResponse()
method, becauseResponse
is now immutable -
New method:
Application::handleWithoutCatchingExceptions()
0.6.1
0.6.0
This version brings more breaking changes that were forgotten in 0.5.0
.
Breaking changes
The signature of Brick\App\ObjectPacker\ObjectPacker::pack()
has been changed to:
public function pack(object $object) : ?PackedObject;
i.e., the $object
parameter is now strongly typed. This change has been propagated to all implementations of ObjectPacker
:
DateTimePacker
GeometryPacker
DoctrinePacker
PackerChain
NullPacker
Non-breaking changes
- The
$instance
parameter is now strongly typed to?object
in the constructor of the following classes:Brick\App\Event\ControllerInvocatedEvent
Brick\App\Event\ControllerReadyEvent
Brick\App\Event\NonResponseResultEvent
Brick\App\Event\ResponseReceivedEvent
These parameters were already documented as such, and inheritance is not an issue, so this is not a breaking change.
0.5.0
Minimum PHP version is now 7.2
.
Breaking changes
The following methods now have return types:
Brick\App\Plugin\AbstractAnnotationPlugin::getControllerAnnotation(...) : ?object
Brick\App\ObjectPacker\ObjectPacker::unpack(...) : ?object
This change has been propagated to all implementations of ObjectPacker
:
DateTimePacker
GeometryPacker
DoctrinePacker
PackerChain
NullPacker
Non-breaking changes
The following methods now have return types:
Brick\App\Event\ControllerInvocatedEvent::getControllerInstance() : ?object
Brick\App\Event\ControllerReadyEvent::getControllerInstance() : ?object
Brick\App\Event\NonResponseResultEvent::getControllerInstance() : ?object
Brick\App\Event\ResponseReceivedEvent::getControllerInstance() : ?object
These classes are final
, and as such this is not a breaking change.
0.4.2
0.4.1
0.4.0
Improvement
The session cookie is now only sent when required:
- if the request contains a session Cookie, the response will always contain a Set-Cookie (to refresh it);
- if the request does not contain a session Cookie, the response will not contain a Set-Cookie, unless a write has been performed to the session via
set()
orsynchronize()
in the meantime; in this case the session ID will be generated just in time on first write.
This has two advantages:
- it prevents controllers that do not use sessions (API endpoints, ...) from outputting cookies;
- it prevents every
has()
,get()
,remove()
andclear()
calls from hitting the storage when the request does not contain a session cookie, yielding better performance in this case, for example when checking the existence of a session entry for every visitor.
Breaking changes
Session has a new abstract method
:generateSessionId()
Storage\Lock::$context
is now public,getContext()
andsetContext()
methods have been removed