Fixed some syntax errors

The `Zend\Code\Generator\ClassGenerator` class does not have a `setMethod` method which takes a `Zend\Code\Generator\MethodGenerator` param. Instead the `addMethodFromGenerator` method exists.

Also an object of type `Zend\Code\Generator\FileGenerator` cannot be echoed, the `generate` method should be called instead.
Merge remote-tracking branch 'origin/pr/1257'

Close #1257