yireo / magento2-extension-validation-tools
N/A
Package info
github.com/yireo/Yireo_ExtensionValidationTools
Type:magento2-module
pkg:composer/yireo/magento2-extension-validation-tools
Requires
- ext-pcre: *
- composer/semver: ^3.0
- magento/framework: ^103.0
- nette/php-generator: ^3.6 || ^4.0
- yireo/magento2-extensionchecker: ^2.0
Requires (Dev)
- phpunit/phpunit: ^10.5 || ^11.0 || ^12.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-12-02 18:41:20 UTC
README
This extension validates the code of other extensions and is complementary to static code analysis tools like PHPCS.
Comparing composer versions
bin/magento yireo_extension_validate:version_match /path/to/your/extension/composer.json
This command allows you to scan a given composer.json of some extension, without that extension being installed. This allows you to modify the dependencies of that extension, before trying to install the extension (which could save valuable time). Platform requirements (php, ext-*, lib-*, composer-plugin-api and composer-runtime-api) are skipped.
The output should be empty to be successful. When unmatched versions are found, it might look like the following:
ERROR: "magento/framework:103.0.0" does not match required version "^100.1|^101.0|^102.0"
Creating unit tests
bin/magento yireo_extension_validate:generate-unit-test --module Yireo_Webp2 --class '\Yireo\Webp2\Convertor\Convertor'
This generates a skeleton test (Test/Unit/) with an incomplete test method per public method. Existing tests are never overwritten. Interfaces, traits, enums and abstract classes are rejected.
Running tools for a module
bin/magento yireo_extension_validate:phpcs Yireo_Webp2 9 bin/magento yireo_extension_validate:phpstan Yireo_Webp2 5 bin/magento yireo_extension_validate:unit Yireo_Webp2
The binaries vendor/bin/phpcs, vendor/bin/phpstan and vendor/bin/phpunit of the Magento root are used. The unit tests use the Magento configuration dev/tests/unit/phpunit.xml (or phpunit.xml.dist) when available, without loading PHPUnit extensions.