You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: readme.md
+11-2Lines changed: 11 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -413,8 +413,9 @@ $namespace->addUse('Http\Request', 'HttpReq'); // use Http\Request as HttpReq;
413
413
```
414
414
415
415
**IMPORTANT NOTE:** when the class is part of the namespace, it is rendered slightly differently: all types (ie. type hints, return types, parent class name,
416
-
implemented interfaces and used traits) are automatically *resolved*. It means that you have to **use full class names** in definitions
417
-
and they will be replaced with aliases (according to the use-statements) or fully qualified names in the resulting code:
416
+
implemented interfaces and used traits) are automatically *resolved* (unless you turn it off, see below).
417
+
It means that you have to **use full class names** in definitions and they will be replaced
418
+
with aliases (according to the use-statements) or fully qualified names in the resulting code:
418
419
419
420
```php
420
421
$namespace = new Nette\PhpGenerator\PhpNamespace('Foo');
@@ -455,6 +456,14 @@ class Demo implements A
455
456
}
456
457
```
457
458
459
+
Auto-resolving can be turned off this way:
460
+
461
+
```php
462
+
$printer = new Nette\PhpGenerator\Printer; // or PsrPrinter
0 commit comments