Skip to content

Commit

Permalink
Allow name to be FQCN
Browse files Browse the repository at this point in the history
  • Loading branch information
dereuromark committed Nov 19, 2024
1 parent cb7019c commit e0d7a34
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/Annotator/ModelAnnotator.php
Original file line number Diff line number Diff line change
Expand Up @@ -362,9 +362,16 @@ protected function resolvePluginName(string $className, string $name): ?string {
return '';
}

preg_match('#^(.+)\\\\Model\\\\Behavior\\\\' . $name . 'Behavior$#', $className, $matches);
if (!$matches) {
return null;
if (str_contains($name, '\\')) {
preg_match('#^(.+)\\\\Model\\\\Behavior\\\\#', $className, $matches);
if (!$matches) {
return null;
}
} else {
preg_match('#^(.+)\\\\Model\\\\Behavior\\\\' . $name . 'Behavior$#', $className, $matches);
if (!$matches) {
return null;
}
}

return str_replace('\\', '/', $matches[1]);
Expand Down

0 comments on commit e0d7a34

Please sign in to comment.