/**
* @param Resource $resource
* @param array $data
*/
public function generate(Resource $resource, array $data = array())
{
$filepath = $resource->getSrcFilename();
$methodName = $data['name'];
$arguments = $data['arguments'];
$content = $this->getContent($resource, $methodName, $arguments);
$code = $this->appendMethodToCode($this->filesystem->getFileContents($filepath), $content);
$this->filesystem->putFileContents($filepath, $code);
$this->io->writeln(sprintf("<info>Method <value>%s::%s()</value> has been created.</info>\n", $resource->getSrcClassname(), $methodName), 2);
}