-
-
Notifications
You must be signed in to change notification settings - Fork 140
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
Force root namespace #31
Comments
Use full class name with namespace, ie |
What about this?
WTF? If I wanted those backslashes, I'd type them. |
$ns = new Nette\PhpGenerator\PhpNamespace('App\Ns');
$class = $ns->addClass('Test');
$method = $class->addMethod('assemble');
$method->addParameter('request')->setTypeHint('Psr\Http\Message\ServerRequestInterface');
$method->setReturnType('Psr\Http\Message\ServerRequestInterface')->setReturnNullable();
$ns->addUse('Psr\Http\Message\ServerRequestInterface');
echo $ns; |
@milo That wasn't an answer to my question - why can't I just do |
@AZBosakov I only shown the solution. Answer to you question is, that you are using API of this library in a wrong way. |
Auto-resolving can be now turned off this way: $printer = new Nette\PhpGenerator\Printer; // or PsrPrinter
$printer->setTypeResolving(false);
echo $printer->printNamespace($namespace); |
Hi
I crate class with namespace and i want to extend from that namespace but not imposible
Because it create backslash before extend class:
The text was updated successfully, but these errors were encountered: