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 22
22
"nette/tester" : " ^2.4" ,
23
23
"nikic/php-parser" : " ^4.15" ,
24
24
"tracy/tracy" : " ^2.8" ,
25
- "phpstan/phpstan" : " ^1.0"
25
+ "phpstan/phpstan" : " ^1.0" ,
26
+ "jetbrains/phpstorm-attributes" : " dev-master"
26
27
},
27
28
"suggest" : {
28
29
"nikic/php-parser" : " to use ClassType::from(withBodies: true) & ClassType::fromCode()"
Original file line number Diff line number Diff line change 9
9
10
10
namespace Nette \PhpGenerator \Traits ;
11
11
12
+ use JetBrains \PhpStorm \Language ;
12
13
use Nette ;
13
14
use Nette \PhpGenerator \Dumper ;
14
15
use Nette \PhpGenerator \Parameter ;
@@ -31,7 +32,11 @@ trait FunctionLike
31
32
32
33
33
34
/** @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
35
40
{
36
41
$ this ->body = $ args === null
37
42
? $ code
@@ -47,7 +52,11 @@ public function getBody(): string
47
52
48
53
49
54
/** @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
51
60
{
52
61
$ this ->body .= ($ args === null ? $ code : (new Dumper )->format ($ code , ...$ args )) . "\n" ;
53
62
return $ this ;
You can’t perform that action at this time.
0 commit comments