sebastianbergmann/phpunit

Looks like the namespace is wrong for \PHPUnit\Runner\Hook directory

Closed this issue · 1 comments

Q A
PHPUnit version 9.1.1
PHP version 7.4.2
Installation Method Composer / PHAR

Summary

Looks like the namespace is wrong for \PHPUnit\Runner\Hook directory. The namespace should be \PHPUnit\Runner\Hook, not \PHPUnit\Runner according to PSR4.

From my existing code, it looks like the Hook interface should be in the \PHPUnit\Runner namespace. But to change it to \PHPUnit\Runner\Hook, which looks like that the directory structure indicates would make it a breaking change.

I also noticed that all the other classes in \PHPUnit\Runner\Hook should be in the Hook namespace as well.

Happy to submit a PR, but not sure which way to go. Could move Hook to \PHPUnit\Runner, then all the hook directory should have the Hook namespace added. Looks like this directory was added 2020-2-21, but not sure how uses it or what it might break.

Current behavior

How to reproduce

Expected behavior

All above, language issue, not behavior

PHPUnit uses classmap-based autoloading and does not follow any strict mapping between namespace and directory structure.