diff --git a/src/Annotator/ModelAnnotator.php b/src/Annotator/ModelAnnotator.php index 1da92eee..3908521d 100644 --- a/src/Annotator/ModelAnnotator.php +++ b/src/Annotator/ModelAnnotator.php @@ -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]);