Skip to content

Commit 18cec03

Browse files
authored
Merge pull request #74 from php-api-clients/ensure-all-class-names-are-checked-for-reserved-keywords
Ensure all class names are checked for reserved keywords
2 parents 3413a61 + 819295f commit 18cec03

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Generator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function generate(string $namespace, string $destinationPath)
4040

4141
public static function className(string $className): string
4242
{
43-
return str_replace(['{', '}', '-', '$', '_', '+'], ['Cb', 'Rcb', 'Dash', '_', '\\', 'Plus'], (new Convert($className))->toPascal()) . (self::isKeyword($className) ? '_' : '');
43+
return str_replace(['{', '}', '-', '$', '_', '+'], ['Cb', 'Rcb', 'Dash', '_', '\\', 'Plus'], (new Convert($className))->toPascal()) . (self::isKeyword(self::basename($className)) ? '_' : '');
4444
}
4545

4646
private static function cleanUpNamespace(string $namespace): string

0 commit comments

Comments
 (0)