c2ec1c97c9
A poor man's formatter since I didn't like any of the other ones I found. The original C++ source sometimes put newlines and sometimes not.
Codemods:
codemod '([;{}])([^\n])' '\1\n\2'
codemod -m '\s*<\?php\s+' '<?php\n\n'
codemod '\t' ' '
I hand-fixed all the failing tests
27 linhas
403 B
PHP
27 linhas
403 B
PHP
<?php
|
|
|
|
switch ($_POST) {
|
|
case array(): echo 'empty array';
|
|
break;
|
|
case $_GET: echo 'get';
|
|
break;
|
|
default: echo 'default';
|
|
}
|
|
switch ($GLOBALS) {
|
|
case array(): echo 'empty array';
|
|
break;
|
|
default: echo 'default';
|
|
}
|
|
function ret_true($x) {
|
|
return true;
|
|
}
|
|
switch ($GLOBALS) {
|
|
case ret_true($GLOBALS['foo'] = 10): echo '1';
|
|
break;
|
|
case array();
|
|
echo '2';
|
|
break;
|
|
default: echo '3';
|
|
}
|
|
var_dump($foo);
|