renttek / magento2-psalm
Magenot 2 psalm plugin
Installs: 3 863
Dependents: 0
Suggesters: 0
Security: 0
Stars: 5
Watchers: 1
Forks: 0
Open Issues: 2
Requires
- php: ^8.1
- ext-simplexml: *
- azjezz/psl: ^2.6
- symfony/finder: ^5.0 || ^6.0
- symfony/string: ^5.0 || ^6.0
- vimeo/psalm: ^5.12
Requires (Dev)
- ergebnis/composer-normalize: ^2.31
- magento/framework: >=100
- php-parallel-lint/php-console-highlighter: ^1.0
- php-parallel-lint/php-parallel-lint: ^1.3
- phpstan/extension-installer: ^1.3
- phpstan/phpstan: ^1.10
- phpstan/phpstan-deprecation-rules: ^1.1
- phpstan/phpstan-strict-rules: ^1.5
- roave/security-advisories: dev-latest
- symplify/easy-coding-standard: ^11.3
README
This module is based on vismadc/magento2-psalm
and tdgroot/magento2-psalm
but rewritten from scratch.
Installation
composer require --dev renttek/magento2-psalm
vendor/bin/psalm-plugin enable renttek/magento2-psalm
Features
- Mocking of Extension Attribute classes
- Mocking of Factory classes
- Mocking of Proxy classes
- Stubs for badly annotated classes
Configuration
If you don't want to enable one of the mock categories or the loading of the stubs, you can disable them in your psalm.xml
by setting these flags:
<?xml version="1.0"?> <psalm> <!-- ... --> <plugins> <pluginClass class="Renttek\Magento2Psalm\Plugin"> <enableExtensionAttributeMocker>false</enableExtensionAttributeMocker> <!-- disables mocking of extension attribute classes --> <enableFactoryMocker>false</enableFactoryMocker> <!-- disables mocking of factory classes --> <enableProxyMocker>false</enableProxyMocker> <!-- disables mocking of proxy classes --> <loadStubs>false</loadStubs> <!-- disables loading of static stub files --> </pluginClass> </plugins> <!-- ... --> </psalm>