update to php-parser 4.2.2

This commit is contained in:
Tomas Votruba 2019-05-25 22:18:10 +02:00
parent 641ac4f08f
commit 1d24dae9df
5 changed files with 6 additions and 14 deletions

View File

@ -12,7 +12,7 @@
"jetbrains/phpstorm-stubs": "^2019.1",
"nette/robot-loader": "^3.1",
"nette/utils": "^2.5|^3.0",
"nikic/php-parser": "^4.2.1",
"nikic/php-parser": "^4.2.2",
"phpstan/phpdoc-parser": "0.3.3",
"phpstan/phpstan": "0.11.6",
"sebastian/diff": "^3.0",

View File

@ -9,10 +9,6 @@ final class ClosureToArrowFunctionRectorTest extends AbstractRectorTestCase
{
public function test(): void
{
if (! class_exists('PhpParser\Node\Expr\ArrowFunction')) {
$this->markTestSkipped('Waits on php-parser release');
}
$this->doTestFiles([
__DIR__ . '/Fixture/fixture.php.inc',
__DIR__ . '/Fixture/referenced_but_not_used.php.inc',

View File

@ -9,10 +9,6 @@ final class ArraySpreadInsteadOfArrayMergeRectorTest extends AbstractRectorTestC
{
public function test(): void
{
if (! class_exists('PhpParser\Node\Expr\ArrowFunction')) {
$this->markTestSkipped('Waits on php-parser release');
}
$this->doTestFiles([
__DIR__ . '/Fixture/fixture.php.inc',
__DIR__ . '/Fixture/iterator_to_array.php.inc',

View File

@ -34,7 +34,8 @@ class DeliveryTest extends \PHPUnit\Framework\TestCase
$factory = $this->createMock(DeliveryFactory::class);
/** @var ShippingMethod|\PHPUnit\Framework\MockObject\MockObject $shippingMethod */
$shippingMethod = $this->createMock(ShippingMethod::class);
$factory->expects($this->atLeastOnce())->method('createShippingMethodFor')->with($this->equalTo(5))
$factory->expects($this->atLeastOnce())
->method('createShippingMethodFor')->with($this->equalTo(5))
->willReturn($shippingMethod);
}
}

View File

@ -70,21 +70,20 @@ final class BetterStandardPrinter extends Standard
* @param mixed[] $nodes
* @param mixed[] $origNodes
* @param int|null $fixup
* @param string|null $insertStr
*/
public function pArray(
array $nodes,
array $origNodes,
int &$pos,
int $indentAdjustment,
string $parentNodeType,
string $subNodeName,
$fixup,
$insertStr
$fixup
): ?string {
// reindex positions for printer
$nodes = array_values($nodes);
return parent::pArray($nodes, $origNodes, $pos, $indentAdjustment, $subNodeName, $fixup, $insertStr);
return parent::pArray($nodes, $origNodes, $pos, $indentAdjustment, $parentNodeType, $subNodeName, $fixup);
}
/**