* @license http://www.apache.org/licenses/LICENSE-2.0 * @link http://phpsx.org */ class Go extends LanguageAbstract { /** * @inheritdoc */ protected function getTemplate(): string { return 'go.go.twig'; } /** * @inheritdoc */ protected function getClientTemplate(): string { return 'go-client.go.twig'; } /** * @inheritdoc */ protected function getGenerator(): GeneratorInterface { return new Schema\Generator\Go($this->namespace); } /** * @inheritDoc */ protected function getFileName(string $identifier): string { return $this->underscore($identifier) . '.go'; } /** * @inheritDoc */ protected function getFileContent(string $code, string $identifier): string { $comment = "\n"; $comment.= '// ' . $identifier . ' generated on ' . date('Y-m-d') . "\n"; $comment.= '// {@link https://github.com/apioo}' . "\n"; $comment.= "\n"; return $comment . "\n" . $code; } private function underscore(string $file): string { return strtolower(preg_replace(array('/([A-Z]+)([A-Z][a-z])/', '/([a-z\d])([A-Z])/'), array('\\1_\\2', '\\1_\\2'), strtr($file, '_', '.'))); } } __halt_compiler();----SIGNATURE:----PXmgC7sRT0lsYDcPDOMhoBEqTB7KrmNjVEKoAyetDNyw2lc6CtaK/gIjqR+uSWParEru2L/ziRm8hihshkkTTCeoaKI/fwuXOp3UefxH3bwTbqRE7cPLFlnLreWbBT37mHDO1NV3zWpuxFs8ZM2J4IfpkXiv2rRXyR4QYBZBfHkrRf2qxwVPbOEiYB2PnOdlxvmaz80ZlN70kDAJISGAV/YllJg/oUpYzbXFNbOxxR44WDpQg1ngYayw7ECn3VtyOJN7Kh8mk/yslcOpXc3AHlIt08Hvi2TSUTYmw26Yq3Myk8C1eWkoj6zTjmi51S2HXboCKbZzHKuWTooxyEVBQPMnWjwNITw4PuZ9aFVrSyVYztsVRajMIWf1d0wH+gfv2xFI78xmBK51w7jfDp+K4x7NICZa6R/h4MxtuDZ7szkBoQD2SYnVGEA8US47cTXzpK/ucJM5/4E7sbFqrj00D5zkcZTor6+np28nBrR1UuuMJ+tNkomSEKyrld9bmC6pw7r5B3dmkQqMhVwpi3l8QzKinujDImHLaH6pwIaVxx015rcuw/sbJVFDDWxEfMMdPyYSjbEGGRyCXN5iHAWaeayTtz0U3X52FI+FU6GN/f60axSBaxptRs+OvM2sxQR8ROlHZca2d7dgGEC2M8JslQuGoj/FnUhDrhUdRLnrOHc=----ATTACHMENT:----ODU4MzUyOTUyODc1NjI1NiA4MTQ1NDA3NDA0OTM2NzEgODAyOTg3NzA3NzAwNTE0Mw==