symfony/contracts
Composer 安装命令:
composer require --dev symfony/contracts
包简介
A set of abstractions extracted out of the Symfony components
README 文档
README
A set of abstractions extracted out of the Symfony components.
Can be used to build on semantics that the Symfony components proved useful - and that already have battle tested implementations.
Design Principles
- contracts are split by domain, each into their own sub-namespaces;
- contracts are small and consistent sets of PHP interfaces, traits, normative docblocks and reference test suites when applicable;
- all contracts must have a proven implementation to enter this repository;
- they must be backward compatible with existing Symfony components.
Packages that implement specific contracts should list them in the "provide"
section of their "composer.json" file, using the symfony/*-implementation
convention (e.g. "provide": { "symfony/cache-implementation": "1.0" }).
FAQ
How to use this package?
The abstractions in this package are useful to achieve loose coupling and interoperability. By using the provided interfaces as type hints, you are able to reuse any implementations that match their contracts. It could be a Symfony component, or another one provided by the PHP community at large.
Depending on their semantics, some interfaces can be combined with autowiring to seamlessly inject a service in your classes.
Others might be useful as labeling interfaces, to hint about a specific behavior that could be enabled when using autoconfiguration or manual service tagging (or any other means provided by your framework.)
How is this different from PHP-FIG's PSRs?
When applicable, the provided contracts are built on top of PHP-FIG's PSRs. But the group has different goals and different processes. Here, we're focusing on providing abstractions that are useful on their own while still compatible with implementations provided by Symfony. Although not the main target, we hope that the declared contracts will directly or indirectly contribute to the PHP-FIG.
Resources
symfony/contracts 适用场景与选型建议
symfony/contracts 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 65.9M 次下载、GitHub Stars 达 3.94k, 最近一次更新时间为 2018 年 07 月 13 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「interfaces」 「standards」 「dev」 「interoperability」 「contracts」 「abstractions」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 symfony/contracts 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 symfony/contracts 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 symfony/contracts 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
PHP_CodeSniffer custom Sniff for Laravel coding standard
A set of abstractions that define core services provided by the DVSA
O2System PSR it's build based on PHP Framework Interop Group (PHP-FIG) standards recommendations. This repository contains a collection of PHP interfaces based on the PSR-0 until the PSR-7.
This is the ZooRoyal coding standard.
Monolog bridge for PHP Debugbar
Vanio Coding Standard Ruleset for PHP_CodeSniffer.
统计信息
- 总下载量: 65.9M
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3946
- 点击次数: 35
- 依赖项目数: 112
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-07-13