answear / gls-bundle
GLS api 的 Symfony 扩展包。
3.0.0
2024-09-06 08:02 UTC
Requires
- php: >=8.2
- ext-json: *
- guzzlehttp/guzzle: ^6.5|^7.9.2
- psr/log: ^1.1.4
- symfony/http-kernel: 6.4.*
- symfony/property-access: 6.4.*
- symfony/property-info: 6.4.*
- symfony/serializer: 6.4.*
- webmozart/assert: ^1.11
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.63.2
- matthiasnoback/symfony-config-test: ^5.2
- phpro/grumphp: ^2.7.0
- phpstan/phpstan: ^1.12
- phpstan/phpstan-webmozart-assert: ^1.2.10
- phpunit/phpunit: ^10.5.30
- roave/security-advisories: dev-master
- symfony/phpunit-bridge: 6.4.*
This package is auto-updated.
Last update: 2024-09-06 08:04:59 UTC
README
Symfony 的 GLS 提货点集成。
安装
- 使用 Composer 安装
composer require git@github.com:answear/gls-bundle.git
Answear\GlsBundle\AnswearGlsBundle::class => ['all' => true],
应该由 Symfony Flex 自动添加到您的 config/bundles.php
文件中。
设置
- 提供所需配置数据:
countryCode
# config/packages/answear_gls.yaml answear_gls: countryCode: HU|SK|CZ|RO|SI|HR logger: yourCustomLoggerService #default: null
日志服务必须实现 Psr\Log\LoggerInterface
接口。
使用
获取包裹商店
/** @var \Answear\GlsBundle\Service\ParcelShopsService $parcelShopService **/ $parcelShopService->getParcelShopCollection();
将返回 \Answear\GlsBundle\Response\DTO\ParcelShop[]
数组。
错误处理
Answear\GlsBundle\Exception\ServiceUnavailableException
用于所有GuzzleException
最后备注
请随意提交带有新功能、改进或错误修复的拉取请求。Answear 团队将感谢任何评论。