aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/docs/coding-guidelines.html
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2014-03-18 09:26:59 +0100
committerJoas Schilling <nickvergessen@gmx.de>2014-03-18 09:26:59 +0100
commitd275a7cf637cfd4a909985f3a9cfd6aa3591d9c1 (patch)
treef04a297747b1ef76b83f3b4c6f483a2d9f672614 /phpBB/docs/coding-guidelines.html
parent30eccacb1dc0203a15638596967255e33ec05801 (diff)
downloadforums-d275a7cf637cfd4a909985f3a9cfd6aa3591d9c1.tar
forums-d275a7cf637cfd4a909985f3a9cfd6aa3591d9c1.tar.gz
forums-d275a7cf637cfd4a909985f3a9cfd6aa3591d9c1.tar.bz2
forums-d275a7cf637cfd4a909985f3a9cfd6aa3591d9c1.tar.xz
forums-d275a7cf637cfd4a909985f3a9cfd6aa3591d9c1.zip
[ticket/12286] Function names should be prefixed with phpbb_
PHPBB3-12286
Diffstat (limited to 'phpBB/docs/coding-guidelines.html')
-rw-r--r--phpBB/docs/coding-guidelines.html4
1 files changed, 2 insertions, 2 deletions
diff --git a/phpBB/docs/coding-guidelines.html b/phpBB/docs/coding-guidelines.html
index ded13d1c28..ceac388269 100644
--- a/phpBB/docs/coding-guidelines.html
+++ b/phpBB/docs/coding-guidelines.html
@@ -322,7 +322,7 @@ for ($i = 0; $i &lt; $outer_size; $i++)
</pre></div>
<h4>Function Names:</h4>
- <p>Functions should also be named descriptively. We're not programming in C here, we don't want to write functions called things like "stristr()". Again, all lower-case names with words separated by a single underscore character in PHP, and camel caps in JavaScript. Function names should preferably have a verb in them somewhere. Good function names are <code>print_login_status()</code>, <code>get_user_data()</code>, etc. Constructor functions in JavaScript should begin with a capital letter.</p>
+ <p>Functions should also be named descriptively. We're not programming in C here, we don't want to write functions called things like "stristr()". Again, all lower-case names with words separated by a single underscore character in PHP, and camel caps in JavaScript. Function names should be prefixed with "phpbb_" and preferably have a verb in them somewhere. Good function names are <code>phpbb_print_login_status()</code>, <code>phpbb_get_user_data()</code>, etc. Constructor functions in JavaScript should begin with a capital letter.</p>
<h4>Function Arguments:</h4>
<p>Arguments are subject to the same guidelines as variable names. We don't want a bunch of functions like: <code>do_stuff($a, $b, $c)</code>. In most cases, we'd like to be able to tell how to use a function by just looking at its declaration. </p>
@@ -358,7 +358,7 @@ phpbb_dir_subdir_class_name - includes/dir/subdir/class_name.php
<h4>Summary:</h4>
- <p>The basic philosophy here is to not hurt code clarity for the sake of laziness. This has to be balanced by a little bit of common sense, though; <code>print_login_status_for_a_given_user()</code> goes too far, for example -- that function would be better named <code>print_user_login_status()</code>, or just <code>print_login_status()</code>.</p>
+ <p>The basic philosophy here is to not hurt code clarity for the sake of laziness. This has to be balanced by a little bit of common sense, though; <code>phpbb_print_login_status_for_a_given_user()</code> goes too far, for example -- that function would be better named <code>phpbb_print_user_login_status()</code>, or just <code>phpbb_print_login_status()</code>.</p>
<h4>Special Namings: </h4>
<p>For all emoticons use the term <code>smiley</code> in singular and <code>smilies</code> in plural. For emails we use the term <code>email</code> (without dash between “e” and “m”).</p>