Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

namespace Rector\Tests\Php85\Rector\Expression\NestedFuncCallsToPipeOperatorRector\Fixture;

$arrayOfArrays = [['a'], ['a'], ['b']];
$merged = array_unique(array_merge(...$arrayOfArrays));

?>
-----
<?php

namespace Rector\Tests\Php85\Rector\Expression\NestedFuncCallsToPipeOperatorRector\Fixture;

$arrayOfArrays = [['a'], ['a'], ['b']];
$merged = array_merge(...$arrayOfArrays)
|> array_unique(...);

?>
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,11 @@ private function processNestedCalls(Expr $expr, bool $deep = false): ?Expr

// If we're deep in recursion and hit a non-FuncCall, this is the base
if ($deep) {
// Spread argument can't be converted to pipe — keep the call as-is
if ($arg->unpack) {
return null;
}

// Return a pipe with the base expression on the left
return new Pipe($arg->value, $this->createPlaceholderCall($expr));
}
Expand Down
10 changes: 5 additions & 5 deletions src/ChangesReporting/Output/JUnitOutputFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,16 @@ public function report(ProcessResult $processResult, Configuration $configuratio

$domDocument = new DOMDocument('1.0', 'UTF-8');

$xmlTestSuite = $domDocument->createElement(self::XML_ELEMENT_TESTSUITE);
$xmlTestSuite->setAttribute(self::XML_ATTRIBUTE_NAME, 'rector');
$domElement = $domDocument->createElement(self::XML_ELEMENT_TESTSUITE);
$domElement->setAttribute(self::XML_ATTRIBUTE_NAME, 'rector');

$xmlTestSuites = $domDocument->createElement(self::XML_ELEMENT_TESTSUITES);
$xmlTestSuites->appendChild($xmlTestSuite);
$xmlTestSuites->appendChild($domElement);

$domDocument->appendChild($xmlTestSuites);

$this->appendSystemErrors($processResult, $configuration, $domDocument, $xmlTestSuite);
$this->appendFileDiffs($processResult, $configuration, $domDocument, $xmlTestSuite);
$this->appendSystemErrors($processResult, $configuration, $domDocument, $domElement);
$this->appendFileDiffs($processResult, $configuration, $domDocument, $domElement);

echo $domDocument->saveXML() . PHP_EOL;
}
Expand Down
Loading