-
Notifications
You must be signed in to change notification settings - Fork 185
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
Automatically add use statement #234
Comments
I would love to have this, and it is not even hard that hard to implement. |
Glad to hear it wouldn't be difficult. I hope you'll forgive me for not contributing beyond the request 0:-) |
👍 |
Here is the sublime equivalent if it helps. |
@felixfbecker Is there any protocol I can use? |
yeah, you can return |
@felixfbecker How to get the positon of the first php start tag after the namespace definition? I don't have any (serious) idea. Should I set a variable in |
Theres a |
Beautiful. I thought I need to implement this functionality myself. |
Ah, there is a bug. |
Functions that return nothing return |
This does not. That's the bug. |
function foo() {
}
$f = foo();
var_dump($f); // NULL |
It's better to return that from the code, isn't it? |
It makes not difference |
okay. |
How is the PHP start tag called in php-parser? I'd looked in the files, but I couldn't find anything related. |
There is no PHP start tag, only |
But I can't rely on that, can I? I need to find the first "save" location where I can insert the use statement. At the moment I'm searching for a fallback when there is no namespace statement. |
before the first class definition? |
yes, and maybe behind the declare node(implemented). But I need a fallback. |
The fallback would just be at the root? Which is the |
But then it may be possible to get a use statement right after inline html? |
@jens1o how is it going? |
Hmm, I didn't continued, since I have school again and I'm writing lots of exams... So yeah, I need some help. In the evening, I'll push my tries, maybe you can contribute.. |
@jens1o where can we find the branch? |
On my old pc. Dammit. I'm again in exam phase, I'm sorry. Even though, I would have to write it again because of the new parser. Before I can do that, I would like to push forward foreach support. |
When adding a class in the code, it would be great if the use statement was automatically written into the top of the file. Thanks for considering!
The text was updated successfully, but these errors were encountered: