/vendor/phalcon/devtools/ide/2.0.3/Phalcon/Text.php

https://gitlab.com/habracoder/advertising · PHP · 155 lines · 20 code · 23 blank · 112 comment · 0 complexity · 2de32be2e8306c91a517951104252b7e MD5 · raw file

  1. <?php
  2. namespace Phalcon;
  3. /**
  4. * Phalcon\Text
  5. * Provides utilities to work with texts
  6. */
  7. abstract class Text
  8. {
  9. const RANDOM_ALNUM = 0;
  10. const RANDOM_ALPHA = 1;
  11. const RANDOM_HEXDEC = 2;
  12. const RANDOM_NUMERIC = 3;
  13. const RANDOM_NOZERO = 4;
  14. /**
  15. * Converts strings to camelize style
  16. * <code>
  17. * echo Phalcon\Text::camelize('coco_bongo'); //CocoBongo
  18. * </code>
  19. *
  20. * @param string $str
  21. * @return string
  22. */
  23. public static function camelize($str) {}
  24. /**
  25. * Uncamelize strings which are camelized
  26. * <code>
  27. * echo Phalcon\Text::camelize('CocoBongo'); //coco_bongo
  28. * </code>
  29. *
  30. * @param string $str
  31. * @return string
  32. */
  33. public static function uncamelize($str) {}
  34. /**
  35. * Adds a number to a string or increment that number if it already is defined
  36. * <code>
  37. * echo Phalcon\Text::increment("a"); // "a_1"
  38. * echo Phalcon\Text::increment("a_1"); // "a_2"
  39. * </code>
  40. *
  41. * @param string $str
  42. * @param mixed $separator
  43. * @return string
  44. */
  45. public static function increment($str, $separator = null) {}
  46. /**
  47. * Generates a random string based on the given type. Type is one of the RANDOM_* constants
  48. * <code>
  49. * echo Phalcon\Text::random(Phalcon\Text::RANDOM_ALNUM); //"aloiwkqz"
  50. * </code>
  51. *
  52. * @param int $type
  53. * @param long $length
  54. * @return string
  55. */
  56. public static function random($type = 0, $length = 8) {}
  57. /**
  58. * Check if a string starts with a given string
  59. * <code>
  60. * echo Phalcon\Text::startsWith("Hello", "He"); // true
  61. * echo Phalcon\Text::startsWith("Hello", "he", false); // false
  62. * echo Phalcon\Text::startsWith("Hello", "he"); // true
  63. * </code>
  64. *
  65. * @param string $str
  66. * @param string $start
  67. * @param bool $ignoreCase
  68. * @return bool
  69. */
  70. public static function startsWith($str, $start, $ignoreCase = true) {}
  71. /**
  72. * Check if a string ends with a given string
  73. * <code>
  74. * echo Phalcon\Text::endsWith("Hello", "llo"); // true
  75. * echo Phalcon\Text::endsWith("Hello", "LLO", false); // false
  76. * echo Phalcon\Text::endsWith("Hello", "LLO"); // true
  77. * </code>
  78. *
  79. * @param string $str
  80. * @param string $end
  81. * @param bool $ignoreCase
  82. * @return bool
  83. */
  84. public static function endsWith($str, $end, $ignoreCase = true) {}
  85. /**
  86. * Lowercases a string, this function makes use of the mbstring extension if available
  87. * <code>
  88. * echo Phalcon\Text::lower("HELLO"); // hello
  89. * </code>
  90. *
  91. * @param string $str
  92. * @param string $encoding
  93. * @return string
  94. */
  95. public static function lower($str, $encoding = "UTF-8") {}
  96. /**
  97. * Uppercases a string, this function makes use of the mbstring extension if available
  98. * <code>
  99. * echo Phalcon\Text::upper("hello"); // HELLO
  100. * </code>
  101. *
  102. * @param string $str
  103. * @param string $encoding
  104. * @return string
  105. */
  106. public static function upper($str, $encoding = "UTF-8") {}
  107. /**
  108. * Reduces multiple slashes in a string to single slashes
  109. * <code>
  110. * echo Phalcon\Text::reduceSlashes("foo//bar/baz"); // foo/bar/baz
  111. * echo Phalcon\Text::reduceSlashes("http://foo.bar///baz/buz"); // http://foo.bar/baz/buz
  112. * </code>
  113. *
  114. * @param string $str
  115. * @return string
  116. */
  117. public static function reduceSlashes($str) {}
  118. /**
  119. * Concatenates strings using the separator only once without duplication in places concatenation
  120. * <code>
  121. * $str = Phalcon\Text::concat("/", "/tmp/", "/folder_1/", "/folder_2", "folder_3/");
  122. * echo $str; // /tmp/folder_1/folder_2/folder_3/
  123. * </code>
  124. *
  125. * @param string $separator
  126. * @param string $a
  127. * @param string $b
  128. * @param string $...N
  129. * @return string
  130. */
  131. public static function concat() {}
  132. }