/
indentation.php
66 lines (61 loc) · 1.21 KB
/
indentation.php
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
<?php
if(foo)
{
$values = array( // indent only after arrays
"raw",
"foo", // single line comment
"bar", /* no trailing comma on next */
"fud"
);
if(foo): // colon-terminated
foo();
bar();
else:
bar(42);
if(foo) /* indent just next */
bar();
endif;
}
else
{
if(foo) {
foo();
bar();
} else {
if(foo) {
foo();
bar();
switch(foo):
case 31:
{
bar();
fud();
}
break;
case 42:
bar();
break;
endswitch;
}
else {
for($i = 0; $i < 42; $i++):
bar();
baz();
for($i = 0; $i < 42; $i++)
bar();
endfor;
}
}
}
array(
'1' => '1',
'#1' => 1,
// # in previous line shoud not make this line be indented
);
$form['#after_build'] = array('some_string');
// # in previous line shoud not make this line be indented
# No indent after comment lines
bar();
// No indent after comment lines
baz();
?>