Req #52504 [Com]: Support relative namespaces
| From: | admin at manix dot info | Date: | Mon, 21 Sep 2020 10:20:33 +0000 |
| Subject: | Req #52504 [Com]: Support relative namespaces | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-229105@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=52504&edit=1
ID: 52504
Comment by: admin at manix dot info
Reported by: robert dot de dot wilde at online dot nl
Summary: Support relative namespaces
Status: Not a bug
Type: Feature/Change Request
Package: Class/Object related
Operating System: Any
PHP Version: 5.3.3
Block user comment: N
Private report: N
New Comment:
10 years in, maybe it's time this gets some attention?
Previous Comments:
------------------------------------------------------------------------
[2018-05-03 19:36:02] robert at interjinn dot com
I'd really like to see parent relative path support also. It would be much more readable than
all these absolute namespace paths or a use at the top for a single instance. We're all used to
filesystem paths, reading ..\ takes minimal brainpower and I'd argue makes the code MORE
readable.
------------------------------------------------------------------------
[2015-11-12 07:33:34] slegersjohn at gmail dot com
johannes@php.net said :
"Adding support for the ..\..\Foo\Bar notation quickly requires quite some brain power to read
the code"
Seriously? I'm, it not only reads to MORE readable code, but it makes your code a hell of a lot
more maintainable.
------------------------------------------------------------------------
[2014-11-11 09:34:21] andy at andyburton dot co dot uk
Agree this would be a nice addition.
------------------------------------------------------------------------
[2014-10-05 17:16:38] dodonnell at gmail dot com
Agreed that in my opinion ..\ does not require more brainpower. I think the syntax is pretty
self-explanatory to pretty much any one who knows some basic programming and, more importantly,
prevents having to use a lot of absolute namespacing that is sensitive to structural changes in a
project.
------------------------------------------------------------------------
[2013-11-05 18:50:47] mtdowling at gmail dot com
This feature request would allow libraries to be written in a way that they can be vendored inside
of other libraries without having to modify the library being vendored. Other languages, e.g.,
Python, allow this type of relative namespace traversal.
I don't agree that it would be hard to read or require "more brain power".
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=52504
--
Edit this bug report at https://bugs.php.net/bug.php?id=52504&edit=1