ReportSummary.php 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. <?php
  2. /*
  3. * This file is part of PHP CS Fixer.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. * Dariusz Rumiński <dariusz.ruminski@gmail.com>
  7. *
  8. * This source file is subject to the MIT license that is bundled
  9. * with this source code in the file LICENSE.
  10. */
  11. namespace PhpCsFixer\Report;
  12. /**
  13. * @author Dariusz Rumiński <dariusz.ruminski@gmail.com>
  14. *
  15. * @internal
  16. */
  17. final class ReportSummary
  18. {
  19. /**
  20. * @var bool
  21. */
  22. private $addAppliedFixers = false;
  23. /**
  24. * @var array
  25. */
  26. private $changed = array();
  27. /**
  28. * @var bool
  29. */
  30. private $isDecoratedOutput = false;
  31. /**
  32. * @var bool
  33. */
  34. private $isDryRun = false;
  35. /**
  36. * @var int
  37. */
  38. private $memory;
  39. /**
  40. * @var int
  41. */
  42. private $time;
  43. /**
  44. * @param array $changed
  45. * @param int $time duration in milliseconds
  46. * @param int $memory memory usage in bytes
  47. * @param bool $addAppliedFixers
  48. * @param bool $isDryRun
  49. * @param bool $isDecoratedOutput
  50. */
  51. public function __construct(
  52. array $changed,
  53. $time,
  54. $memory,
  55. $addAppliedFixers,
  56. $isDryRun,
  57. $isDecoratedOutput
  58. ) {
  59. $this->changed = $changed;
  60. $this->time = $time;
  61. $this->memory = $memory;
  62. $this->addAppliedFixers = $addAppliedFixers;
  63. $this->isDryRun = $isDryRun;
  64. $this->isDecoratedOutput = $isDecoratedOutput;
  65. }
  66. /**
  67. * @return bool
  68. */
  69. public function isDecoratedOutput()
  70. {
  71. return $this->isDecoratedOutput;
  72. }
  73. /**
  74. * @return bool
  75. */
  76. public function isDryRun()
  77. {
  78. return $this->isDryRun;
  79. }
  80. /**
  81. * @return array
  82. */
  83. public function getChanged()
  84. {
  85. return $this->changed;
  86. }
  87. /**
  88. * @return int
  89. */
  90. public function getMemory()
  91. {
  92. return $this->memory;
  93. }
  94. /**
  95. * @return int
  96. */
  97. public function getTime()
  98. {
  99. return $this->time;
  100. }
  101. /**
  102. * @return bool
  103. */
  104. public function shouldAddAppliedFixers()
  105. {
  106. return $this->addAppliedFixers;
  107. }
  108. }