aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/symfony/polyfill-ctype/Ctype.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/symfony/polyfill-ctype/Ctype.php')
-rw-r--r--vendor/symfony/polyfill-ctype/Ctype.php53
1 files changed, 29 insertions, 24 deletions
diff --git a/vendor/symfony/polyfill-ctype/Ctype.php b/vendor/symfony/polyfill-ctype/Ctype.php
index 58414dc73..ba75a2c95 100644
--- a/vendor/symfony/polyfill-ctype/Ctype.php
+++ b/vendor/symfony/polyfill-ctype/Ctype.php
@@ -25,13 +25,13 @@ final class Ctype
*
* @see https://php.net/ctype-alnum
*
- * @param string|int $text
+ * @param mixed $text
*
* @return bool
*/
public static function ctype_alnum($text)
{
- $text = self::convert_int_to_char_for_ctype($text);
+ $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__);
return \is_string($text) && '' !== $text && !preg_match('/[^A-Za-z0-9]/', $text);
}
@@ -41,13 +41,13 @@ final class Ctype
*
* @see https://php.net/ctype-alpha
*
- * @param string|int $text
+ * @param mixed $text
*
* @return bool
*/
public static function ctype_alpha($text)
{
- $text = self::convert_int_to_char_for_ctype($text);
+ $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__);
return \is_string($text) && '' !== $text && !preg_match('/[^A-Za-z]/', $text);
}
@@ -57,13 +57,13 @@ final class Ctype
*
* @see https://php.net/ctype-cntrl
*
- * @param string|int $text
+ * @param mixed $text
*
* @return bool
*/
public static function ctype_cntrl($text)
{
- $text = self::convert_int_to_char_for_ctype($text);
+ $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__);
return \is_string($text) && '' !== $text && !preg_match('/[^\x00-\x1f\x7f]/', $text);
}
@@ -73,13 +73,13 @@ final class Ctype
*
* @see https://php.net/ctype-digit
*
- * @param string|int $text
+ * @param mixed $text
*
* @return bool
*/
public static function ctype_digit($text)
{
- $text = self::convert_int_to_char_for_ctype($text);
+ $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__);
return \is_string($text) && '' !== $text && !preg_match('/[^0-9]/', $text);
}
@@ -89,13 +89,13 @@ final class Ctype
*
* @see https://php.net/ctype-graph
*
- * @param string|int $text
+ * @param mixed $text
*
* @return bool
*/
public static function ctype_graph($text)
{
- $text = self::convert_int_to_char_for_ctype($text);
+ $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__);
return \is_string($text) && '' !== $text && !preg_match('/[^!-~]/', $text);
}
@@ -105,13 +105,13 @@ final class Ctype
*
* @see https://php.net/ctype-lower
*
- * @param string|int $text
+ * @param mixed $text
*
* @return bool
*/
public static function ctype_lower($text)
{
- $text = self::convert_int_to_char_for_ctype($text);
+ $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__);
return \is_string($text) && '' !== $text && !preg_match('/[^a-z]/', $text);
}
@@ -121,13 +121,13 @@ final class Ctype
*
* @see https://php.net/ctype-print
*
- * @param string|int $text
+ * @param mixed $text
*
* @return bool
*/
public static function ctype_print($text)
{
- $text = self::convert_int_to_char_for_ctype($text);
+ $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__);
return \is_string($text) && '' !== $text && !preg_match('/[^ -~]/', $text);
}
@@ -137,13 +137,13 @@ final class Ctype
*
* @see https://php.net/ctype-punct
*
- * @param string|int $text
+ * @param mixed $text
*
* @return bool
*/
public static function ctype_punct($text)
{
- $text = self::convert_int_to_char_for_ctype($text);
+ $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__);
return \is_string($text) && '' !== $text && !preg_match('/[^!-\/\:-@\[-`\{-~]/', $text);
}
@@ -153,13 +153,13 @@ final class Ctype
*
* @see https://php.net/ctype-space
*
- * @param string|int $text
+ * @param mixed $text
*
* @return bool
*/
public static function ctype_space($text)
{
- $text = self::convert_int_to_char_for_ctype($text);
+ $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__);
return \is_string($text) && '' !== $text && !preg_match('/[^\s]/', $text);
}
@@ -169,13 +169,13 @@ final class Ctype
*
* @see https://php.net/ctype-upper
*
- * @param string|int $text
+ * @param mixed $text
*
* @return bool
*/
public static function ctype_upper($text)
{
- $text = self::convert_int_to_char_for_ctype($text);
+ $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__);
return \is_string($text) && '' !== $text && !preg_match('/[^A-Z]/', $text);
}
@@ -185,13 +185,13 @@ final class Ctype
*
* @see https://php.net/ctype-xdigit
*
- * @param string|int $text
+ * @param mixed $text
*
* @return bool
*/
public static function ctype_xdigit($text)
{
- $text = self::convert_int_to_char_for_ctype($text);
+ $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__);
return \is_string($text) && '' !== $text && !preg_match('/[^A-Fa-f0-9]/', $text);
}
@@ -204,11 +204,12 @@ final class Ctype
* (negative values have 256 added in order to allow characters in the Extended ASCII range).
* Any other integer is interpreted as a string containing the decimal digits of the integer.
*
- * @param string|int $int
+ * @param mixed $int
+ * @param string $function
*
* @return mixed
*/
- private static function convert_int_to_char_for_ctype($int)
+ private static function convert_int_to_char_for_ctype($int, $function)
{
if (!\is_int($int)) {
return $int;
@@ -218,6 +219,10 @@ final class Ctype
return (string) $int;
}
+ if (\PHP_VERSION_ID >= 80100) {
+ @trigger_error($function.'(): Argument of type int will be interpreted as string in the future', \E_USER_DEPRECATED);
+ }
+
if ($int < 0) {
$int += 256;
}