AbstractRuleSetDescription.php 732 B

1234567891011121314151617181920212223242526272829303132333435
  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\RuleSet;
  12. /**
  13. * @internal
  14. */
  15. abstract class AbstractRuleSetDescription implements RuleSetDescriptionInterface
  16. {
  17. public function __construct()
  18. {
  19. }
  20. public function getName()
  21. {
  22. $name = substr(static::class, 1 + strrpos(static::class, '\\'), -3);
  23. return '@'.str_replace('Risky', ':risky', $name);
  24. }
  25. public function isRisky()
  26. {
  27. return false !== strpos(static::class, 'Risky');
  28. }
  29. }