@@ -49,7 +49,7 @@ public function printFunction(GlobalFunction $function, ?PhpNamespace $namespace
49
49
$ body = ltrim (rtrim (Strings::normalize ($ body )) . "\n" );
50
50
51
51
return $ this ->printDocComment ($ function )
52
- . self :: printAttributes ($ function ->getAttributes ())
52
+ . $ this -> printAttributes ($ function ->getAttributes ())
53
53
. $ line
54
54
. $ this ->printParameters ($ function , strlen ($ line ) + strlen ($ returnType ) + 2 ) // 2 = parentheses
55
55
. $ returnType
@@ -72,7 +72,7 @@ public function printClosure(Closure $closure, ?PhpNamespace $namespace = null):
72
72
$ body = Helpers::simplifyTaggedNames ($ closure ->getBody (), $ this ->namespace );
73
73
$ body = ltrim (rtrim (Strings::normalize ($ body )) . "\n" );
74
74
75
- return self :: printAttributes ($ closure ->getAttributes (), inline: true )
75
+ return $ this -> printAttributes ($ closure ->getAttributes (), inline: true )
76
76
. 'function '
77
77
. ($ closure ->getReturnReference () ? '& ' : '' )
78
78
. $ this ->printParameters ($ closure )
@@ -93,7 +93,7 @@ public function printArrowFunction(Closure $closure, ?PhpNamespace $namespace =
93
93
94
94
$ body = Helpers::simplifyTaggedNames ($ closure ->getBody (), $ this ->namespace );
95
95
96
- return self :: printAttributes ($ closure ->getAttributes ())
96
+ return $ this -> printAttributes ($ closure ->getAttributes ())
97
97
. 'fn '
98
98
. ($ closure ->getReturnReference () ? '& ' : '' )
99
99
. $ this ->printParameters ($ closure )
@@ -120,7 +120,7 @@ public function printMethod(Method $method, ?PhpNamespace $namespace = null, boo
120
120
$ braceOnNextLine = $ this ->bracesOnNextLine && !str_contains ($ params , "\n" );
121
121
122
122
return $ this ->printDocComment ($ method )
123
- . self :: printAttributes ($ method ->getAttributes ())
123
+ . $ this -> printAttributes ($ method ->getAttributes ())
124
124
. $ line
125
125
. $ params
126
126
. $ returnType
@@ -133,7 +133,8 @@ public function printMethod(Method $method, ?PhpNamespace $namespace = null, boo
133
133
public function printClass (
134
134
ClassType |InterfaceType |TraitType |EnumType $ class ,
135
135
?PhpNamespace $ namespace = null ,
136
- ): string {
136
+ ): string
137
+ {
137
138
$ this ->namespace = $ this ->resolveTypes ? $ namespace : null ;
138
139
$ class ->validate ();
139
140
$ resolver = $ this ->namespace
@@ -159,7 +160,7 @@ public function printClass(
159
160
foreach ($ class ->getCases () as $ case ) {
160
161
$ enumType ??= is_scalar ($ case ->getValue ()) ? get_debug_type ($ case ->getValue ()) : null ;
161
162
$ cases [] = $ this ->printDocComment ($ case )
162
- . self :: printAttributes ($ case ->getAttributes ())
163
+ . $ this -> printAttributes ($ case ->getAttributes ())
163
164
. 'case ' . $ case ->getName ()
164
165
. ($ case ->getValue () === null ? '' : ' = ' . $ this ->dump ($ case ->getValue ()))
165
166
. "; \n" ;
@@ -174,7 +175,7 @@ public function printClass(
174
175
. 'const ' . $ const ->getName () . ' = ' ;
175
176
176
177
$ consts [] = $ this ->printDocComment ($ const )
177
- . self :: printAttributes ($ const ->getAttributes ())
178
+ . $ this -> printAttributes ($ const ->getAttributes ())
178
179
. $ def
179
180
. $ this ->dump ($ const ->getValue (), strlen ($ def )) . "; \n" ;
180
181
}
@@ -205,7 +206,7 @@ public function printClass(
205
206
. '$ ' . $ property ->getName ());
206
207
207
208
$ properties [] = $ this ->printDocComment ($ property )
208
- . self :: printAttributes ($ property ->getAttributes ())
209
+ . $ this -> printAttributes ($ property ->getAttributes ())
209
210
. $ def
210
211
. ($ property ->getValue () === null && !$ property ->isInitialized ()
211
212
? ''
@@ -243,7 +244,7 @@ public function printClass(
243
244
$ line [] = $ class ->getName () ? null : '{ ' ;
244
245
245
246
return $ this ->printDocComment ($ class )
246
- . self :: printAttributes ($ class ->getAttributes ())
247
+ . $ this -> printAttributes ($ class ->getAttributes ())
247
248
. implode (' ' , array_filter ($ line ))
248
249
. ($ class ->getName () ? "\n{ \n" : "\n" )
249
250
. ($ members ? $ this ->indent (implode ("\n" , $ members )) : '' )
@@ -333,7 +334,7 @@ protected function printParameters(Closure|GlobalFunction|Method $function, int
333
334
$ promoted = $ param instanceof PromotedParameter ? $ param : null ;
334
335
$ params [] =
335
336
($ promoted ? $ this ->printDocComment ($ promoted ) : '' )
336
- . ($ attrs = self :: printAttributes ($ param ->getAttributes (), inline: true ))
337
+ . ($ attrs = $ this -> printAttributes ($ param ->getAttributes (), inline: true ))
337
338
. ($ promoted ?
338
339
($ promoted ->getVisibility () ?: 'public ' )
339
340
. ($ promoted ->isReadOnly () && $ type ? ' readonly ' : '' )
0 commit comments