Repository navigation
Fix PHAR scoping of trigger_deprecation(), remove stale scoper patchers - #6857
Merged
Merged
Conversation
- Expose trigger_deprecation() so Symfony's unqualified calls reach it (they called a nonexistent function unless the analysed project defined it) - Exclude Composer ClassLoader and InstalledVersions via exclude-classes instead of a per-file patcher (also fixes nette/bootstrap) - Apply the use PhpParser; fix to all files (fixes nette/php-generator) - Remove patchers that no longer change anything Amp-Thread-ID: https://ampcode.com/threads/T-01a179f8-e6bb-7020-8500-cfc35a10dfc5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Audit of the current
phpstan.phar(all references, including vendor) againstscoper.inc.php.Fixes
symfony/deprecation-contractsdeclares\_PHPStan_*\trigger_deprecation, but symfony/console, finder and service-contracts calltrigger_deprecation()unqualified, which falls back to a global function that doesn't exist. E.g.Helper::strlen()fails withCall to undefined function _PHPStan_…\Symfony\Component\Console\Helper\trigger_deprecation()unless the analysed project defines it.expose-functionsmakes Box add a global alias invendor/autoload.php, the same as forctype_*.Composer\Autoload\ClassLoaderandComposer\InstalledVersionsare now inexclude-classesinstead of a per-file patcher. This also fixes the prefixed reference in nette/bootstrap'sConfigurator.use PhpParser;fix now applies to every file. This fixes nette/php-generator'sExtractor.Removed patchers that no longer change any file: nette
Compiler.php|Nette\DI\Statement,ComposerHelperInstalledVersions,Core/Core_d.php, the php-parser prefix strip (already covered byuse PhpParser;), and better-reflectionPropertyHookType.Verification: I re-scoped every file with php-scoper 0.18.19 using the old and new configs. Apart from the three intended fixes, the output is identical. A full Box compile with the new config produced
trigger_deprecationinvendor/autoload.php, andHelper::strlen()now works. The PHAR analyses code normally, including in parallel.