Showing 8 of 8 total issues
Method formatToStylish
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function formatToStylish(array $diffTree, int $depth = 0): array
{
$indent = getIndent($depth);
$nextDepth = $depth + 1;
$result = array_map(function ($node) use ($indent, $nextDepth): string {
Avoid too many return
statements within this method. Open
Open
return $result;
Avoid too many return
statements within this method. Open
Open
return implode(PHP_EOL, formatToPlain($node['children'], $ancestryPath));
Avoid too many return
statements within this method. Open
Open
return array_filter($result);
Avoid too many return
statements within this method. Open
Open
return "'{$value}'";
Avoid too many return
statements within this method. Open
Open
return ['key' => $key, 'type' => 'changed', 'valueOld' => $data1[$key], 'valueNew' => $data2[$key]];
Avoid too many return
statements within this method. Open
Open
return "{$indent} {$node['key']}: {" . PHP_EOL .
"{$stringNested}" . PHP_EOL . "{$indent} }";
Avoid too many return
statements within this method. Open
Open
return $diffTree;