File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change 2222 "nette/tester" : " ^2.4" ,
2323 "nikic/php-parser" : " ^4.15" ,
2424 "tracy/tracy" : " ^2.8" ,
25- "phpstan/phpstan" : " ^1.0"
25+ "phpstan/phpstan" : " ^1.0" ,
26+ "jetbrains/phpstorm-attributes" : " dev-master"
2627 },
2728 "suggest" : {
2829 "nikic/php-parser" : " to use ClassType::from(withBodies: true) & ClassType::fromCode()"
Original file line number Diff line number Diff line change 99
1010namespace Nette \PhpGenerator \Traits ;
1111
12+ use JetBrains \PhpStorm \Language ;
1213use Nette ;
1314use Nette \PhpGenerator \Dumper ;
1415use Nette \PhpGenerator \Parameter ;
@@ -31,7 +32,11 @@ trait FunctionLike
3132
3233
3334 /** @param ?mixed[] $args */
34- public function setBody (string $ code , ?array $ args = null ): static
35+ public function setBody (
36+ #[Language('PHP ' )]
37+ string $ code ,
38+ ?array $ args = null ,
39+ ): static
3540 {
3641 $ this ->body = $ args === null
3742 ? $ code
@@ -47,7 +52,11 @@ public function getBody(): string
4752
4853
4954 /** @param ?mixed[] $args */
50- public function addBody (string $ code , ?array $ args = null ): static
55+ public function addBody (
56+ #[Language('PHP ' )]
57+ string $ code ,
58+ ?array $ args = null ,
59+ ): static
5160 {
5261 $ this ->body .= ($ args === null ? $ code : (new Dumper )->format ($ code , ...$ args )) . "\n" ;
5362 return $ this ;
You can’t perform that action at this time.
0 commit comments