bowlofsoup/normalizer-bundle
Composer 安装命令:
composer require bowlofsoup/normalizer-bundle
包简介
Normalizer for objects.
README 文档
README
Installation
composer require bowlofsoup/normalizer-bundle
Add the bundle to your config/bundles.php file
BowlOfSoup\NormalizerBundle\BowlOfSoupNormalizerBundle::class => ['all' => true],
Quick feature overview
- It's a Symfony bundle!
- Normalizes class properties and methods (public, protected, private)
- Can Serialize normalized content
- Works with Symfony and Doctrine as its ORM. Can handle Doctrine proxies
- Circular reference check: Handles circular reference by detecting it and returning content of the objects getId() method
- Object caching: If a getId() method is implemented for an object, it will cache the normalized object per normalize command
- Annotation caching, this means speed!
- The annotations for an object are cached. This means not parsing annotations multiple times for the same object. per flow (per normalize command)
- In Symfony prod mode, annotations are cached completely (after the first run)
- Symfony translations
- Indicate domain (translation filename) and locale in annotations
- Does not support formatting with ICU MessageFormat (yet), so no parameters
The main features are described in the documentation.
Documentation
Documentation on the usage and all supported options can be found in the wiki.
Why use this normalizer and not ...
- The Bowl Of Soup Normalizer uses an opt-in mechanism by default. You have to indicate which properties must be normalized
- You can indicate a context group, how is the value to be normalized, in which context?
- It's designed with speed in mind. Not packed with features for which you don't use half of it
- It has proven itself in a complex application with 15.000+ daily end users
Development
The following CI tools can be used to check for code quality before pushing code:
Rector
Rector can be used to automate code upgrades and refactoring. Try a dry-run first!
vendor/bin/rector process --dry-run --no-progress-bar --ansi
PHPStan
PHPStan is a static code analysis tool that focuses on finding errors in the code. Fixing the outcome of PHPStan prevents possible bugs and errors.
vendor/bin/phpstan
PHPUnit
Speaks for itself, code should be tested. Run with coverage (output = tests/coverage):
XDEBUG_MODE=coverage php -dzend_extension=xdebug.so vendor/bin/phpunit
Or without coverage:
vendor/bin/phpunit
Code coverage master:
Code style fixer
Have php-cs-fixer automatically fix styling.
vendor/bin/php-cs-fixer fix
bowlofsoup/normalizer-bundle 适用场景与选型建议
bowlofsoup/normalizer-bundle 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 36.94k 次下载、GitHub Stars 达 11, 最近一次更新时间为 2016 年 09 月 03 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「array」 「object」 「representation」 「normalizer」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 bowlofsoup/normalizer-bundle 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 bowlofsoup/normalizer-bundle 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 bowlofsoup/normalizer-bundle 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
CBOR Encoder/Decoder for PHP
A library for generating string representations of any value, inspired by Python's reprlib library.
CBOR Encoder/Decoder Bundle for Symfony.
A set of useful PHP classes.
Runn Me! Value Objects Library
Laravel SDK mapping data in object
统计信息
- 总下载量: 36.94k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 11
- 点击次数: 23
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-09-03