-
-
Notifications
You must be signed in to change notification settings - Fork 133
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
PhpNamespace::unresolveName() does not preserve intentional leading backslash #21
Comments
What about to preserve class names when no namespace is passed to class constructor? |
It would be satisfactory i guess. |
I already have PR :) |
… specified [#21] Fixed BC break introduced in v2.3.3
It's much more better than my naive implementation. Thank you. |
… specified [#21] Fixed BC break introduced in v2.3.3
@mrtnzlml @dg due to this change I am unable to extend a class with another class on a separate namespace. the only workaround is to use the full namespace after the extends keyword (which sucks :/). I'm on v2.6 since I need php 5.6 support. Example: namespace App\Http\Controllers\Users;
use App\Http\Controllers\Controller;
class UserController extends \Controller
{
} |
Why not? $namespace = new PhpNamespace('Foo');
$class = $namespace->addClass('A');
$class->addExtend('B');
echo $namespace; generates namespace Foo;
class A extends \B
{
} or $namespace = new PhpNamespace('Foo');
$namespace->addUse('B');
$class = $namespace->addClass('A');
$class->addExtend('B');
echo $namespace; generates namespace Foo;
use B;
class A extends B
{
} |
Due to this commit (6e1b293) it's not possible to generate namespace with leading backslash. I know it was intended, but unfortunately it can be BC break. For example Kdyby\AOP generates class namespaces with leading backslash, but classes are in custom block namespace and if the leading ** is removed, it generates nonsense:
It would be great to preserve leading ** (example why). Should I prepare PR or it's completely wrong approach and should it be fixed in Kdyby?
Suggested behavior (PhpNamespace.phpt:13):
The text was updated successfully, but these errors were encountered: