TruncateMode.php 903 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Component\String;
  11. enum TruncateMode
  12. {
  13. /**
  14. * Will cut exactly at given length.
  15. *
  16. * Length: 14
  17. * Source: Lorem ipsum dolor sit amet
  18. * Output: Lorem ipsum do
  19. */
  20. case Char;
  21. /**
  22. * Returns the string up to the last complete word containing the specified length.
  23. *
  24. * Length: 14
  25. * Source: Lorem ipsum dolor sit amet
  26. * Output: Lorem ipsum
  27. */
  28. case WordBefore;
  29. /**
  30. * Returns the string up to the complete word after or at the given length.
  31. *
  32. * Length: 14
  33. * Source: Lorem ipsum dolor sit amet
  34. * Output: Lorem ipsum dolor
  35. */
  36. case WordAfter;
  37. }