nette / php-generator

🐘 Generates neat PHP code for you. Supports new PHP 8.3 features.
https://doc.nette.org/php-generator
Other
2.11k stars 138 forks source link

Use contant name as default parameter value #34

Closed samizdam closed 6 years ago

samizdam commented 6 years ago

Close #33

dg commented 6 years ago

Try this

$method->addParameter('c')->setDefaultValue(new Nette\PhpGenerator\PhpLiteral('DateTime::ISO8601'));
samizdam commented 6 years ago

@dg it is work, great! Thanks.
My inattention( PhpLiteral is present in readme.