Search by

yireo / magento2-extension-validation-tools

yireo

N/A

Package info

github.com/yireo/Yireo_ExtensionValidationTools

Type:magento2-module

pkg:composer/yireo/magento2-extension-validation-tools

Fund package maintenance!

yireo

www.paypal.me/yireo

Statistics

Installs: 1

Dependents: 0

Suggesters: 0

Stars: 1

Open Issues: 0

0.0.3 2026-11-25 16:59 UTC

This package is auto-updated.

Last update: 2026-12-02 18:41:20 UTC


README

Magento version PHP version License Latest Version

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.

Current status

Static Tests Unit Tests Integration Tests Playwright DI Compilation