1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2025-01-08 13:51:01 +01:00
phorge-arcanist/src/lint
Joshua Spence ae210fda9f Add a linter rule for use statement namespace prefixes
Summary:
When importing or aliases a symbol with a `use` statement, the leading namespace separator is optional and does not modify the behavior. That is, `use \X` is equivalent to `use X`. As such, the latter syntax should be preferred because it is more concise.

According to the [[http://php.net/manual/en/language.namespaces.importing.php | PHP documentation]]:

> Note that for namespaced names (fully qualified namespace names containing namespace separator, such as `Foo\Bar` as opposed to global names that do not, such as `FooBar`), the leading backslash is unnecessary and not recommended, as import names must be fully qualified, and are not processed relative to the current namespace.

Test Plan: Added test cases.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley

Differential Revision: https://secure.phabricator.com/D14517
2015-11-24 06:42:39 +11:00
..
engine Improve validation of 'name' and 'code' parameters for lint messages 2015-09-25 11:16:04 -07:00
linter Add a linter rule for use statement namespace prefixes 2015-11-24 06:42:39 +11:00
renderer Fix checkstyle severities 2015-07-23 09:14:16 +10:00
ArcanistLintMessage.php Improve validation of 'name' and 'code' parameters for lint messages 2015-09-25 11:16:04 -07:00
ArcanistLintPatcher.php Extend from Phobject 2015-06-15 15:47:33 +10:00
ArcanistLintResult.php Extend from Phobject 2015-06-15 15:47:33 +10:00
ArcanistLintSeverity.php Extend from Phobject 2015-06-15 15:47:33 +10:00