承接 dreikern/phpstan-oxid 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

dreikern/phpstan-oxid

Composer 安装命令:

composer require dreikern/phpstan-oxid

包简介

PHPStan extension for OXID eShop

README 文档

README

Build Latest Stable Version License

This extension provides following features:

  • OXID eShop uses class chaining in order to inject modules into their system. This class chain is built at runtime so PHPStan, as a static code analyzer, isn't able to detect that. This extension reads your shop configuration (e.g. var/configuration/shops/1.yaml) and builds this class chain when PHPStan is analyzing your code. Only activated modules are considered. This allows PHPStan to do its magic.
  • When using oxNew() or Registry::get() this extension dynamically changes the return type when PHPStan is analyzing your code, so it is aware of any changes your code adds to OXID eShop classes.
  • Stubs some OXID eShops classes to fix incorrect phpdoc comments in OXID eShop. Feel free to contribute more stubs when you encounter such mistakes. PHPStan Documentation
  • Provide rules to detect usage of legacy class names (e.g. oxdiscount instead of \OxidEsales\Eshop\Application\Model\Discount) or classes without unified namespace (e.g. \OxidEsales\EshopCommunity\Application\Model\Voucher instead of \OxidEsales\Eshop\Application\Model\Voucher).

Installation

To use this extension, require it in Composer:

composer require --dev dreikern/phpstan-oxid

If you also install phpstan/extension-installer then you're all set!

Manual installation

If you don't want to use phpstan/extension-installer, include extension.neon in your project's PHPStan config:

includes:
    - vendor/dreikern/phpstan-oxid/extension.neon

Configuration

If the path to your shops module configuration differs from var/configuration/shops/1.yaml , you can override the path in your phpstan.neon:

parameters:
    oxid:
        shopConfigurationPath: var/configuration/shops/1.yaml

If you need to analyze different subshops without changing your phpstan.neon you are able to set the path via environment variable:

PHPSTAN_OXID_CONFIG_PATH=path/to/config/1.yaml ./vendor/bin/phpstan analyze path/to/oxid/module

Rules

OxNewCalledWithEditionNamespaceRule

oxNew() call with edition namespace for class %s. Use %s instead.

oxNew(\OxidEsales\EshopCommunity\Application\Model\Voucher::class);


oxNew(\OxidEsales\Eshop\Application\Model\Voucher::class);

OxNewCalledWithLegacyClassNameRule

oxNew() call with legacy className %s. Use %s instead.

oxNew('oxdiscount');


oxNew(\OxidEsales\Eshop\Application\Model\Discount::class);

RegistryGetCalledWithEditionNamespaceRule

Registry::get() call with edition namespace for class %s. Use %s instead.

Registry::get(\OxidEsales\EshopCommunity\Application\Model\Voucher::class);


Registry::get(\OxidEsales\Eshop\Application\Model\Discount::class);

RegistryGetCalledWithLegacyClassNameRule

Registry::get() call with legacy className %s. Use %s instead.

Registry::get('oxdiscount');


Registry::get(\OxidEsales\Eshop\Application\Model\Voucher::class);

Credits

This PHPStan extensions is heavily inspired by phpstan-doctrine

dreikern/phpstan-oxid 适用场景与选型建议

dreikern/phpstan-oxid 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 9.59k 次下载、GitHub Stars 达 3, 最近一次更新时间为 2022 年 08 月 25 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 dreikern/phpstan-oxid 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 dreikern/phpstan-oxid 我们能提供哪些服务?
定制开发 / 二次开发

基于 dreikern/phpstan-oxid 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 9.59k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 3
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-08-25