Skip to content

Commit

Permalink
Don't calculate diffs when --no-diffs is given (#3710)
Browse files Browse the repository at this point in the history
* Don't calculate diffs when --no-diffs is given

* Update ApplicationFileProcessor.php
  • Loading branch information
staabm committed Apr 29, 2023
1 parent ed8e74e commit d7a738c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/Application/ApplicationFileProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ public function run(Configuration $configuration, InputInterface $input): array

$systemErrorsAndFileDiffs = $this->processFiles($files, $configuration);

$this->fileDiffFileDecorator->decorate($files);
if ($configuration->shouldShowDiffs()) {
$this->fileDiffFileDecorator->decorate($files);
}
$this->printFiles($files, $configuration);
}

Expand Down
4 changes: 3 additions & 1 deletion src/Application/FileProcessor/PhpFileProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,9 @@ private function printFile(File $file, Configuration $configuration): void
}

$file->changeFileContent($newContent);
$this->fileDiffFileDecorator->decorate([$file]);
if ($configuration->shouldShowDiffs()) {
$this->fileDiffFileDecorator->decorate([$file]);
}
}

private function notifyFile(File $file): void
Expand Down

0 comments on commit d7a738c

Please sign in to comment.