[TOOLS] Use GSActor rather than Gsactor in autogenerated code

This commit is contained in:
Hugo Sales 2021-02-20 20:59:32 +00:00
parent 460712e15e
commit b27bda6a7c
No known key found for this signature in database
GPG Key ID: 7D0C7EAFC9D835A0

View File

@ -1,4 +1,4 @@
#!/usr/local/bin/php
#!/usr/bin/php
<?php
use Symfony\Component\Yaml\Yaml;
@ -50,7 +50,7 @@ foreach ($files as $file) {
$nullable = !@$schema['fields'][$field]['not null'] ? '?' : '';
$type = types[$schema['fields'][$field]['type']];
$type = $type !== '' ? $nullable . $type : $type;
$method_name = str_replace(' ', '', ucwords(str_replace('_', ' ', $field)));
$method_name = str_replace([' ', 'Gsactor'], ['', 'GSActor'], ucwords(str_replace('_', ' ', $field)));
$default = @$schema['fields'][$field]['default'];
if (isset($default) && $nullable != '?' && $type != 'DateTimeInterface') {
@ -78,11 +78,9 @@ foreach ($files as $file) {
$end = '// }}} Autocode';
$code = "
{$begin}
{$fields_code}
{$methods_code}
{$end}";
foreach (['/\\//' => '\\/', '/ /' => '\\ '] as $from => $to) {