Menu

[r309]: / trunk / test / bad_spaces_9.php  Maximize  Restore  History

Download this file

32 lines (23 with data), 669 Bytes

 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
<?php
/**
* This file is an exemple of PHP file containing bad spacing.
* This file should generate 9 warnings with the default config.
*/
class Space {
/**
* Test spacing
*
* @param String $a
* @param String $b
* @return String
*/
function testSpaces($a,$b){ // 1 - noSpaceAfterFunctionName, 2 - checkWhiteSpaceAfter (space after ,)
if($a == null) {// 3 - spaceAfterControlStmt (if statement)
return $b;
}
$c=$b+$a; // 4-7 - checkWhiteSpaceBefore & checkWhiteSpaceAfter (tokens + and =)
$c = [$b , $a]; // 8 - noSpaceBeforeToken
$c = ! $a; // 9 - noSpaceAfterToken
return $c;
}
}
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.