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

DI\link() shorten to link() conflicts with PHP's native link() function -> replace with DI\get() #235

Closed
mnapoli opened this Issue Mar 12, 2015 · 0 comments

Comments

Projects
None yet
1 participant
@mnapoli
Member

mnapoli commented Mar 12, 2015

With PHP 5.6 we can import functions:

use function DI\object;

return [
    'FooInterface' => object('Foo'),
];

However DI\link() would be shortened to link(), which already exist in the root namespace as the link() function

This is not a show stopper since we can still use DI\link() or use function DI\link and later link(), but this is confusing for users. Also PhpStorm will by default not offer to import the function as it recognizes PHP's built-in link() function…

I've never liked link() anyway so this could be a good reason to introduce an alternative in PHP-DI 5, such as get(). Of course DI\link() would continue to work and would be an alias to DI\get().

@mnapoli mnapoli added the enhancement label Mar 12, 2015

@mnapoli mnapoli added this to the 5.0 milestone Mar 12, 2015

@mnapoli mnapoli changed the title from DI\link() shorten to link() conflicts with PHP's native link() function to DI\link() shorten to link() conflicts with PHP's native link() function -> replace with DI\get() Mar 12, 2015

mnapoli added a commit that referenced this issue Mar 21, 2015

@mnapoli mnapoli closed this Mar 21, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment