@@ -61,27 +61,6 @@ class ClassGenerator extends \Zend\Code\Generator\ClassGenerator implements
61
61
'passedByReference ' => 'setPassedByReference ' ,
62
62
];
63
63
64
- /**
65
- * @var array Array of string names
66
- */
67
- protected $ traits = array ();
68
-
69
- public function setTraits (array $ traits )
70
- {
71
- $ this ->traits = $ traits ;
72
- return $ this ;
73
- }
74
-
75
- /**
76
- * Returns the "traits" classes
77
- *
78
- * @return array
79
- */
80
- public function getTraits ()
81
- {
82
- return $ this ->traits ;
83
- }
84
-
85
64
/**
86
65
* @param object $object
87
66
* @param array $data
@@ -230,77 +209,4 @@ public function getNamespaceName()
230
209
{
231
210
return ltrim (parent ::getNamespaceName (), '\\' );
232
211
}
233
-
234
- /**
235
- * @return string
236
- */
237
- public function generate ()
238
- {
239
- if (!$ this ->isSourceDirty ()) {
240
- $ output = $ this ->getSourceContent ();
241
- if (!empty ($ output )) {
242
- return $ output ;
243
- }
244
- }
245
-
246
- $ output = '' ;
247
-
248
- if (null !== ($ namespace = $ this ->getNamespaceName ())) {
249
- $ output .= 'namespace ' . $ namespace . '; ' . self ::LINE_FEED . self ::LINE_FEED ;
250
- }
251
-
252
- $ uses = $ this ->getUses ();
253
- if (!empty ($ uses )) {
254
- foreach ($ uses as $ use ) {
255
- $ output .= 'use ' . $ use . '; ' . self ::LINE_FEED ;
256
- }
257
- $ output .= self ::LINE_FEED ;
258
- }
259
-
260
- if (null !== ($ docBlock = $ this ->getDocBlock ())) {
261
- $ docBlock ->setIndentation ('' );
262
- $ output .= $ docBlock ->generate ();
263
- }
264
-
265
- if ($ this ->isAbstract ()) {
266
- $ output .= 'abstract ' ;
267
- }
268
-
269
- $ output .= 'class ' . $ this ->getName ();
270
-
271
- if (!empty ($ this ->extendedClass )) {
272
- $ output .= ' extends ' . $ this ->extendedClass ;
273
- }
274
-
275
- $ implemented = $ this ->getImplementedInterfaces ();
276
- if (!empty ($ implemented )) {
277
- $ output .= ' implements ' . implode (', ' , $ implemented );
278
- }
279
-
280
- $ output .= self ::LINE_FEED . '{ ' . self ::LINE_FEED . self ::LINE_FEED ;
281
-
282
- $ traits = $ this ->getTraits ();
283
- if (!empty ($ traits )) {
284
- $ output .= self ::LINE_FEED . $ this ->indentation
285
- . 'use ' . (implode (', ' , $ traits )) . '; ' . self ::LINE_FEED . self ::LINE_FEED ;
286
- }
287
-
288
- $ properties = $ this ->getProperties ();
289
- if (!empty ($ properties )) {
290
- foreach ($ properties as $ property ) {
291
- $ output .= $ property ->generate () . self ::LINE_FEED . self ::LINE_FEED ;
292
- }
293
- }
294
-
295
- $ methods = $ this ->getMethods ();
296
- if (!empty ($ methods )) {
297
- foreach ($ methods as $ method ) {
298
- $ output .= $ method ->generate () . self ::LINE_FEED ;
299
- }
300
- }
301
-
302
- $ output .= self ::LINE_FEED . '} ' . self ::LINE_FEED ;
303
-
304
- return $ output ;
305
- }
306
212
}
0 commit comments