~ubuntu-branches/ubuntu/wily/php-codesniffer/wily

« back to all changes in this revision

Viewing changes to PHP_CodeSniffer-2.3.3/CodeSniffer/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.inc.fixed

  • Committer: Package Import Robot
  • Author(s): David Prévot, Greg Sherwood
  • Date: 2015-06-24 13:41:36 UTC
  • mfrom: (1.1.9)
  • Revision ID: package-import@ubuntu.com-20150624134136-dv60dnl6s20tdxwr
Tags: 2.3.3-1
[ Greg Sherwood ]
Prepare for 2.3.3 release

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?php
 
2
 
 
3
$result = 1 + 2;
 
4
$result = 1 + 2;
 
5
$result = 1 + 2;
 
6
$result = 1 + 2;
 
7
$result = 1 + 2;
 
8
$result = 1 + 2;
 
9
 
 
10
$result = 1 - 2;
 
11
$result = 1 - 2;
 
12
$result = 1 - 2;
 
13
$result = 1 - 2;
 
14
$result = 1 - 2;
 
15
$result = 1 - 2;
 
16
 
 
17
$result = 1 * 2;
 
18
$result = 1 * 2;
 
19
$result = 1 * 2;
 
20
$result = 1 * 2;
 
21
$result = 1 * 2;
 
22
$result = 1 * 2;
 
23
 
 
24
$result = 1 / 2;
 
25
$result = 1 / 2;
 
26
$result = 1 / 2;
 
27
$result = 1 / 2;
 
28
$result = 1 / 2;
 
29
$result = 1 / 2;
 
30
 
 
31
$result = 1 % 2;
 
32
$result = 1 % 2;
 
33
$result = 1 % 2;
 
34
$result = 1 % 2;
 
35
$result = 1 % 2;
 
36
$result = 1 % 2;
 
37
$result = '100%';
 
38
 
 
39
$result += 4;
 
40
$result += 4;
 
41
$result -= 4;
 
42
$result -= 4;
 
43
$result /= 4;
 
44
$result /= 4;
 
45
$result *= 4;
 
46
$result *= 4;
 
47
 
 
48
$result =& $thing;
 
49
if ($result & 4) {
 
50
    if ($result | 4) {
 
51
    }
 
52
}
 
53
if ($result & 4 && $result & 4) {
 
54
    if ($result | 4 || $result | 4) {
 
55
    }
 
56
}
 
57
 
 
58
$result = ((1 + 2) - (3 * 4 / 5) % 6);
 
59
$result = ((1 + 2) - (3 * 4 / 5) % 6);
 
60
return -1;
 
61
$file = '...'.substr($file, (($padding * -1) + 3));
 
62
 
 
63
$totalErrors   += $errors['errors'];
 
64
$totalWarnings += $errors['warnings'];
 
65
 
 
66
if (substr($line, 0, 3) === '/**') {
 
67
    $line = substr($line, 3);
 
68
} else if (substr($line, -2, 2) === '*/') {
 
69
    $line = substr(-2, 0, -2);
 
70
} else if ($line{0} === '*') {
 
71
    $line = substr($line, 1);
 
72
}
 
73
 
 
74
if ($pos === -1) {
 
75
}
 
76
 
 
77
for ($i = 0; $i <= 5; $i++) {
 
78
    $j ^= $i;
 
79
    $k %= $i;
 
80
    $l &= $i;
 
81
    $m .= 'Hello ';
 
82
}
 
83
 
 
84
$z = ($a + $b - $c * $d / $e % $f ^ $g);
 
85
$z = ($a + $b - $c * $d / $e % $f ^ $g);
 
86
 
 
87
$a == $b && $c != $d && $e === $f && $g !== $h;
 
88
$i > $j && $k < $l && $m >= $n && $o <= $p && $q <> $r;
 
89
 
 
90
$a == $b && $c != $d && $e === $f && $g !== $h;
 
91
$i > $j && $k < $l && $m >= $n && $o <= $p && $q <> $r;
 
92
 
 
93
function myFunction($variable=0, $var2='string') {}
 
94
 
 
95
if (index > -1) {
 
96
}
 
97
 
 
98
array_walk_recursive($array, function(&$item) use (&$something) {
 
99
});
 
100
 
 
101
$var = saveFile(&$model, &$foo);
 
102
 
 
103
// This is all valid.
 
104
$boo = -$foo;
 
105
function foo($boo = -1) {}
 
106
$foo = array('boo' => -1);
 
107
$x = $test ? -1 : 1;
 
108
$y = $test ? 1 : -1;
 
109
$z = $test ?: false;
 
110
 
 
111
$closureWithDefaultParameter = function (array $testArray=array()) {};
 
112
 
 
113
switch ($foo) {
 
114
        case -1:
 
115
                break;
 
116
}
 
117
 
 
118
$y = 1 * -1;
 
119
$y = -1 * 1;
 
120
$y = -1 * $var;
 
121
$y = 10 / -2;
 
122
$y = -10 / 2;
 
123
$y = (-10 / 2);
 
124
$y = (-10 / $var);
 
125
$y = 10 + -2;
 
126
$y = -10 + 2;
 
127
 
 
128
$a = $x ? $y : $z;
 
129
$a = $x ? $y : $z;
 
130
 
 
131
$y = 1 + 2 - 3;
 
132
 
 
133
$y = 1 + 2 - 3;
 
134
 
 
135
$y = 1 + 2 - 3;
 
136
 
 
137
// @codingStandardsChangeSetting Squiz.WhiteSpace.OperatorSpacing ignoreNewlines true
 
138
$y = 1
 
139
   + 2
 
140
   - 3;
 
141
 
 
142
$y = 1 +
 
143
     2 -
 
144
     3;
 
145
 
 
146
$y = 1
 
147
+ 2
 
148
- 3;
 
149
// @codingStandardsChangeSetting Squiz.WhiteSpace.OperatorSpacing ignoreNewlines false
 
150
 
 
151
if (true || -1 == $b) {
 
152
}
 
153
 
 
154
$var = array(-1);
 
155
$var = [-1];
 
156
$var = [0, -1, -2];