-
Notifications
You must be signed in to change notification settings - Fork 849
Add namespace #3
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
Conversation
so that the library can be used with Mink (ie php 5.3 with namespace).
Conflicts:
WebDriverBase.php
Use upstream code.
|
why do you have to do the \Exception thing? is that just part of the syntax when in a namespace? i'm unfamiliar. |
|
Yes - it's part of the namespace syntax. The scope of the whole file is set by the namespace call at the beginning of the file. Since Exception is not defined in the WebDriver namespace, _throw Exception(...)_ fails. Instead they need to be fully qualified _throw \Exception(...)_. See http://us3.php.net/manual/en/language.namespaces.rules.php for more information. |
|
hey man. this is tough because we don't use namespaces anywhere in our php code at facebook. are a lot of open sourcers going to be reticent to adopt this if it's not in it's own namespace? |
|
If you decide against namespacing, could you at least switch to WebDriver_ as the prefix for class names, so it follows the PEAR/ZF naming convention? |
|
so WebDriverElement would become WebDriver_Element, etc? |
|
so another naming convention at FB is we don't put _'s in our class names. heh. i'm not sure how to best resolve this. trying my best to not fork our internal fb version from this open source one. |
|
You could maintain it as a branch, I suppose. |
|
yeah i could have a PEAR branch or what not. good idea. |
|
still haven't actually seen any docs about this supposed PEAR/ZF naming convention? is that officially defined somewhere? gonna close this for now. please reopen if you have that doc and i can try to set up a branch with those changes so that we match what PEAR wants. |
|
Here is a link to the Zend coding style where the naming convention for classes is outlined: http://framework.zend.com/manual/en/coding-standard.naming-conventions.html |
Add namespace to ease integration as a vendor library in 3rd party projects (eg Mink - https://github.com/behat/mink).