Skip to content

Releases: brick/app

0.8.1

19 Jan 15:20
Compare
Choose a tag to compare

🐛 Bug fix

Fixed dependency on dev release of brick/di.

0.8.0

19 Jan 15:04
Compare
Choose a tag to compare

💥 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 anymore
  • AnnotationRoute has been renamed to AttributeRoute
  • AnnotationRouteCompiler has been renamed to AttributeRouteCompiler
  • AttributeRouteCompiler::processAttribute() is now private

💥 Removed functionality

  • The TransactionalPlugin has been removed

0.7.1

26 Nov 10:10
Compare
Choose a tag to compare

🐛 Bug fixes

  • Fixed deprecated calls in PHP 8.

0.7.0

21 Nov 00:46
Compare
Choose a tag to compare

💥 Breaking changes

  • minimum PHP version is now 7.4
  • based on brick/http: ~0.3.0 with immutable requests/responses
  • ExceptionCaughtEvent has been removed; use HttpExceptionEvent instead
  • AnnotationRouteCompiler::processAnnotation() is now private
  • AnnotationRouteCompiler::compile() now returns a priority as well; routes have to be re-built
  • Session::handleRequest() is now called readSessionIdFromRequest()
  • Session::handleResponse() is now called writeSessionIdToResponse() and returns a Response object
  • ResponseReceivedEvent is not triggered anymore after an HttpException

🗑 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 an HttpException
    • HttpExceptionEvent converts an HttpException to a Response
  • ResponseReceivedEvent now has a setResponse() method, because Response is now immutable

  • New method: Application::handleWithoutCatchingExceptions()

0.6.1

06 Apr 10:45
Compare
Choose a tag to compare

Maintenance release for compatibility with brick/reflection version 0.3.

No changes.

0.6.0

24 Dec 14:16
Compare
Choose a tag to compare

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

24 Dec 09:07
Compare
Choose a tag to compare

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

18 Nov 16:25
Compare
Choose a tag to compare

Bug fix

Replace deprecated call to ReflectionType::__toString().

0.4.1

16 Jul 12:20
Compare
Choose a tag to compare

Bug fix

DateTimePacker did not catch all date/time exceptions as it should, leading to uncaught exceptions when a date/time string was syntactically valid but did not hold a valid value.

0.4.0

10 Apr 08:18
Compare
Choose a tag to compare

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() or synchronize() 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() and clear() 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() and setContext() methods have been removed