ALPHA 3.0.2a

This commit is contained in:
TheGamecraft
2018-09-10 08:51:18 -04:00
parent 7fe13ae0a7
commit 0e0ef86b71
1404 changed files with 10604 additions and 33714 deletions

View File

@@ -26,7 +26,7 @@ class ListPassTest extends CodeCleanerTestCase
*/
public function testProcessInvalidStatement($code, $expectedMessage)
{
if (method_exists($this, 'setExpectedException')) {
if (\method_exists($this, 'setExpectedException')) {
$this->setExpectedException('Psy\Exception\ParseErrorException', $expectedMessage);
} else {
$this->expectExceptionMessage($expectedMessage);
@@ -50,20 +50,23 @@ class ListPassTest extends CodeCleanerTestCase
['list("a") = array(1)', $errorPhpParserSyntax],
];
if (version_compare(PHP_VERSION, '7.1', '<')) {
return array_merge($invalidExpr, [
if (\version_compare(PHP_VERSION, '7.1', '<')) {
return \array_merge($invalidExpr, [
['list("a" => _) = array("a" => 1)', $errorPhpParserSyntax],
['[] = []', $errorShortListAssign],
['[$a] = [1]', $errorShortListAssign],
['list("a" => $a) = array("a" => 1)', $errorAssocListAssign],
['[$a[0], $a[1]] = [1, 2]', $errorShortListAssign],
['[$a->b, $a->c] = [1, 2]', $errorShortListAssign],
]);
}
return array_merge($invalidExpr, [
return \array_merge($invalidExpr, [
['list("a" => _) = array("a" => 1)', $errorPhpParserSyntax],
['["a"] = [1]', $errorNonVariableAssign],
['[] = []', $errorEmptyList],
['[,] = [1,2]', $errorEmptyList],
['[,,] = [1,2,3]', $errorEmptyList],
]);
}
@@ -84,8 +87,8 @@ class ListPassTest extends CodeCleanerTestCase
['list($x, $y) = array(1, 2)'],
];
if (version_compare(PHP_VERSION, '7.1', '>=')) {
return array_merge($validExpr, [
if (\version_compare(PHP_VERSION, '7.1', '>=')) {
return \array_merge($validExpr, [
['[$a] = array(1)'],
['list($b) = [2]'],
['[$x, $y] = array(1, 2)'],
@@ -96,6 +99,8 @@ class ListPassTest extends CodeCleanerTestCase
['[,$b] = [1,2,3]'],
['[$a,,$c] = [1,2,3]'],
['[$a,,,] = [1,2,3]'],
['[$a[0], $a[1]] = [1, 2]'],
['[$a->b, $a->c] = [1, 2]'],
]);
}