yireo / yireo_extensionvalidationtools

yireo/yireo_extensionvalidationtools
magento2-module Compatibility: 2.4.7-2.4.9 Code Quality: Fail Tests: N/A Security: Pass OSL-3.0

Yireo ExtensionValidationTools

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.

Example 1: Comparing composer versions

bin/magento 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).

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"

Example 3: Creating unit tests (@todo: Move this to another module

bin/magento extension:validate:generate-unit-test --module Yireo_Webp2 --class '\Yireo\Webp2\Convertor\Convertor'

Current status

Static Tests
Unit Tests
Integration Tests
Playwright
DI Compilation

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog,
and this project adheres to Semantic Versioning.

[Unreleased]

[0.0.3] - 25 November 2026

Fixed

  • Shell command injection via the module name, PHPCS severity and PHPStan level arguments; arguments are now escaped and severity/level validated
  • PHPCS, PHPStan and PHPUnit binaries were picked up from the current working directory instead of the Magento root
  • The unit test generator instantiated arbitrary classes via the ObjectManager; it now only inspects classes of the given module via reflection and never overwrites an existing test
  • version_match accepted any file path; it now only reads an existing composer.json file
  • Untrusted values in console output could inject terminal control characters or formatting tags
  • Commands returned wrong exit codes and hid the output of PHPCS, PHPStan and PHPUnit
  • Running the tools wrote a phpstan.neon into the Magento root and changed the global PHPCS installed_paths setting
  • Broken with recent ExtensionChecker versions (removed Scan\Composer class), Symfony 7 and PHP 8.4

Changed

  • Require nette/php-generator and composer/semver explicitly and replace wildcard version constraints of magento/framework and yireo/magento2-extensionchecker
Versions
Version Stability QA Status Compatibility Released
0.0.3 stable Fail Magento 2.4.7-2.4.9 Details 2026-11-25 16:59:07
0.0.2 stable Fail Not compatible Details 2022-07-10 08:05:26
0.0.1 stable Not tested Not yet tested Details 2022-07-10 07:59:24

Requires 5

Package Constraint
composer/semver ^3.0
ext-pcre *
magento/framework ^103.0
nette/php-generator ^3.6 || ^4.0
yireo/magento2-extensionchecker ^2.0

Requires-dev 1

Package Constraint
phpunit/phpunit ^10.5 || ^11.0 || ^12.0

Compatibility

Each Magento release line is installed on its supported PHP versions, then the module is built (DI compilation + static-content deploy) and its unit and integration suites are run. The matrix shows the lines and PHP versions the module is confirmed to install and run on. Code-quality results further down (phpstan, phpcs, …) are reported separately and never affect compatibility.

Compatibility matrix (Magento × PHP)
Magento PHP 8.2 PHP 8.3 PHP 8.4 PHP 8.5
2.4.7 Pass Pass
2.4.8 Pass Pass
2.4.9 Pass Pass

Code Quality

Advisory checks against the module's source. Static analysis runs once across the whole module; PHPStan re-runs per Magento + PHP version because resolvable symbols differ between releases. These NEVER affect the Compatibility badge. A phpcs finding can't make a module incompatible.

Static analysis

Coding standards (phpcs), mess detection (phpmd), copy-pasted code (cpd), PHP cross-version compatibility, composer.json validity. Each runs once for the whole module.

Static analysis results
Tool Status Findings Summary
PHPCS Warning 51 51 warnings (ruleset: Magento2)
PHPMD Warning 4 4 rule violations (UnusedFormalParameter:2, NPathComplexity:1, MissingImport:1)
Cpd Pass 0
Composer validate Info 1 valid; 1 advisory note (composer validate --strict)

PHPStan

Type-checks the module's PHP against a real Magento install at the configured gate level. Re-runs per Magento and PHP version because resolvable symbols differ between releases.

PHPStan results by Magento and PHP version
Magento PHP 8.2 PHP 8.3 PHP 8.4 PHP 8.5
2.4.7 Error Error
2.4.8 5 5
2.4.9 5 5

Tests

Unit and integration suites, run for each applicable Magento and PHP version. A test failure speaks to the module's behaviour, not its compatibility with a Magento line, so it is reported here separately and never reddens the compatibility matrix.

Unit tests

Unit tests results by Magento and PHP version
Magento PHP 8.2 PHP 8.3 PHP 8.4 PHP 8.5
2.4.7 N/A N/A
2.4.8 N/A N/A
2.4.9 N/A N/A

Integration tests

Integration tests results by Magento and PHP version
Magento PHP 8.2 PHP 8.3 PHP 8.4 PHP 8.5
2.4.7 N/A N/A
2.4.8 N/A N/A
2.4.9 N/A N/A

Security

Security checks run directly against the module: an audit of its declared dependencies for known vulnerabilities (composer audit) and a scan of its source for malware and web-shell signatures. Each runs once. A malware detection fails the version outright.

Security results
Tool Status Findings Summary
Composer audit Pass 0
Malware scan Pass 0
License
OSL-3.0

More from yireo

View vendor
Make it pay

Turn an existing module into recurring revenue.

If you already maintain a Magento 2 module on GitHub or GitLab, listing it on Packagento takes about five minutes. We mirror your tags, handle distribution signing, and route paid licenses through Stripe Connect, so you can keep shipping the way you already do.