invis1ble / serializer-extension-bundle
Symfony Bundle for symfony/serializer extension.
Package info
github.com/Invis1ble/serializer-extension-bundle
Type:symfony-bundle
pkg:composer/invis1ble/serializer-extension-bundle
Requires
- php: >=8.1
- guzzlehttp/guzzle: ^7.3
- invis1ble/symfony-serializer-extension: ^1.2
- symfony/config: ^6.4 || ^7.0 || ^8.0
- symfony/dependency-injection: ^6.4 || ^7.0 || ^8.0
- symfony/http-kernel: ^6.4 || ^7.0 || ^8.0
Requires (Dev)
- escapestudios/symfony2-coding-standard: ^3.18
- friendsofphp/php-cs-fixer: ^3.95
- matthiasnoback/symfony-dependency-injection-test: ^6.2
- phpunit/phpunit: ^10.5 || ^11.5 || ^12.5 || ^13.0
- rector/rector: ^2.6
- symfony/framework-bundle: ^6.4 || ^7.0 || ^8.0
- symfony/property-access: ^6.4 || ^7.0 || ^8.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-09-29 13:29:36 UTC
README
The SerializerExtensionBundle integrates invis1ble/symfony-serializer-extension into the Symfony framework.
Requirements
- PHP 8.1 or later.
- Symfony 6.4, 7.x, or 8.x. Symfony 8 requires PHP 8.4.1 or later.
invis1ble/symfony-serializer-extension1.2 or later in the 1.x release line.
Version 1.1 adds Symfony 8 support while preserving the existing service IDs,
URI factory alias, and normalizer priority. Existing ^1.0 Composer constraints
accept this release. To explicitly select it:
composer require invis1ble/serializer-extension-bundle:^1.1 --with-all-dependencies
Installation
Make sure Composer is installed globally, as explained in the installation chapter of the Composer documentation.
Applications that use Symfony Flex
Open a command console, enter your project directory and execute:
$ composer require invis1ble/serializer-extension-bundle
Applications that don't use Symfony Flex
Step 1: Download the Bundle
Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:
$ composer require invis1ble/serializer-extension-bundle
Step 2: Enable the Bundle
Then, enable the bundle by adding it to the list of registered bundles
in the config/bundles.php file of your project:
// config/bundles.php return [ // ... Invis1ble\SerializerExtensionBundle\Invis1bleSerializerExtensionBundle::class => ['all' => true], ];
Usage
Enable the Symfony serializer in your application:
# config/packages/framework.yaml framework: serializer: true
Inject Symfony\Component\Serializer\SerializerInterface and use the json
format to serialize a PSR-7 UriInterface to a JSON string or deserialize one to
Psr\Http\Message\UriInterface or GuzzleHttp\Psr7\Uri.
The bundle registers one serializer.normalizer service,
invis1ble_serializer_extension.normalizer.uri, with priority 10, ahead of
Symfony's object and property normalizers. The public service
invis1ble_serializer_extension.uri_factory uses GuzzleHttp\Psr7\HttpFactory
and is aliased to Psr\Http\Message\UriFactoryInterface for autowiring.
Service definitions now load from config/services.php, because Symfony 8 no
longer supports XML service configuration. Applications that register the bundle
need no configuration changes. The legacy XML files remain available for older
Symfony applications that imported them directly; such imports must use the PHP
files when upgrading to Symfony 8.
Development
Getting started
- If not already done, install Docker Compose (v2.10+)
- Run
docker compose build --no-cacheto build fresh images - Run
docker compose up -d --waitto start the Docker containers - Run
docker compose exec -T php composer installto install dependencies - Run
docker compose down --remove-orphansto stop the Docker containers.
The development image defaults to PHP 8.4. Set PHP_VERSION before building and
starting Compose to select another version. CI checks PHP 8.1 / Symfony 6.4,
PHP 8.2 / Symfony 7.4, PHP 8.4 / Symfony 8.0, and PHP 8.5 / Symfony 8.1 with stable
dependencies and real platform requirements.
Validate the package and installed platform requirements with:
docker compose exec -T php composer validate --strict docker compose exec -T php composer check-platform-reqs
Check for Coding Standards violations
Run PHP_CodeSniffer checks:
docker compose exec -T php bin/php_codesniffer
Run PHP-CS-Fixer checks:
docker compose exec -T php bin/php-cs-fixer
Run Rector checks:
docker compose exec -T php bin/rector
Testing
The tests compile a minimal Symfony kernel, check service tags and autowiring, and exercise URI round trips, invalid data, normalizer ordering, and an HTTP request through the container serializer. To run them during development:
docker compose exec -T php vendor/bin/phpunit
To run with coverage
XDEBUG_MODE=coverage docker compose up -d --wait
docker compose exec -T php vendor/bin/phpunit --coverage-clover var/log/coverage-clover.xml