php - Namespace entries in PSR-1 standard? -


i looking correct way (if either correct please let me know) write namespaces in php classes follow psr-1 standard. looked around didn't see specific. correct way use

namespace foo\bar; 

or correct use curly braces such as

namespace foo\bar {     // .... } 

if both correct, there particular reason use 1 on other? realize portion might opinion based though.

the bracketed namespace recommended method defining multiple namespaces in single file.

if have 1 namespace in file use non-bracketed version.

psr-1 recommends 1 class per file, should limit 1 namespace per file, too.


Comments

Popular posts from this blog

shopping cart - Page redirect not working PHP -

php - How to modify a menu to show sub-menus -

python - Installing PyDev in eclipse is failed -