ConfigInterface.php 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <?php
  2. /*
  3. * This file is part of the PHP CS utility.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * This source file is subject to the MIT license that is bundled
  8. * with this source code in the file LICENSE.
  9. */
  10. namespace Symfony\CS;
  11. /**
  12. * @author Fabien Potencier <fabien@symfony.com>
  13. */
  14. interface ConfigInterface
  15. {
  16. /**
  17. * Returns the name of the configuration.
  18. *
  19. * The name must be all lowercase and without any spaces.
  20. *
  21. * @return string The name of the configuration
  22. */
  23. public function getName();
  24. /**
  25. * Returns the description of the configuration.
  26. *
  27. * A short one-line description for the configuration.
  28. *
  29. * @return string The description of the configuration
  30. */
  31. public function getDescription();
  32. /**
  33. * Returns an iterator of files to scan.
  34. *
  35. * @return \Traversable A \Traversable instance that returns \SplFileInfo instances
  36. */
  37. public function getFinder();
  38. /**
  39. * Returns the level to run.
  40. *
  41. * @return int A level
  42. */
  43. public function getLevel();
  44. /**
  45. * Returns the fixers to run.
  46. *
  47. * @return array A list of fixer names
  48. */
  49. public function getFixers();
  50. /**
  51. * Sets the root directory of the project.
  52. *
  53. * @param string $dir The project root directory
  54. */
  55. public function setDir($dir);
  56. /**
  57. * Returns the root directory of the project.
  58. *
  59. * @return string The project root directory
  60. */
  61. public function getDir();
  62. /**
  63. * Adds an instance of a custom fixer.
  64. *
  65. * @param FixerInterface $fixer
  66. */
  67. public function addCustomFixer(FixerInterface $fixer);
  68. /**
  69. * Returns the custom fixers to use.
  70. *
  71. * @return FixerInterface[]
  72. */
  73. public function getCustomFixers();
  74. }