Skip to content
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
Milestone

Comments

@mnapoli
Copy link
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 this to the 5.0 milestone Mar 12, 2015
@mnapoli mnapoli changed the title DI\link() shorten to link() conflicts with PHP's native link() function DI\link() shorten to link() conflicts with PHP's native link() function -> replace with DI\get() Mar 12, 2015
@mnapoli mnapoli closed this as completed Mar 21, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant