Repository navigation
Report the functions and classes of extensions composer.json doesn't declare - #14234
Conversation
…declare MissingExtensionRequirement is reported where code calls a function, or instantiates, statically uses, extends or implements a class, of a non-core extension that composer.json neither requires (require, require-dev), suggests nor gets from an installed package (provide, replace), outside of an extension_loaded(), function_exists() or class_exists() check of it. Psalm's own composer.json now requires ext-filter, which it uses unguarded, and suggests the extensions it uses when available; Phar::running() is only called with ext-phar.
✅ Performance: unchanged · Types: increased
How to read this table
✅ laravel: issues +23 −0Memory 1 768 → 1 769 MB (<0.1 %) · Wall 93.3 → 93.7 s (+0.4 %) Weighted 52 994 → 53 040 (+46, +0.09 %): L2 +23
Added (23)
✅ symfony: issues +1090 −0Memory 3 627 → 3 628 MB (<0.1 %) · Wall 248.5 → 250.1 s (+0.6 %) Weighted 98 398 → 100 580 (+2 182, +2.22 %): L2 +1 089 · L4 +1
Added (1090)
✅ doctrine-orm: issues +5 −0Memory 380 → 380 MB (<0.1 %) · Wall 15.1 → 15.1 s (+0.1 %) Weighted 6 143 → 6 153 (+10, +0.16 %): L2 +5
Added (5)
✅ psl: issues +20 −0Memory 617 → 617 MB (<0.1 %) · Wall 19.9 → 20.0 s (+0.3 %) Weighted 5 597 → 5 637 (+40, +0.71 %): L2 +20
Added (20)
✅ phpunit: issues +4 −0Memory 455 → 455 MB (<0.1 %) · Wall 14.7 → 15.3 s (+3.8 %) Weighted 3 410 → 3 418 (+8, +0.23 %): L2 +4
Added (4)
✅ tempest: issues +30 −0Memory 895 → 895 MB (<0.1 %) · Wall 28.1 → 28.3 s (+0.5 %) Weighted 10 507 → 10 567 (+60, +0.57 %): L2 +30
Added (30)
✅ guzzle-promises: issues +1 −0Memory 44 → 45 MB (+0.2 %) · Wall 1.6 → 1.7 s (+3.0 %) Weighted 434 → 436 (+2, +0.46 %): L2 +1
Added (1)
✅ monolog: issues +4 −0Memory 135 → 135 MB (<0.1 %) · Wall 5.9 → 6.2 s (+4.4 %) Weighted 2 479 → 2 491 (+12, +0.48 %): L2 +2 · L4 +2
Added (4)
✅ drupal: issues +149 −0Memory 4 843 → 4 843 MB (<0.1 %) · Wall 138.8 → 138.8 s (<0.1 %) Weighted 169 347 → 169 645 (+298, +0.18 %): L2 +149
Added (149)
✅ wordpress: issues +691 −0Memory 2 040 → 2 041 MB (<0.1 %) · Wall 103.7 → 105.4 s (+1.6 %) Weighted 676 798 → 678 190 (+1 392, +0.21 %): L2 +686 · L4 +5
Added (691)
composer.json changed in this PR, so head dependencies were re-resolved; memory and time deltas are informational. head e290213 · base 7baa8fc (merge-base) · workflow run |
…, and know those PHP 8.5 always builds
# Conflicts: # src/Psalm/Config.php # src/Psalm/Internal/Analyzer/Statements/Expression/ClassConstAnalyzer.php # src/Psalm/Internal/Codebase/InternalCallMapHandler.php # tests/Config/ConfigTest.php
Psalm doesn't report code using an extension that
composer.jsondoesn't declare: it fails with anErroron a PHP without it. The newMissingExtensionRequirementissue reports it;suggest, polyfills thatprovidethe extension andextension_loaded()/function_exists()/class_exists()checks count as declaring it optional.Before (
composer.jsonwithoutext-mbstring)After
Psalm's own
composer.jsonnow requiresext-filter(filter_var()is used unguarded) and suggestsext-pcntl,ext-posix,ext-readlineandext-zlib.