Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUGFIX] Allow final view helper classes in XSD generation #881

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion Classes/Console/Parser/PhpParser.php
Expand Up @@ -96,7 +96,7 @@ protected function parseNamespace($classContent): string
*/
protected function parseClassNameRaw($classContent): string
{
preg_match('/^\\s*(abstract)*\\s*(class|interface) ([a-zA-Z_\x7f-\xff][a-zA-Z0-9\\\\_\x7f-\xff]*)/ims', $classContent, $matches);
preg_match('/^\\s*(abstract|final)*\\s*(class|interface) ([a-zA-Z_\x7f-\xff][a-zA-Z0-9\\\\_\x7f-\xff]*)/ims', $classContent, $matches);
if (!isset($matches[2])) {
throw new ParsingException('Class file does not contain a class or interface definition', 1399285302);
}
Expand Down
1 change: 1 addition & 0 deletions Tests/Console/Unit/Parser/PhpParserTest.php
Expand Up @@ -118,6 +118,7 @@ public function nonNamespacedClassesDataProvider()
return [
'normal class' => ['class Tx_Ext_Bar {', ['className' => 'Bar', 'namespace' => 'Tx_Ext', 'separator' => '_', 'full' => 'Tx_Ext_Bar']],
'abstract class' => ['abstract class Tx_Ext_BarAbstract {', ['className' => 'BarAbstract', 'namespace' => 'Tx_Ext', 'separator' => '_', 'full' => 'Tx_Ext_BarAbstract']],
'final class' => ['final class Tx_Ext_BarFinal {', ['className' => 'BarFinal', 'namespace' => 'Tx_Ext', 'separator' => '_', 'full' => 'Tx_Ext_BarFinal']],
'without namespace' => ['class TxExtBar {', ['className' => 'TxExtBar', 'namespace' => '', 'separator' => '', 'full' => 'TxExtBar']],
];
}
Expand Down