update v 1.0.7.5
This commit is contained in:
@@ -27,7 +27,6 @@ function justForIndentation()
|
||||
Even more text. */
|
||||
$foo;
|
||||
}
|
||||
|
||||
-----
|
||||
function justForIndentation()
|
||||
{
|
||||
@@ -53,4 +52,16 @@ function justForIndentation()
|
||||
More text.
|
||||
Even more text. */
|
||||
$foo;
|
||||
}
|
||||
-----
|
||||
<?php
|
||||
|
||||
function test()
|
||||
{
|
||||
// empty
|
||||
}
|
||||
-----
|
||||
function test()
|
||||
{
|
||||
// empty
|
||||
}
|
13
vendor/nikic/php-parser/test/code/prettyPrinter/expr/constant_deref.test
vendored
Normal file
13
vendor/nikic/php-parser/test/code/prettyPrinter/expr/constant_deref.test
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
Constant/literal dereferencing
|
||||
-----
|
||||
<?php
|
||||
|
||||
FOO[0];
|
||||
FOO::BAR[0];
|
||||
'FOO'[0];
|
||||
array(FOO)[0];
|
||||
-----
|
||||
FOO[0];
|
||||
FOO::BAR[0];
|
||||
'FOO'[0];
|
||||
array(FOO)[0];
|
86
vendor/nikic/php-parser/test/code/prettyPrinter/expr/docStrings.test
vendored
Normal file
86
vendor/nikic/php-parser/test/code/prettyPrinter/expr/docStrings.test
vendored
Normal file
@@ -0,0 +1,86 @@
|
||||
Literals
|
||||
-----
|
||||
<?php
|
||||
|
||||
<<<'STR'
|
||||
STR;
|
||||
<<<STR
|
||||
STR;
|
||||
|
||||
<<<'STR'
|
||||
A
|
||||
B
|
||||
STR;
|
||||
<<<STR
|
||||
A
|
||||
B
|
||||
STR;
|
||||
|
||||
<<<'STR'
|
||||
a\nb$c
|
||||
STR;
|
||||
<<<STR
|
||||
a\\nb\$c
|
||||
STR;
|
||||
|
||||
<<<STR
|
||||
a$b
|
||||
{$c->d}
|
||||
STR;
|
||||
|
||||
call(
|
||||
<<<STR
|
||||
A
|
||||
STR
|
||||
, <<<STR
|
||||
B
|
||||
STR
|
||||
);
|
||||
|
||||
function test() {
|
||||
<<<STR
|
||||
Foo
|
||||
STR;
|
||||
<<<STR
|
||||
Bar
|
||||
STR;
|
||||
}
|
||||
-----
|
||||
<<<'STR'
|
||||
STR;
|
||||
<<<STR
|
||||
STR;
|
||||
<<<'STR'
|
||||
A
|
||||
B
|
||||
STR;
|
||||
<<<STR
|
||||
A
|
||||
B
|
||||
STR;
|
||||
<<<'STR'
|
||||
a\nb$c
|
||||
STR;
|
||||
<<<STR
|
||||
a\\nb\$c
|
||||
STR;
|
||||
<<<STR
|
||||
a{$b}
|
||||
{$c->d}
|
||||
STR;
|
||||
call(<<<STR
|
||||
A
|
||||
STR
|
||||
, <<<STR
|
||||
B
|
||||
STR
|
||||
);
|
||||
function test()
|
||||
{
|
||||
<<<STR
|
||||
Foo
|
||||
STR;
|
||||
<<<STR
|
||||
Bar
|
||||
STR;
|
||||
}
|
29
vendor/nikic/php-parser/test/code/prettyPrinter/expr/intrinsics.test
vendored
Normal file
29
vendor/nikic/php-parser/test/code/prettyPrinter/expr/intrinsics.test
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
isset, empty, unset, exit, die, clone, eval
|
||||
-----
|
||||
<?php
|
||||
|
||||
isset($a, $a[$b]);
|
||||
empty($a);
|
||||
empty('foo');
|
||||
unset($a, $a[$b]);
|
||||
exit;
|
||||
exit();
|
||||
exit(1);
|
||||
die;
|
||||
die();
|
||||
die('foo');
|
||||
clone $foo;
|
||||
eval('str');
|
||||
-----
|
||||
isset($a, $a[$b]);
|
||||
empty($a);
|
||||
empty('foo');
|
||||
unset($a, $a[$b]);
|
||||
exit;
|
||||
exit;
|
||||
exit(1);
|
||||
die;
|
||||
die;
|
||||
die('foo');
|
||||
clone $foo;
|
||||
eval('str');
|
@@ -40,21 +40,17 @@ FALSE;
|
||||
378282246310005.0;
|
||||
10000000000000002.0;
|
||||
|
||||
// strings (normalized to single quoted)
|
||||
// strings (single quoted)
|
||||
'a';
|
||||
'a
|
||||
b';
|
||||
"a";
|
||||
"a\nb";
|
||||
'a\'b';
|
||||
|
||||
// strings (double quoted)
|
||||
"a'b";
|
||||
"a\b";
|
||||
<<<'STR'
|
||||
a\nb$a
|
||||
{$b}
|
||||
STR;
|
||||
|
||||
// strings (normalized to double quoted)
|
||||
"$a";
|
||||
"a$b";
|
||||
"$a$b";
|
||||
@@ -68,9 +64,6 @@ STR;
|
||||
"\\{ $A }";
|
||||
"{$$A}[B]";
|
||||
"$$A[B]";
|
||||
<<<STR
|
||||
a\nb$a\n{$b}
|
||||
STR;
|
||||
|
||||
// make sure indentation doesn't mess anything up
|
||||
function foo()
|
||||
@@ -81,6 +74,12 @@ b';
|
||||
'a
|
||||
b';
|
||||
}
|
||||
|
||||
// shell exec (similar to double quoted string)
|
||||
`foo`;
|
||||
`foo$a`;
|
||||
`foo{$a}bar`;
|
||||
`\`\'\"`;
|
||||
-----
|
||||
// magic constants
|
||||
__LINE__;
|
||||
@@ -101,9 +100,9 @@ FALSE;
|
||||
// integers (normalized to decimal)
|
||||
0;
|
||||
11;
|
||||
9;
|
||||
17;
|
||||
3;
|
||||
011;
|
||||
0x11;
|
||||
0b11;
|
||||
// floats (normalized to ... something)
|
||||
0.0;
|
||||
0.0;
|
||||
@@ -116,19 +115,16 @@ INF;
|
||||
1.0E+84;
|
||||
378282246310005.0;
|
||||
10000000000000002.0;
|
||||
// strings (normalized to single quoted)
|
||||
'a';
|
||||
'a
|
||||
b';
|
||||
// strings (single quoted)
|
||||
'a';
|
||||
'a
|
||||
b';
|
||||
"a";
|
||||
"a\nb";
|
||||
'a\'b';
|
||||
'a\'b';
|
||||
'a\\b';
|
||||
'a\\nb$a
|
||||
{$b}';
|
||||
// strings (normalized to double quoted)
|
||||
// strings (double quoted)
|
||||
"a'b";
|
||||
"a\\b";
|
||||
"{$a}";
|
||||
"a{$b}";
|
||||
"{$a}{$b}";
|
||||
@@ -142,14 +138,17 @@ b';
|
||||
"\\{ {$A} }";
|
||||
"{${$A}}[B]";
|
||||
"\${$A['B']}";
|
||||
"a\nb{$a}\n{$b}";
|
||||
// make sure indentation doesn't mess anything up
|
||||
function foo()
|
||||
{
|
||||
'a
|
||||
b';
|
||||
"a\nb";
|
||||
'a
|
||||
b';
|
||||
'a
|
||||
b';
|
||||
}
|
||||
// shell exec (similar to double quoted string)
|
||||
`foo`;
|
||||
`foo{$a}`;
|
||||
`foo{$a}bar`;
|
||||
`\`\\'\\"`;
|
11
vendor/nikic/php-parser/test/code/prettyPrinter/expr/shortArraySyntax.test
vendored
Normal file
11
vendor/nikic/php-parser/test/code/prettyPrinter/expr/shortArraySyntax.test
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
Short array syntax
|
||||
-----
|
||||
<?php
|
||||
|
||||
[];
|
||||
array(1, 2, 3);
|
||||
['a' => 'b', 'c' => 'd'];
|
||||
-----
|
||||
[];
|
||||
array(1, 2, 3);
|
||||
['a' => 'b', 'c' => 'd'];
|
23
vendor/nikic/php-parser/test/code/prettyPrinter/expr/uvs.test
vendored
Normal file
23
vendor/nikic/php-parser/test/code/prettyPrinter/expr/uvs.test
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
Uniform variable syntax
|
||||
-----
|
||||
<?php
|
||||
|
||||
(function() {})();
|
||||
array('a', 'b')()();
|
||||
A::$b::$c;
|
||||
$A::$b[$c]();
|
||||
$A::{$b[$c]}();
|
||||
A::$$b[$c]();
|
||||
($a->b)();
|
||||
(A::$b)();
|
||||
-----
|
||||
!!php7
|
||||
(function () {
|
||||
})();
|
||||
array('a', 'b')()();
|
||||
A::$b::$c;
|
||||
$A::$b[$c]();
|
||||
$A::{$b[$c]}();
|
||||
A::${$b}[$c]();
|
||||
($a->b)();
|
||||
(A::$b)();
|
@@ -24,6 +24,7 @@ $a::$b[$c];
|
||||
$a::$b[$c]($d);
|
||||
$a::{$b[$c]}($d);
|
||||
$a::{$b->c}();
|
||||
A::$$b[$c]();
|
||||
a();
|
||||
$a();
|
||||
$a()[$b];
|
||||
@@ -36,6 +37,7 @@ $a::$b()[$c];
|
||||
|
||||
global $a, $$a, $$a[$b], $$a->b;
|
||||
-----
|
||||
!!php5
|
||||
$a;
|
||||
${$a};
|
||||
${$a};
|
||||
@@ -55,9 +57,10 @@ $a::b();
|
||||
$a::b($c);
|
||||
$a::$b();
|
||||
$a::$b[$c];
|
||||
$a::$b[$c]($d);
|
||||
$a::$b[$c]($d);
|
||||
$a::{$b[$c]}($d);
|
||||
$a::{$b[$c]}($d);
|
||||
$a::{$b->c}();
|
||||
A::${$b[$c]}();
|
||||
a();
|
||||
$a();
|
||||
$a()[$b];
|
46
vendor/nikic/php-parser/test/code/prettyPrinter/expr/yield.test
vendored
Normal file
46
vendor/nikic/php-parser/test/code/prettyPrinter/expr/yield.test
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
Yield
|
||||
-----
|
||||
<?php
|
||||
|
||||
function gen()
|
||||
{
|
||||
yield;
|
||||
yield $a;
|
||||
yield $a => $b;
|
||||
$a = yield;
|
||||
$a = (yield $b);
|
||||
$a = (yield $b => $c);
|
||||
}
|
||||
// TODO Get rid of parens for cases 2 and 3
|
||||
-----
|
||||
function gen()
|
||||
{
|
||||
yield;
|
||||
(yield $a);
|
||||
(yield $a => $b);
|
||||
$a = yield;
|
||||
$a = (yield $b);
|
||||
$a = (yield $b => $c);
|
||||
}
|
||||
// TODO Get rid of parens for cases 2 and 3
|
||||
-----
|
||||
<?php
|
||||
|
||||
function gen()
|
||||
{
|
||||
$a = yield $b;
|
||||
$a = yield $b => $c;
|
||||
yield from $a;
|
||||
$a = yield from $b;
|
||||
}
|
||||
// TODO Get rid of parens for last case
|
||||
-----
|
||||
!!php7
|
||||
function gen()
|
||||
{
|
||||
$a = (yield $b);
|
||||
$a = (yield $b => $c);
|
||||
yield from $a;
|
||||
$a = (yield from $b);
|
||||
}
|
||||
// TODO Get rid of parens for last case
|
@@ -8,4 +8,9 @@ echo 'Bar Foo';
|
||||
<?php
|
||||
|
||||
echo 'Foo Bar';
|
||||
echo 'Bar Foo';
|
||||
echo 'Bar Foo';
|
||||
-----
|
||||
<?php
|
||||
|
||||
-----
|
||||
<?php
|
||||
|
13
vendor/nikic/php-parser/test/code/prettyPrinter/stmt/break_continue.test
vendored
Normal file
13
vendor/nikic/php-parser/test/code/prettyPrinter/stmt/break_continue.test
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
break/continue
|
||||
-----
|
||||
<?php
|
||||
|
||||
continue;
|
||||
continue 2;
|
||||
break;
|
||||
break 2;
|
||||
-----
|
||||
continue;
|
||||
continue 2;
|
||||
break;
|
||||
break 2;
|
@@ -2,7 +2,7 @@ Class
|
||||
-----
|
||||
<?php
|
||||
|
||||
class Foo
|
||||
class Foo extends Bar implements ABC, \DEF, namespace\GHI
|
||||
{
|
||||
var $a = 'foo';
|
||||
private $b = 'bar';
|
||||
@@ -17,8 +17,15 @@ class Foo
|
||||
public function foo() {}
|
||||
abstract static function bar() {}
|
||||
}
|
||||
|
||||
trait Bar
|
||||
{
|
||||
function test()
|
||||
{
|
||||
}
|
||||
}
|
||||
-----
|
||||
class Foo
|
||||
class Foo extends Bar implements ABC, \DEF, namespace\GHI
|
||||
{
|
||||
var $a = 'foo';
|
||||
private $b = 'bar';
|
||||
@@ -37,4 +44,10 @@ class Foo
|
||||
static abstract function bar()
|
||||
{
|
||||
}
|
||||
}
|
||||
trait Bar
|
||||
{
|
||||
function test()
|
||||
{
|
||||
}
|
||||
}
|
11
vendor/nikic/php-parser/test/code/prettyPrinter/stmt/const.test
vendored
Normal file
11
vendor/nikic/php-parser/test/code/prettyPrinter/stmt/const.test
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
Constant declarations
|
||||
-----
|
||||
<?php
|
||||
|
||||
const FOO = 'BAR';
|
||||
const FOO = 1 + 1;
|
||||
const FOO = BAR, BAR = FOO;
|
||||
-----
|
||||
const FOO = 'BAR';
|
||||
const FOO = 1 + 1;
|
||||
const FOO = BAR, BAR = FOO;
|
17
vendor/nikic/php-parser/test/code/prettyPrinter/stmt/declare.test
vendored
Normal file
17
vendor/nikic/php-parser/test/code/prettyPrinter/stmt/declare.test
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
declare
|
||||
-----
|
||||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
declare (ticks=1) {
|
||||
foo();
|
||||
}
|
||||
declare (ticks=2) {
|
||||
}
|
||||
-----
|
||||
declare (strict_types=1);
|
||||
declare (ticks=1) {
|
||||
foo();
|
||||
}
|
||||
declare (ticks=2) {
|
||||
}
|
10
vendor/nikic/php-parser/test/code/prettyPrinter/stmt/do_while.test
vendored
Normal file
10
vendor/nikic/php-parser/test/code/prettyPrinter/stmt/do_while.test
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
doWhile
|
||||
-----
|
||||
<?php
|
||||
|
||||
do {
|
||||
|
||||
} while (true);
|
||||
-----
|
||||
do {
|
||||
} while (true);
|
28
vendor/nikic/php-parser/test/code/prettyPrinter/stmt/for.test
vendored
Normal file
28
vendor/nikic/php-parser/test/code/prettyPrinter/stmt/for.test
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
for
|
||||
-----
|
||||
<?php
|
||||
|
||||
for ($i = 0; $i < 10; $i++) {
|
||||
|
||||
}
|
||||
|
||||
for ($i = 0,$j = 0; $i < 10; $i++) {
|
||||
|
||||
}
|
||||
|
||||
for ($i = 0; $i < 10;) {
|
||||
|
||||
}
|
||||
|
||||
for (;;) {
|
||||
|
||||
}
|
||||
-----
|
||||
for ($i = 0; $i < 10; $i++) {
|
||||
}
|
||||
for ($i = 0, $j = 0; $i < 10; $i++) {
|
||||
}
|
||||
for ($i = 0; $i < 10;) {
|
||||
}
|
||||
for (;;) {
|
||||
}
|
28
vendor/nikic/php-parser/test/code/prettyPrinter/stmt/foreach.test
vendored
Normal file
28
vendor/nikic/php-parser/test/code/prettyPrinter/stmt/foreach.test
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
foreach
|
||||
-----
|
||||
<?php
|
||||
|
||||
foreach ($arr as $val) {
|
||||
|
||||
}
|
||||
|
||||
foreach ($arr as &$val) {
|
||||
|
||||
}
|
||||
|
||||
foreach ($arr as $key => $val) {
|
||||
|
||||
}
|
||||
|
||||
foreach ($arr as $key => &$val) {
|
||||
|
||||
}
|
||||
-----
|
||||
foreach ($arr as $val) {
|
||||
}
|
||||
foreach ($arr as &$val) {
|
||||
}
|
||||
foreach ($arr as $key => $val) {
|
||||
}
|
||||
foreach ($arr as $key => &$val) {
|
||||
}
|
11
vendor/nikic/php-parser/test/code/prettyPrinter/stmt/global_static_variables.test
vendored
Normal file
11
vendor/nikic/php-parser/test/code/prettyPrinter/stmt/global_static_variables.test
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
Global and static variables
|
||||
-----
|
||||
<?php
|
||||
|
||||
global $a, $$a, ${$a[$a]};
|
||||
static $a, $b;
|
||||
static $a = 'foo', $b = 'bar';
|
||||
-----
|
||||
global $a, ${$a}, ${$a[$a]};
|
||||
static $a, $b;
|
||||
static $a = 'foo', $b = 'bar';
|
9
vendor/nikic/php-parser/test/code/prettyPrinter/stmt/goto.test
vendored
Normal file
9
vendor/nikic/php-parser/test/code/prettyPrinter/stmt/goto.test
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
goto
|
||||
-----
|
||||
<?php
|
||||
|
||||
marker:
|
||||
goto marker;
|
||||
-----
|
||||
marker:
|
||||
goto marker;
|
16
vendor/nikic/php-parser/test/code/prettyPrinter/stmt/groupUse.test
vendored
Normal file
16
vendor/nikic/php-parser/test/code/prettyPrinter/stmt/groupUse.test
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
Group use declaration
|
||||
-----
|
||||
<?php
|
||||
use A\{B};
|
||||
use A\{B\C, D};
|
||||
use A\B\{C\D, E};
|
||||
use function A\{b\c, d};
|
||||
use const A\{B\C, D};
|
||||
use A\B\{C\D, function b\c, const D};
|
||||
-----
|
||||
use A\{B};
|
||||
use A\{B\C, D};
|
||||
use A\B\{C\D, E};
|
||||
use function A\{b\c, d};
|
||||
use const A\{B\C, D};
|
||||
use A\B\{C\D, function b\c, const D};
|
27
vendor/nikic/php-parser/test/code/prettyPrinter/stmt/haltCompiler.file-test
vendored
Normal file
27
vendor/nikic/php-parser/test/code/prettyPrinter/stmt/haltCompiler.file-test
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
__halt_compiler
|
||||
-----
|
||||
<?php
|
||||
|
||||
echo 'foo';
|
||||
__halt_compiler();
|
||||
!!!
|
||||
???
|
||||
-----
|
||||
<?php
|
||||
|
||||
echo 'foo';
|
||||
__halt_compiler();
|
||||
!!!
|
||||
???
|
||||
-----
|
||||
<?php
|
||||
|
||||
echo 'foo';
|
||||
__halt_compiler();
|
||||
<?php
|
||||
-----
|
||||
<?php
|
||||
|
||||
echo 'foo';
|
||||
__halt_compiler();
|
||||
<?php
|
16
vendor/nikic/php-parser/test/code/prettyPrinter/stmt/if.test
vendored
Normal file
16
vendor/nikic/php-parser/test/code/prettyPrinter/stmt/if.test
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
if/elseif/else
|
||||
-----
|
||||
<?php
|
||||
|
||||
if ($expr) {
|
||||
|
||||
} elseif ($expr2) {
|
||||
|
||||
} else {
|
||||
|
||||
}
|
||||
-----
|
||||
if ($expr) {
|
||||
} elseif ($expr2) {
|
||||
} else {
|
||||
}
|
7
vendor/nikic/php-parser/test/code/prettyPrinter/stmt/throw.test
vendored
Normal file
7
vendor/nikic/php-parser/test/code/prettyPrinter/stmt/throw.test
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
throw
|
||||
-----
|
||||
<?php
|
||||
|
||||
throw $e;
|
||||
-----
|
||||
throw $e;
|
24
vendor/nikic/php-parser/test/code/prettyPrinter/stmt/tryCatch.test
vendored
Normal file
24
vendor/nikic/php-parser/test/code/prettyPrinter/stmt/tryCatch.test
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
tryCatch
|
||||
-----
|
||||
<?php
|
||||
|
||||
try {
|
||||
|
||||
} catch (Exception $e) {
|
||||
|
||||
}
|
||||
|
||||
try {
|
||||
} catch (Exception $e) {
|
||||
|
||||
} finally {
|
||||
|
||||
}
|
||||
-----
|
||||
try {
|
||||
} catch (Exception $e) {
|
||||
}
|
||||
try {
|
||||
} catch (Exception $e) {
|
||||
} finally {
|
||||
}
|
10
vendor/nikic/php-parser/test/code/prettyPrinter/stmt/while.test
vendored
Normal file
10
vendor/nikic/php-parser/test/code/prettyPrinter/stmt/while.test
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
while
|
||||
-----
|
||||
<?php
|
||||
|
||||
while (true) {
|
||||
|
||||
}
|
||||
-----
|
||||
while (true) {
|
||||
}
|
Reference in New Issue
Block a user