Download the PHP package pitch/symfony-adr without Composer

On this page you can find all versions of the php package pitch/symfony-adr. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package symfony-adr

ADR Bundle for Symfony

This bundle makes it easier to follow ADR pattern while writing a Symfony application.

Usage

Turn controller into action

Decouple responder logic from action logic by moving it out of the controller. Just return the payload!

If a controller returns anything but a Response object, Symfony dispatches a kernel.view event.

Now instead of registering a bunch of event listeners to be iterated through, implement ResponseHandlerInterface.

If your handler class is available as a service according to your config/services.yaml, it will be discovered and used whenever a MyPayload object is returned by a controller.

With default config just put the class into src/Responder/MyPayloadHandler.php and you are done.

Your response handler can report its priority in getSupportedTypes.

Or you can overwrite the handled types and priorities for response handlers in your services.yml.

You can easily debug your responder config per console command.

Treat some exceptions as response payload

A robust domain will have strict constraints and throw exceptions whenever an unexpected or invalid condition occurs and for every exception falling through your controller/action Symfony dispatches a kernel.exception event.

You can reserve this event for truly unexpected behavior without repeating similar try-catch-blocks across your controllers.

Define which exceptions should be catched for all controllers and be treated as response payload:

If Doctrine Annotations is installed, you can define extra rules for your controller methods per annotation:

With PHP8 you can define extra rules per Attribute:

Rules are applied in the order of appearance, method rules after global rules.

Now you can just create a App\Responder\MyGoodRuntimeExceptionHandler as described above.

Default response handlers

The bundle automatically adds some response handlers for basic types with negative priority so that they will be called if none of your response handlers stops propagation earlier. If you don't want the default handlers to be added, you can modify this behavior per bundle configuration.

Prioritised response handlers

If consecutive response handlers (in the order of config priority) implement PrioritisedResponseHandlerInterface, that block of handlers will be reordered on runtime according the priority they report for the specific request per getResponseHandlerPriority.

Negotiating content type in response handlers

See JsonResponder on how to implement your own prioritised response handlers that handle a payload according to the Accept header on the request.

You can set a default content type for requests that don't include an Accept header. This can be done per container parameter or as controller annotation.


All versions of symfony-adr with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
composer/composer Version ^1 || ^2
pitch/annotation Version ^1.0
symfony/config Version ^5.4.9 || ^6
symfony/dependency-injection Version ^5.4.9 || ^6
symfony/http-kernel Version ^5.4.9 || ^6
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package pitch/symfony-adr contains the following files

Loading the files please wait ....