~ubuntu-branches/ubuntu/utopic/php-codesniffer/utopic-proposed

« back to all changes in this revision

Viewing changes to PHP_CodeSniffer-1.5.0RC2/CodeSniffer/Standards/Squiz/Tests/WhiteSpace/ControlStructureSpacingUnitTest.inc

  • Committer: Package Import Robot
  • Author(s): David Prévot
  • Date: 2014-07-21 14:42:41 UTC
  • mfrom: (1.1.4)
  • Revision ID: package-import@ubuntu.com-20140721144241-g4orlcuk4jzn9mhs
Tags: 1.5.3-1
* Team upload
* Focus on stable release
* Update copyright
* Bump standards version to 3.9.5
* Update Homepage
* Use ${phppear:…} instead of hardcoding them
* Run tests in dh_auto_test
* Update patch with gbp pq
* Simplify configuration installation
* Edit package.xml to move script
* Add DEP-8 tests

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<?php
2
 
if ($something) {
3
 
}
4
 
foreach ($this as $that) {
5
 
}
6
 
while (true) {
7
 
    for ($i = 0; $i < 10; $i++) {
8
 
    }
9
 
    if ($something) {
10
 
    }
11
 
 
12
 
    foreach ($this as $that) {
13
 
        do {
14
 
        } while (true);
15
 
 
16
 
    }
17
 
}
18
 
 
19
 
if ($one) {
20
 
} else ($two) {
21
 
} else if ($three) {
22
 
} elseif ($four) {
23
 
}
24
 
if ($one) {
25
 
} else ($two) {
26
 
} else if ($three) {
27
 
} elseif ($four) {
28
 
}
29
 
?>
30
 
<table>
31
 
    <tr>
32
 
        <td align="center" valign="center">
33
 
        <?php
34
 
        foreach ($this->children as $child) {
35
 
            // There should be no error after this
36
 
            // foreach, because it is followed by a
37
 
            // close PHP tag.
38
 
        }
39
 
        ?>
40
 
        </td>
41
 
    </tr>
42
 
</table>
43
 
<?php
44
 
 
45
 
switch ($blah) {
46
 
    case 'one':
47
 
        if ($blah) {
48
 
            // There are no spaces before break.
49
 
        }
50
 
    break;
51
 
 
52
 
    default:
53
 
        if ($blah) {
54
 
            // There are no spaces before break.
55
 
        }
56
 
    break;
57
 
}
58
 
 
59
 
switch ($blah) {
60
 
    case 'one':
61
 
        if ($blah) {
62
 
            // There are no spaces before break.
63
 
        }
64
 
    break;
65
 
 
66
 
    default:
67
 
        if ($blah) {
68
 
            // Code here.
69
 
        }
70
 
}
71
 
 
72
 
foreach ($blah as $var) {
73
 
    if ($blah) {
74
 
    }
75
 
    break;
76
 
}
77
 
 
78
 
while (true) {
79
 
    for ($i = 0; $i < 10; $i++) {
80
 
 
81
 
        if ($something) {
82
 
        }
83
 
 
84
 
    }
85
 
 
86
 
    foreach ($this as $that) {
87
 
        do {
88
 
 
89
 
            echo $i;
90
 
        } while (true);
91
 
    }
92
 
}
93
 
 
94
 
function myFunction()
95
 
{
96
 
    if ($blah) {
97
 
    }
98
 
 
99
 
}//end myFunction()
100
 
 
101
 
foreach ($this->children as $child) {
102
 
    echo $child;
103
 
 
104
 
}
105
 
 
106
 
if ($defaultPageDesign === 0
107
 
    && $defaultCascade === TRUE
108
 
    && $defaultChildDesign === 0
109
 
) {
110
 
    $settingsUpdated = FALSE;
111
 
}
112
 
 
113
 
foreach ( $blah as $var ) {
114
 
    if (  $blah    ) {
115
 
    }
116
 
}
117
 
 
118
 
if (
119
 
    $defaultPageDesign === 0
120
 
    && $defaultCascade === TRUE
121
 
    && $defaultChildDesign === 0
122
 
) {
123
 
    $settingsUpdated = FALSE;
124
 
}
125
 
?>
 
 
b'\\ No newline at end of file'