reiterus / mcx-info-symfony
俄罗斯联邦农业部信息卡的 Symfony 组件
3.0.0
2023-04-02 04:21 UTC
Requires
- php: ^8.1
Requires (Dev)
- phpunit/phpunit: ^9.5
README
俄罗斯联邦农业部作为 Symfony 组件的 REST API URL(响应为 json 格式)的总结信息。
默认 URL: /bundle/mcx/info/index
所有数据均来自部公开互联网资源。
部分响应内容可被操作
- 主要数据(主要):标题、地址、网站等
- 部官员(人物)
- 联系信息
在 app
目录中包含可用于使用的文件,需要将其移动到项目中的相应目录,这将导致默认信息的完成。
响应
输出可以以两种格式显示
- 一行显示
- 格式化美观
{ "title": "Министерство сельского хозяйства Российской Федерации", "description": "Федеральный орган исполнительной власти...", "address": "107996, Москва, Орликов переулок, 1\/11", "site": "https:\/\/mcx.gov.ru", "contacts": [ "Тел.: +7 (495) 607-80-00", "Факс: +7 (495) 607-83-62", "info@mcx.gov.ru" ], "persons": [ [ "Патрушев Дмитрий Николаевич", "Министр сельского хозяйства Российской Федерации", "info@mcx.gov.ru", "Тел.: +7 (495) 607-80-00", "Факс: +7 (495) 607-83-62" ], [ "..." ] ] }
用法
URL 设置
# connecting config with route reiterus_mcx_info: resource: '@McxInfoBundle/Resources/config/routes.xml' prefix: /bundle/mcx/info
包设置
# adding contacts and formatting the output reiterus_mcx_info: contacts: - 'Тел.: +7 (495) 607-80-00' - 'Факс: +7 (495) 607-83-62' - 'info@mcx.gov.ru' pretty: true # addition of personalities through a service with a specific tag services: app.reiterus_mcx_info_persons: class: App\Util\McxPersons tags: - { name: 'tag_mcx_info_persons' }
安装
您可以通过两种方式安装此组件
从 packagist.org
composer require reiterus/mcx-info-symfony
从 GitHub 仓库
{ "repositories": [ { "type": "vcs", "url": "https://github.com/reiterus/mcx-info-symfony.git" } ] }
测试
要运行带有视觉覆盖率的测试,请按以下命令启动
XDEBUG_MODE=coverage ./vendor/phpunit/phpunit/phpunit \ --configuration phpunit.xml \ --testsuite default \ --coverage-html coverage/
测试结果将保存到 coverage
目录。
提示: vendor/bin/phpunit --generate-configuration
许可证
此库在 MIT 许可证 下发布。