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 3adadac commit 214ad5a
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/Annotator/ModelAnnotator.php
Original file line number Diff line number Diff line change
Expand Up @@ -409,10 +409,17 @@ protected function resolvePluginName(string $className, string $name): ?string {
return '';
}

preg_match('#^(.+)\\\\Model\\\\Behavior\\\\' . $name . 'Behavior$#', $className, $matches);
if (!$matches) {
return null;
}
if (strpos($name, '\\') !== false) {
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 214ad5a

Please sign in to comment.