Skip to content

Conversation

@zimathias
Copy link

Add namespace to ease integration as a vendor library in 3rd party projects (eg Mink - https://github.com/behat/mink).

mathiaz and others added 5 commits September 21, 2011 11:37
so that the library can be used with Mink (ie php 5.3 with namespace).
Conflicts:
	WebDriverBase.php

    Use upstream code.
@jubishop
Copy link
Contributor

jubishop commented Oct 4, 2011

why do you have to do the \Exception thing? is that just part of the syntax when in a namespace? i'm unfamiliar.

@zimathias
Copy link
Author

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.

@jubishop
Copy link
Contributor

jubishop commented Nov 1, 2011

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?

@robocoder
Copy link

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?

@jubishop
Copy link
Contributor

jubishop commented Nov 7, 2011

so WebDriverElement would become WebDriver_Element, etc?

@robocoder
Copy link

@jubishop
Copy link
Contributor

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.

@robocoder
Copy link

You could maintain it as a branch, I suppose.

@jubishop
Copy link
Contributor

yeah i could have a PEAR branch or what not. good idea.

@jubishop
Copy link
Contributor

jubishop commented Dec 5, 2011

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.

@jubishop jubishop closed this Dec 5, 2011
@zimathias
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants