cepdtech / pokemon
Magento 2 模块,用于集成 PokeAPI
1.0.0
2024-07-28 09:51 UTC
Requires
- magento/framework: *
This package is auto-updated.
Last update: 2024-09-28 10:11:09 UTC
README
Magento 2 模块,用于集成 PokeAPI
设置
composer require cepdtech/pokemon
ADR
编写自己的 Pokemon API 客户端
存在 2 个第三方库,但都存在问题
- https://github.com/danrovito/pokephp
- 不支持注入基本 URL
- https://github.com/lmerotta/phpokeapi
- 不支持 PHP 8
在正常情况下,我会建议使用第一个(在最坏的情况下(URL 发生更改)可以使用 composer 补丁),但由于这是一个技能展示项目,我决定编写自己的客户端。
质量
测试于
- PHP 8.3
- Magento 社区版 2.4.7
测试
vendor/bin/phpunit -c dev/tests/unit/phpunit.xml.dist vendor/cepdtech/pokemon
代码检查器
vendor/bin/phpcs --standard=Magento2 -p -s --colors --error-severity=1 --warning-severity=0 vendor/cepdtech/pokemon/
复制粘贴检测器
vendor/bin/phpcpd vendor/cepdtech/pokemon/
杂乱检测器
vendor/bin/phpmd vendor/cepdtech/pokemon/ text dev/tests/static/testsuite/Magento/Test/Php/_files/phpmd/ruleset.xml