1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-10-25 01:58:49 +02:00
phorge-arcanist/src/lint/linter/__tests__/xhpast/parens-hug-contents.lint-test

68 lines
968 B
Text
Raw Normal View History

2011-01-10 00:22:25 +01:00
<?php
if ( $x ) { }
f( );
q( );
g();
if ($x) { }
else if ( $y ) { }
2011-01-10 00:22:25 +01:00
$obj->m(
$x,
$y,
$z);
for ( $ii = 0; $ii < 1; $ii++ ) { }
foreach ( $x as $y ) { }
function q( $x ) { }
final class X {
2011-01-10 00:22:25 +01:00
public function f( $y ) {
}
}
foreach ( $z as $k => $v ) {
}
some_call( /* respect authorial intent */ $b,
$a // if comments are present
);
~~~~~~~~~~
warning:2:5
warning:2:8
warning:3:3
warning:4:3
warning:7:10
warning:7:13
warning:13:6
warning:13:30
warning:14:10
warning:14:19
warning:15:12
warning:15:15
error:16:13 XHP19 Class-Filename Mismatch
2011-01-10 00:22:25 +01:00
warning:17:21
warning:17:24
warning:20:10
warning:20:25
~~~~~~~~~~
<?php
if ($x) { }
f();
q();
g();
if ($x) { }
else if ($y) { }
2011-01-10 00:22:25 +01:00
$obj->m(
$x,
$y,
$z);
for ($ii = 0; $ii < 1; $ii++) { }
foreach ($x as $y) { }
function q($x) { }
final class X {
2011-01-10 00:22:25 +01:00
public function f($y) {
}
}
foreach ($z as $k => $v) {
}
some_call( /* respect authorial intent */ $b,
$a // if comments are present
);