Download the PHP package dreikern/phpstan-oxid without Composer
On this page you can find all versions of the php package dreikern/phpstan-oxid. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package phpstan-oxid
OXID eShop extensions for PHPStan
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()orRegistry::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.
oxdiscountinstead of\OxidEsales\Eshop\Application\Model\Discount) or classes without unified namespace (e.g.\OxidEsales\EshopCommunity\Application\Model\Voucherinstead of\OxidEsales\Eshop\Application\Model\Voucher).
Installation
To use this extension, require it in Composer:
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: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:
If you need to analyze different subshops without changing your phpstan.neon you are able to set the path via environment variable:
Rules
OxNewCalledWithEditionNamespaceRule
oxNew() call with edition namespace for class %s. Use %s instead.
- class:
dreikern\PhpStanOxid\Rule\OxNewCalledWithEditionNamespaceRule
:x:
:white_check_mark:
OxNewCalledWithLegacyClassNameRule
oxNew() call with legacy className %s. Use %s instead.
- class:
dreikern\PhpStanOxid\Rule\OxNewCalledWithLegacyClassNameRule
:x:
:white_check_mark:
RegistryGetCalledWithEditionNamespaceRule
Registry::get() call with edition namespace for class %s. Use %s instead.
- class:
dreikern\PhpStanOxid\Rule\RegistryGetCalledWithEditionNamespaceRule
:x:
:white_check_mark:
RegistryGetCalledWithLegacyClassNameRule
Registry::get() call with legacy className %s. Use %s instead.
- class:
dreikern\PhpStanOxid\Rule\RegistryGetCalledWithLegacyClassNameRule
:x:
:white_check_mark:
Credits
This PHPStan extensions is heavily inspired by phpstan-doctrine