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
PHP code is generated by `Printer` objects. There is a `PsrPrinter` whose output conforms to PSR-2 and PSR-12 and uses spaces for indentation, and a `Printer` that uses tabs for indentation.
@@ -551,11 +559,10 @@ new Literal('substr(?, ?)', [$a, $b]);
551
559
```
552
560
553
561
554
-
555
562
Attributes
556
563
----------
557
564
558
-
You can add PHP 8 attributes to all classes, methods, properties, constants, enum cases, functions, closures and parameters (class [Attribute](https://api.nette.org/php-generator/master/Nette/PhpGenerator/Attribute.html)).
565
+
You can add PHP 8 attributes to all classes, methods, properties, constants, enum cases, functions, closures and parameters. [Literals](#literals) can also be used as parameter values.
559
566
560
567
```php
561
568
$class = new Nette\PhpGenerator\ClassType('Demo');
**When the class is part of the namespace, it is rendered slightly differently**: all types (ie. type hints, return types, parent class name,
642
651
implemented interfaces, used traits and attributes) are automatically *resolved* (unless you turn it off, see below).
643
-
It means that you have to **use full class names** in definitions and they will be replaced
644
-
with aliases (according to the use-statements) or fully qualified names in the resulting code:
652
+
It means that you have to **use full class names** in definitions and they will be replaced with aliases (according to the use-statements) or fully qualified names in the resulting code:
645
653
646
654
```php
647
655
$namespace = new Nette\PhpGenerator\PhpNamespace('Foo');
0 commit comments