@@ -125,26 +125,15 @@ public function __toString()
125
125
. "; \n" ;
126
126
}
127
127
128
- $ extends = $ implements = $ traits = array ();
128
+ $ extends = (array ) $ this ->extends ;
129
+ $ implements = $ this ->implements ;
130
+ $ traits = $ this ->traits ;
129
131
if ($ this ->namespace ) {
130
- foreach ((array ) $ this ->extends as $ name ) {
131
- $ extends [] = $ this ->namespace ->unresolveName ($ name );
132
+ $ extends = array_map (array ($ this ->namespace , 'unresolveName ' ), $ extends );
133
+ $ implements = array_map (array ($ this ->namespace , 'unresolveName ' ), $ implements );
134
+ $ traits = array_map (array ($ this ->namespace , 'unresolveName ' ), $ traits );
132
135
}
133
136
134
- foreach ((array ) $ this ->implements as $ name ) {
135
- $ implements [] = $ this ->namespace ->unresolveName ($ name );
136
- }
137
-
138
- foreach ((array ) $ this ->traits as $ name ) {
139
- $ traits [] = $ this ->namespace ->unresolveName ($ name );
140
- }
141
-
142
- } else {
143
- $ extends = (array ) $ this ->extends ;
144
- $ implements = (array ) $ this ->implements ;
145
- $ traits = (array ) $ this ->traits ;
146
- }
147
-
148
137
foreach ($ this ->methods as $ method ) {
149
138
$ method ->setNamespace ($ this ->namespace );
150
139
}
@@ -155,11 +144,11 @@ public function __toString()
155
144
. ($ this ->final ? 'final ' : '' )
156
145
. $ this ->type . ' '
157
146
. $ this ->name . ' '
158
- . ($ this -> extends ? 'extends ' . implode (', ' , $ extends ) . ' ' : '' )
159
- . ($ this -> implements ? 'implements ' . implode (', ' , $ implements ) . ' ' : '' )
147
+ . ($ extends ? 'extends ' . implode (', ' , $ extends ) . ' ' : '' )
148
+ . ($ implements ? 'implements ' . implode (', ' , $ implements ) . ' ' : '' )
160
149
. "\n{ \n"
161
150
. Strings::indent (
162
- ($ this -> traits ? 'use ' . implode (', ' , $ traits ) . "; \n\n" : '' )
151
+ ($ traits ? 'use ' . implode (', ' , $ traits ) . "; \n\n" : '' )
163
152
. ($ this ->consts ? implode ('' , $ consts ) . "\n" : '' )
164
153
. ($ this ->properties ? implode ("\n" , $ properties ) . "\n" : '' )
165
154
. ($ this ->methods ? "\n" . implode ("\n\n\n" , $ this ->methods ) . "\n\n" : '' ), 1 )
0 commit comments