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

Ignore . namespace in generators #6070

Merged
merged 1 commit into from Jan 8, 2021
Merged
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
12 changes: 3 additions & 9 deletions src/Codeception/Util/Shared/Namespaces.php
Expand Up @@ -5,15 +5,9 @@ trait Namespaces
{
protected function breakParts($class)
{
$class = str_replace('/', '\\', $class);
$namespaces = explode('\\', $class);
if (count($namespaces)) {
$namespaces[0] = ltrim($namespaces[0], '\\');
}
if (!$namespaces[0]) {
array_shift($namespaces);
} // remove empty namespace caused of \\
return $namespaces;
// removing leading slashes and dots first
$class = str_replace('/', '\\', ltrim($class, './\\'));
return explode('\\', $class);
}

protected function getShortClassName($class)
Expand Down