How to import global functions that has namespace?

In PhpStorm there's only “replace with alias” when you want to refactor the namespace, on the other hand when you hit enter it doesn't import the namespace:

VIDEO: https://imgur.com/a/um99g0v

0

Hi Foremtehan,

Please check whether the Inspections > PHP > Code Style > Fully qualified name usage inspection is enabled:

0

Hello,

I have tried to play around with the "hypervel/foundation" package from your initial screencast and was able to reproduce the behaviour on my setup.

From what I have discovered, it happens specifically with the collect() function as it is also defined in a global namespace in the vendor/hypervel/support/src/helpers.php file (line 104).

For this specific case, you may want to additionally exclude this file from the “PHP > Include Path” to avoid interference with the function declaration from vendor/hyperf/collection/src/Functions.php.

0

请先登录再写评论。