Download the PHP package riper/exception-transformer without Composer

On this page you can find all versions of the php package riper/exception-transformer. 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 exception-transformer

Exception transformer

This bundle can listen to exception that reach the kernel of Symfony to transform them before the kernel render them. This is useful when you want to transform domain/business exception from your code to presentation exception such as http exception that contain http status code.

License CC-BY-4 php version symfony version

Usage

Require the dependency in your composer.json

For symfony >=4 and php >=7.4

"riper/exception-transformer" : "2.*"

For symfony <4 and php <7.4

"riper/exception-transformer" : "1.*"

Register the bundle in app-kernel

new Riper\Bundle\ExceptionTransformerBundle\RiperCommonExceptionTransformerBundle(),

Transform exception with a service (most portable way)

Implement the interface \Riper\Bundle\ExceptionTransformerBundle\ExceptionTransformer\ExceptionTransformerInterface

Implement the transform method. It can (if required) throw a new exception according to the exception given.

Example : ` Create a service description tagged with the following information

example :

Use the built-in transformer for http error exception

You can transform your exceptions in httpException from symfony/http-kernel just by adding some configuration. No code needed.

  1. Create a configuration key in parameters with a unique name ending by "riper_exception_map".
  2. The parameter contain a key=>value with
    • key = THe full namespace of the exception to transform (without a slash at the beginning)
    • value = The http status to generate (an exception will be thrown with the proper http status code)

The list of available status is located in riper_exception_mapping.shortcuts parameter in __ExceptionTransformerBundle/Resources/config/exceptions_mapping.yml__. The following is a non-exhaustive list

Example :

parameters:
    customercare.contact.riper_exception_map:
        Riper\Bundle\CustomerCare\ContactBundle\Exceptions\InvalidParameterException: BadRequestHttpException
        Riper\Bundle\CustomerCare\ContactBundle\Exceptions\ContactException: BadRequestHttpException

The status code/exception is not in the shortcut list ? use the first method with the transformer tagged


All versions of exception-transformer with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
symfony/framework-bundle Version ^4
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 riper/exception-transformer contains the following files

Loading the files please wait ....