Skip to content

Commit b4f3b82

Browse files
committed
Use self to access caches in Util
1 parent d27f805 commit b4f3b82

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/Util.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ public static function stringSnake(string $value, string $delimiter = '_')
3939
{
4040
$key = $value;
4141

42-
if (isset(static::$snakeCache[$key][$delimiter])) {
43-
return static::$snakeCache[$key][$delimiter];
42+
if (isset(self::$snakeCache[$key][$delimiter])) {
43+
return self::$snakeCache[$key][$delimiter];
4444
}
4545

4646
if (!ctype_lower($value)) {
@@ -49,7 +49,7 @@ public static function stringSnake(string $value, string $delimiter = '_')
4949
$value = static::stringLower(preg_replace('/(.)(?=[A-Z])/u', '$1'.$delimiter, $value));
5050
}
5151

52-
return static::$snakeCache[$key][$delimiter] = $value;
52+
return self::$snakeCache[$key][$delimiter] = $value;
5353
}
5454

5555
/**
@@ -63,13 +63,13 @@ public static function stringStudly(string $value)
6363
{
6464
$key = $value;
6565

66-
if (isset(static::$studlyCache[$key])) {
67-
return static::$studlyCache[$key];
66+
if (isset(self::$studlyCache[$key])) {
67+
return self::$studlyCache[$key];
6868
}
6969

7070
$value = ucwords(str_replace(['-', '_'], ' ', $value));
7171

72-
return static::$studlyCache[$key] = str_replace(' ', '', $value);
72+
return self::$studlyCache[$key] = str_replace(' ', '', $value);
7373
}
7474

7575
/**
@@ -81,11 +81,11 @@ public static function stringStudly(string $value)
8181
*/
8282
public static function stringCamel(string $value)
8383
{
84-
if (isset(static::$camelCache[$value])) {
85-
return static::$camelCache[$value];
84+
if (isset(self::$camelCache[$value])) {
85+
return self::$camelCache[$value];
8686
}
8787

88-
return static::$camelCache[$value] = lcfirst(static::stringStudly($value));
88+
return self::$camelCache[$value] = lcfirst(static::stringStudly($value));
8989
}
9090

9191
/**

0 commit comments

Comments
 (0)