~ubuntu-branches/ubuntu/saucy/php-codesniffer/saucy

« back to all changes in this revision

Viewing changes to PHP_CodeSniffer-1.1.0/CodeSniffer/Standards/Squiz/Tests/PHP/NonExecutableCodeUnitTest.inc

  • Committer: Bazaar Package Importer
  • Author(s): Jack Bates
  • Date: 2008-10-01 17:39:43 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20081001173943-2dy06n1e8zwyw1o8
Tags: 1.1.0-1
* New upstream release
* Acknowledge NMU, thanks Jan

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?php
 
2
switch ($var) {
 
3
    case '1':
 
4
        return;
 
5
        echo 'hi';
 
6
    break;
 
7
    case '2':
 
8
    case '3':
 
9
        if ($something === true) {
 
10
            break;
 
11
            echo 'hi';
 
12
        }
 
13
    break;
 
14
    default:
 
15
        return;
 
16
 
 
17
        if ($something === true) {
 
18
            break;
 
19
            echo 'hi';
 
20
        }
 
21
    break;
 
22
}
 
23
 
 
24
function myFunction($var)
 
25
{
 
26
    if ($something === TRUE) {
 
27
        return;
 
28
        echo 'hi';
 
29
    }
 
30
 
 
31
    return;
 
32
    return FALSE;
 
33
    if ($something === TRUE) {
 
34
        return TRUE;
 
35
    }
 
36
 
 
37
}//end myFunction()
 
38
 
 
39
foreach ($vars as $var) {
 
40
    if ($something === TRUE) {
 
41
        continue;
 
42
        break;
 
43
    } else {
 
44
        continue;
 
45
        echo 'hi';
 
46
    }
 
47
 
 
48
    echo $var."\n";
 
49
}
 
50
 
 
51
switch ($lowerVarType) {
 
52
    case 'bool':
 
53
        return 'boolean';
 
54
        echo 'hi';
 
55
    case 'double':
 
56
    case 'real':
 
57
        return 'float';
 
58
        echo 'hi';
 
59
}
 
60
 
 
61
while ($line=fgets($fp,2*1024*1024))
 
62
{
 
63
    if (!preg_match("/^<([a-z0-9_]+)/",$line,$matches))
 
64
    continue;
 
65
    print $line;
 
66
}
 
67
 
 
68
exit();
 
69
 
 
70
// Errors are thrown from here down from the exit() above.
 
71
// No lines before should have duplicate errors.
 
72
foreach ($vars as $var) {
 
73
    if ($something === TRUE) {
 
74
        break;
 
75
        break;
 
76
    }
 
77
}
 
78
 
 
79
exit();
 
80
 
 
81
?>