Better support for namespaces
5 posts
• Page 1 of 1
Better support for namespaces
It would be great if there were better support for namespaces throughout a PHP project.
In Project Properties: Allow entering of a root namespace (eg: myOrg\MyProject)
In PHP templates: add support for $rootnamespace$ placeholder. It should account for adding to the project defined rootnamespace by including the name of the current folder. So for something in the /src/Models folder, $rootnamespace$ would translate to myOrg\MyProject\Models/
It would also be extremely helpful to have some 'use' statement helpers, where for example, something like
Would it be possible to add support for namespaces in project item templates
In Project Properties: Allow entering of a root namespace (eg: myOrg\MyProject)
In PHP templates: add support for $rootnamespace$ placeholder. It should account for adding to the project defined rootnamespace by including the name of the current folder. So for something in the /src/Models folder, $rootnamespace$ would translate to myOrg\MyProject\Models/
It would also be extremely helpful to have some 'use' statement helpers, where for example, something like
- Code: Select all
$foo = new /myOrg/MyProject/Model/Foo;
- Code: Select all
use /myOrg/MyProject/Model/Foo;
Would it be possible to add support for namespaces in project item templates
- josh
- Posts: 7
- Joined: February 27th, 2015, 7:43 pm
Re: Better support for namespaces
Yes this is a much needed feature!
For example, when developing on AS3 (where namespaces work quite like PHP) you get:
- Warnings for declared "use" full qualified class names that are actually not being used in the code.
- When locally typing a namespace, instead of adding the complete namespace it will automatically add a "use" for that class full qualified name and use only the class name.
For example, when developing on AS3 (where namespaces work quite like PHP) you get:
- Warnings for declared "use" full qualified class names that are actually not being used in the code.
- When locally typing a namespace, instead of adding the complete namespace it will automatically add a "use" for that class full qualified name and use only the class name.
- davidbcn
- Posts: 87
- Joined: September 10th, 2014, 3:07 am
Re: Better support for namespaces
Any update on this?
- josh
- Posts: 7
- Joined: February 27th, 2015, 7:43 pm
Re: Better support for namespaces
These are great suggestions! We'll introduce it in future updates for sure.
Jakub Misek │ DEVSENSE s.r.o. | @misekjakub │ jakub@devsense.com │
-
Jakub Misek - Posts: 2092
- Joined: January 4th, 2012, 2:42 pm
- Location: Prague
Re: Better support for namespaces
Just a thought, it would be great if these were actually pulled from composer.json, since it already tells you most of what you need in the the `autoload` sections
- josh
- Posts: 7
- Joined: February 27th, 2015, 7:43 pm
5 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 33 guests