apache / apache/netbeans

Importing global PHP functions

Open
#4,527 3 comments 2 reactions 0 assignees View on GitHub
kind:feature needs:triage PHP
Dominant language
Java
Stars
3.1k
Forks
935
Avg merge
2d 3h
Merged PRs (30d)
17

Description

### Description

Hello!

Right now only functions from other namespaces can be imported (and `count` for some reason) with the `use function` directive. All other display the `cannot be resolved` in the `Fix imports in Current Namespace` window.

### Use case/motivation

I have found the `use function` to be far more elegant than the prefixed syntax, but I have to do it manually. Being able to import them automatically like the class names would save a lot of tedious minor work.

### Related issues

_No response_

### Are you willing to submit a pull request?

No

### Code of Conduct

Yes

Contributor guide

Open the contributing guide

Research direction

Start by locating the PHP implementation behind the “Fix imports in Current Namespace” window and compare its handling of namespaced functions with the existing `count` special case. Done means global PHP functions are recognized and offered as `use function` imports, with the existing import-fix behavior preserved.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.