.php-cs-fixer.custom.php 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  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. use PhpCsFixer\ConfigInterface;
  12. /**
  13. * Custom config class/file for PHPUnit test.
  14. *
  15. * This class does NOT represent a good/sane configuration and is therefore NOT an example.
  16. *
  17. * @internal
  18. */
  19. final class CustomConfig implements ConfigInterface
  20. {
  21. /**
  22. * {@inheritdoc}
  23. */
  24. public function getCacheFile(): ?string
  25. {
  26. return null;
  27. }
  28. /**
  29. * {@inheritdoc}
  30. */
  31. public function getCustomFixers(): array
  32. {
  33. return array();
  34. }
  35. /**
  36. * {@inheritdoc}
  37. */
  38. public function getFinder(): iterable
  39. {
  40. return array(__FILE__);
  41. }
  42. /**
  43. * {@inheritdoc}
  44. */
  45. public function getFormat(): string
  46. {
  47. return 'txt';
  48. }
  49. /**
  50. * {@inheritdoc}
  51. */
  52. public function getHideProgress(): bool
  53. {
  54. return false;
  55. }
  56. /**
  57. * {@inheritdoc}
  58. */
  59. public function getIndent(): string
  60. {
  61. return ' ';
  62. }
  63. /**
  64. * {@inheritdoc}
  65. */
  66. public function getLineEnding(): string
  67. {
  68. return "\n";
  69. }
  70. /**
  71. * {@inheritdoc}
  72. */
  73. public function getName(): string
  74. {
  75. return 'custom_config_test';
  76. }
  77. /**
  78. * {@inheritdoc}
  79. */
  80. public function getPhpExecutable(): ?string
  81. {
  82. return null;
  83. }
  84. /**
  85. * {@inheritdoc}
  86. */
  87. public function getRiskyAllowed(): bool
  88. {
  89. return true;
  90. }
  91. /**
  92. * {@inheritdoc}
  93. */
  94. public function getRules(): array
  95. {
  96. return array('concat_space' => array('spacing' => 'none'));
  97. }
  98. /**
  99. * {@inheritdoc}
  100. */
  101. public function getUsingCache(): bool
  102. {
  103. return false;
  104. }
  105. /**
  106. * {@inheritdoc}
  107. */
  108. public function registerCustomFixers(iterable $fixers): ConfigInterface
  109. {
  110. return $this;
  111. }
  112. /**
  113. * {@inheritdoc}
  114. */
  115. public function setCacheFile(string $cacheFile): ConfigInterface
  116. {
  117. return $this;
  118. }
  119. /**
  120. * {@inheritdoc}
  121. */
  122. public function setFinder(iterable $finder): ConfigInterface
  123. {
  124. return $this;
  125. }
  126. /**
  127. * {@inheritdoc}
  128. */
  129. public function setFormat(string $format): ConfigInterface
  130. {
  131. return $this;
  132. }
  133. /**
  134. * {@inheritdoc}
  135. */
  136. public function setHideProgress(bool $hideProgress): ConfigInterface
  137. {
  138. return $this;
  139. }
  140. /**
  141. * {@inheritdoc}
  142. */
  143. public function setIndent(string $indent): ConfigInterface
  144. {
  145. return $this;
  146. }
  147. /**
  148. * {@inheritdoc}
  149. */
  150. public function setLineEnding(string $lineEnding): ConfigInterface
  151. {
  152. return $this;
  153. }
  154. /**
  155. * {@inheritdoc}
  156. */
  157. public function setPhpExecutable(?string $phpExecutable): ConfigInterface
  158. {
  159. return $this;
  160. }
  161. /**
  162. * {@inheritdoc}
  163. */
  164. public function setRiskyAllowed(bool $isRiskyAllowed): ConfigInterface
  165. {
  166. return $this;
  167. }
  168. /**
  169. * {@inheritdoc}
  170. */
  171. public function setRules(array $rules): ConfigInterface
  172. {
  173. return $this;
  174. }
  175. /**
  176. * {@inheritdoc}
  177. */
  178. public function setUsingCache(bool $usingCache): ConfigInterface
  179. {
  180. return $this;
  181. }
  182. }
  183. return new CustomConfig();