/
OperatorSpacingUnitTest.inc
77 lines (58 loc) · 1.31 KB
/
OperatorSpacingUnitTest.inc
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
67
68
69
70
71
72
73
74
75
76
77
<?php
if ($a ===$b) {
$foo = $bar ??$a?? $b;
} elseif ($a> $b) {
$variable =$foo ? 'foo' :'bar';
$variable.='text'.'text';
}
$foo+= $a&$b;
$foo = $a|$b;
$foo =$a^$b;
$foo = ~$a;
$foo *=$a<<$b;
$foo = $a>>$b;
function foo(&$a,& $b) {}
$foo = $a and$b;
$foo = $a or $b;
$foo = $a xor$b;
$foo = !$a;
$foo = $a&&$b;
$foo = $a||$b;
$foo = $a instanceof Foo;
$foo = $a instanceof$b;
$foo .= 'hi'
.= 'there';
$foo .= 'hi'
.= 'there';
$foo .= 'hi' // comment
.= 'there';
$foo/*comment*/=/*comment*/$a/*comment*/and/*comment*/$b;
$foo .=//comment
'string' .=/*comment*/
'string';
$foo = $foo ?: 'bar';
$foo = $foo?:'bar';
try {
} catch (ExceptionType1|ExceptionType2 $e) {
}
if (strpos($tokenContent, 'b"') === 0 && substr($tokenContent, -1) === '"') {}
$oldConstructorPos = +1;
return -$content;
function name($a = -1) {}
$a =& $ref;
$a = [ 'a' => &$something ];
$fn = fn(array &$one) => 1;
$fn = fn(array & $one) => 1;
$fn = static fn(DateTime $a, DateTime $b): int => -($a->getTimestamp() <=> $b->getTimestamp());
function issue3267(string|int ...$values) {}
function setDefault(#[ImportValue(
constraints: [
[
Assert\Type::class,
['type' => 'bool'],
],
]
)] ?bool $value = null): void
{
// Do something
}