From d8ff43c080d4f9d097f74b51f329f86ba83499f6 Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Sun, 4 Jul 2010 16:16:13 +0200 Subject: [PATCH] [task/coding-guidelines] Class member qualifier guidelines Use private, protected or public instead of var. Use static public instead of public static. Use class constants instead of define(). PHPBB3-9557 --- phpBB/docs/coding-guidelines.html | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/phpBB/docs/coding-guidelines.html b/phpBB/docs/coding-guidelines.html index e34e1d9929..f340b671cc 100644 --- a/phpBB/docs/coding-guidelines.html +++ b/phpBB/docs/coding-guidelines.html @@ -696,6 +696,26 @@ switch ($mode) } +

Class Members

+

Use the explicit visibility qualifiers public, private and protected for all properties instead of var. + +

Place the static qualifier before the visibility qualifiers.

+ +

//Wrong

+
+var $x;
+private static function f()
+	
+ +

// Right

+
+public $x;
+static private function f()
+	
+ +

Constants

+

Prefer class constants over global constants created with define().

+

2.iii. SQL/SQL Layout

Common SQL Guidelines: