-
-
Notifications
You must be signed in to change notification settings - Fork 147
Closed
Description
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:
namespace Kdyby\Aop_CG\Container_1ad39c5e84 {
use Kdyby\Aop\Pointcut\Matcher\Criteria;
use Symfony\Component\PropertyAccess\PropertyAccess;
final class Model_PagesClass_85_Model_Pages extends Model\Pages
{
// ... ^- should be \Model\Pages
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):
$namespace = new PhpNamespace;
Assert::same('\A', $namespace->unresolveName('\A')); //preserve leading backslash
Assert::same('A', $namespace->unresolveName('A'));
Assert::same('foo\A', $namespace->unresolveName('foo\A'));
Metadata
Metadata
Assignees
Labels
No labels