Menu

[r327]: / trunk / test / _bad_naming_12.php  Maximize  Restore  History

Download this file

72 lines (50 with data), 1.4 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<?php
/**
* This file is an exemple of PHP file containing bad naming.
* This test file should generate 6 warnings with the default config.
*/
// 1 : constant naming :: PHPCHECKSTYLE_CONSTANT_NAMING
define(_badly_named_constant, "A_CONSTANT_VALUE");
// 2 : constant naming :: PHPCHECKSTYLE_CONSTANT_NAMING
const bad_CONST = "goo";
// 3 : top level var naming :: PHPCHECKSTYLE_TOPLEVEL_VARIABLE_NAMING
$X = 1;
//
/**
* 4 : class naming :: PHPCHECKSTYLE_CLASSNAME_NAMING
*
* @SuppressWarnings checkUnusedVariables
*/
class 9badlynamedclass {
//5 : member level var naming :: PHPCHECKSTYLE_MEMBER_VARIABLE_NAMING
$Y = 1;
/**
* 6 :constructor Naming :: Should be old style
*/
function __construct() {
}
/**
* 7 : function naming :: PHPCHECKSTYLE_FUNCNAME_NAMING
*/
function Badlynamedfunction() {
//8 : local level var naming :: PHPCHECKSTYLE_LOCAL_VARIABLE_NAMING
$Z = 1;
}
/**
* 9 : protected function naming :: PHPCHECKSTYLE_PROTECTED_FUNCNAME_NAMING
*/
protected function Badlynamedfunction2() {
badlynamedfunction3();
}
/**
* 10 : private function naming :: PHPCHECKSTYLE_PRIVATE_FUNCNAME_NAMING
*/
private function badlynamedfunction3() {
}
}
/**
* 11 : interface naming
*/
interface _badlynamedinterface {
}
// 12 File Naming
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.