check24 / apitk-common-bundle
包含在 check24/apitk-* 套件之间共享的类、接口和特性
4.0.0
2022-01-19 12:17 UTC
Requires
- php: ^8.0
- nelmio/api-doc-bundle: ^v4.8
- sensio/framework-extra-bundle: ^6.0
- symfony/config: ^5.3 || ^6.0
- symfony/dependency-injection: ^5.3 || ^6.0
- symfony/framework-bundle: ^5.3 || ^6.0
Requires (Dev)
- captainhook/captainhook: ^5.10.6
- doctrine/doctrine-bundle: >=2.3 <3.0
- doctrine/orm: ^2.6 || ^3.0
- friendsofphp/php-cs-fixer: ^3.4.0
- phpmd/phpmd: ^2.11.1
- phpspec/prophecy-phpunit: ^2.0.1
- phpstan/phpstan: ^1.3.3
- phpstan/phpstan-deprecation-rules: ^1.0
- roave/security-advisories: dev-latest
This package is auto-updated.
Last update: 2024-09-05 01:19:06 UTC
README
包含 apitk-* 套件之间共享的类、接口和特性,主要
安装
通过 composer 安装包
composer require check24/apitk-common-bundle
通常不需要您自己安装,因为它仅用于其他 apitk-bundles。
组件
Annotation/ParamConverter
用于您的 ParamConverter 注解的有用特性
- EntityAwareAnnotationTrait
添加entity
、entityManager
和methodName
选项 - RequestParamAwareAnnotationTrait
添加requestParam
选项
Describer/AbstractDescriber
通过 PHP 更改 Swagger/OpenAPI 注解的常见逻辑
ParamConverter
用于您的 ParamConverter 逻辑的有用特性
ContextAwareParamConverterTrait.php EntityAwareParamConverterTrait.php
- ContextAwareParamConverterTrait
提供$this->getOption('name', 'default')
便利方法,以便轻松访问注解选项。 - EntityAwareParamConverterTrait
添加getEntity()
、getEntityManager()
和callRepositoryMethod()
便利方法,以便轻松访问实体、适当的实体管理器和针对给定注解选项的存储库。 - RequestParamAwareParamConverterTrait
添加getRequestParam()
和getRequestParamValue()
方法,以便轻松访问通过注解选项提供的请求参数。还可以在此处定义默认值。