zajca/symfony-extensions

Variety extensions for symfony.

Maintainers

Package info

github.com/zajca/symfony-extensions

pkg:composer/zajca/symfony-extensions

Statistics

Installs: 2

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

dev-main 2021-10-12 13:48 UTC

This package is auto-updated.

Last update: 2026-04-13 00:08:25 UTC


README

This library contains a variety of extensions to ease work with Symfony framework

Install

Use composer to install the lib from packagist.

composer require zajca/symfony-extensions

Usage

Exception

Basic exception handling for http kernel.

Two Exception exists extending Exception interface: Zajca\Extensions\Exception\ExceptionInterface

  • Zajca\Extensions\Exception\InternalException - Exception which will return 500 status code but will log more information than standard Exception
  • Zajca\Extensions\Exception\PublicException - Exception which will be serialized and shown to api consumer

Usage in symfony

Register exception listener and use/extend predefined exceptions

services:
    Zajca\Extensions\Exception\ExceptionListener:
        tags:
            - { name: kernel.event_listener, event: kernel.exception }

Request mapping

Argument value resolver more in symfony docs which will map user input from request to object.

Examples

For examples check the tests: Zajca\Extensions\Tests\RequestMapping\ArgumentValueResolver\Example\ControllerStub

Route

Environment