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
Namespacing, or better class prefixing. #204
Comments
Another beautiful example of a class name that could cause conflicts is "ExpectedException". :) I'll try to rename all Exception class so they end in "WebDriverException" (like their base class does) and do a pull request, but using namespaces would of course be a better long-term solution. Sadly, I don't have that much time on my hands to refactor this whole project myself to use namespaces. |
Unfortunately, Facebook does not and will not use namespaces. This has come up several times in the past (search through the closed issues). |
Yes, I just saw #181 (because it was a pull request and not an issue I did not see it sooner). I forked the php-webdriver and renamed all Exception classes to end in WebDriverException. This should fix this particular conflict, and is better practice if Facebook doesn't want to use namespaces. See #205. (I did not find a way to do a PR in this issue itself.) Classes like "NullPointerException", "ExpectedException", "TimeOutException" etc. are just way too common to make it possible to use php-webdriver in other projects. |
+1, this is really really annoying. I am maintaining a namespaced fork of this as janoszen/webdriver if you are interested. |
Closing, please see #212. |
Me and the people I'm working with are using Phing to check our coding standards, run our tests, etc. We were looking into using this project in our tests to use Selenium for functional testing, but sadly both Phing and php-webdriver have a NullPointerException class in the global namespace which is causing the following error:
Luckily, Phing is getting namespacing in its 3.0 release, but it's still some time before that will be released. (https://www.phing.info/trac/roadmap)
Now, even though Phing is getting namespaces, I still feel like php-webdriver should use namespaces as well, or AT LEAST properly prefix all classes in the global namespace. Granted, most classes are already prefixed with "WebDriver", but there are still classes like "NullPointerException", "UnrecognizedExceptionException", "URLChecker", ... that are not prefixed.
A quick fix would be to prefix the non-prefixed classes, but proper namespacing would of course be preferred.
The text was updated successfully, but these errors were encountered: