RunnerConfig.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <?php
  2. declare(strict_types=1);
  3. /*
  4. * This file is part of PHP CS Fixer.
  5. *
  6. * (c) Fabien Potencier <fabien@symfony.com>
  7. * Dariusz Rumiński <dariusz.ruminski@gmail.com>
  8. *
  9. * This source file is subject to the MIT license that is bundled
  10. * with this source code in the file LICENSE.
  11. */
  12. namespace PhpCsFixer\Runner;
  13. use PhpCsFixer\Runner\Parallel\ParallelConfig;
  14. /**
  15. * @author Greg Korba <greg@codito.dev>
  16. *
  17. * @internal
  18. */
  19. final class RunnerConfig
  20. {
  21. private bool $isDryRun;
  22. private bool $stopOnViolation;
  23. private ParallelConfig $parallelConfig;
  24. private ?string $configFile;
  25. public function __construct(
  26. bool $isDryRun,
  27. bool $stopOnViolation,
  28. ParallelConfig $parallelConfig,
  29. ?string $configFile = null
  30. ) {
  31. $this->isDryRun = $isDryRun;
  32. $this->stopOnViolation = $stopOnViolation;
  33. $this->parallelConfig = $parallelConfig;
  34. $this->configFile = $configFile;
  35. }
  36. public function isDryRun(): bool
  37. {
  38. return $this->isDryRun;
  39. }
  40. public function shouldStopOnViolation(): bool
  41. {
  42. return $this->stopOnViolation;
  43. }
  44. public function getParallelConfig(): ParallelConfig
  45. {
  46. return $this->parallelConfig;
  47. }
  48. public function getConfigFile(): ?string
  49. {
  50. return $this->configFile;
  51. }
  52. }