PHP 5.3: New `PHPCompatibility.Namespaces.ReservedNames` sniff by jrfnl · Pull Request #1026 · PHPCompatibility/PHPCompatibility
jrfnl
changed the title
New
PHP 5.3: New PHPCompatibility.Namespaces.ReservedNames sniffPHPCompatibility.Namespaces.ReservedNames sniff
> The Namespace name PHP, and compound names starting with this name (like PHP\Classes) are reserved for internal language use and should not be used in the userspace code. Source: https://www.php.net/manual/en/language.namespaces.rationale.php This PR introduces a new `PHPCompatibility.Namespaces.ReservedNames` sniff to detect use of namespace names reserved by PHP, in userland code. The sniff will throw a `warning` when a reserved namespace name is detected. This sniff is along the same lines as the `PHPCompatibility.FunctionNameRestrictions.ReservedFunctionNames` sniff which does the same for reserved function names to prevent code being introduced in userland code which has a high risk of being incompatible with future PHP versions. Includes unit tests. Fixes 1025
wimg approved these changes May 5, 2020
wimg
deleted the
feature/1025-new-namespace-reserved-name-sniff
branch
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