-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: Namespace internal functions and constants #6807
Comments
I'm personally not convinced this is a good approach, it makes code much harder to read... I'd be +1 only if there is noticeable speedup at runtime which I doubt this would bring. 😕 |
@Majkl578 a better approach is to import them via |
If we want to do this, we can use |
Not worried by amount of imports: better than inline diffs by far, plus we
can grep it if we ever need to get rid of something bad coming from core.
…On 1 Jan 2018 23:44, "Michael Moravec" ***@***.***> wrote:
If we want to do this, we can use SlevomatCodingStandard.Namespaces.
FullyQualifiedGlobalFunctions
<https://github.com/slevomat/coding-standard#slevomatcodingstandardnamespacesfullyqualifiedglobalconstants>
for CS enforcement, but it currently sees no difference between \ and use
function - if we only want one (use function), we need to extend it a bit.
Also be aware that this approach could easily end up with 20+ use
statements for functions (typically collapsed by IDE, but still).
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#6807 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAJakMvRqbMXJaSeZ0lWNQ1kimM1rWGmks5tGV_ggaJpZM4QPTFv>
.
|
|
I prepared this in doctrine/coding-standard@15968c3, example of how noisy it'd be is here: Majkl578@2b69bd9 |
This has already been done in master. :) |
Couldn't find any other issue mentioning it. If interested i could make a pull request. There are multiple tools to achieve this:
https://github.com/nilportugues/php-backslasher
https://github.com/Roave/FunctionFQNReplacer
https://github.com/kelunik/fqn-check
https://github.com/FriendsOfPHP/PHP-CS-Fixer (native_function_invocation )
The text was updated successfully, but these errors were encountered: