定制 invis1ble/symfony-serializer-extension 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

invis1ble/symfony-serializer-extension

Composer 安装命令:

composer require invis1ble/symfony-serializer-extension

包简介

Additional useful (de)normalizers for symfony/serializer .

README 文档

README

CI Status Code Coverage Packagist MIT licensed

A useful set of additional (de)normalizers for symfony/serializer:

  • UriNormalizer for normalizing objects implementing Psr\Http\Message\UriInterface

Installation

To install this package, you can use Composer:

composer require invis1ble/symfony-serializer-extension

or just add it as a dependency in your composer.json file:


{
    "require": {
        "invis1ble/symfony-serializer-extension": "^1.0"
    }
}

After adding the above line, run the following command to install the package:

composer install

Usage

Currently implemented UriNormalizer only.

This normalizer is designed for normalizing Uri objects implementing the Psr\Http\Message\UriInterface.

Read the official documentation for the Serializer component to use normalizers.

use Invis1ble\SymfonySerializerExtension\Normalizer\UriNormalizer;
use Symfony\Component\Serializer\Encoder\JsonEncoder;
use Symfony\Component\Serializer\Encoder\XmlEncoder;
use Symfony\Component\Serializer\Serializer;

$encoders = [new XmlEncoder(), new JsonEncoder()];
$normalizers = [new UriNormalizer($uriFactory)];

$serializer = new Serializer($normalizers, $encoders);

Development

Getting started

  1. If not already done, install Docker Compose (v2.10+)
  2. Run docker compose build --no-cache to build fresh images
  3. Run docker compose up -d --wait to start the Docker containers
  4. Run docker compose exec php composer install to install dependencies
  5. Run docker compose down --remove-orphans to stop the Docker containers.

Check for Coding Standards violations

Run PHP_CodeSniffer checks:

docker compose exec -it php bin/php_codesniffer

Run PHP-CS-Fixer checks:

docker compose exec -it php bin/php-cs-fixer

Run Rector checks:

docker compose exec -it php bin/rector

Testing

To run Unit tests during development

docker compose exec php vendor/bin/phpunit

To run with coverage

XDEBUG_MODE=coverage docker compose up -d --wait
docker compose exec php vendor/bin/phpunit --coverage-clover var/log/coverage-clover.xml

License

The MIT License

统计信息

  • 总下载量: 1.06k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 5
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-06-03

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固