Skip to content

Commit 3f02441

Browse files
authored
Merge pull request #11 from sanovskiy/dev
NamingStyle now allows digits in strings
2 parents a0c9f8b + b36e7f2 commit 3f02441

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/NamingStyle.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,22 @@ class NamingStyle
66
{
77
public static function isUpperCamelCase(string $str): bool
88
{
9-
return preg_match('/^[A-Z][a-zA-Z]*$/', $str) === 1;
9+
return preg_match('/^[A-Z][a-zA-Z\d]*$/', $str) === 1;
1010
}
1111

1212
public static function isLowerCamelCase(string $str): bool
1313
{
14-
return preg_match('/^[a-z]*[A-Z][a-zA-Z]*$/', $str) === 1;
14+
return preg_match('/^[a-z]*[A-Z][a-zA-Z\d]*$/', $str) === 1;
1515
}
1616

1717
public static function isSnakeCase(string $str): bool
1818
{
19-
return preg_match('/^[a-z]+(_[a-z]+)*$/', $str) === 1;
19+
return preg_match('/^[a-z\d]+(_[a-z\d]+)*$/', $str) === 1;
2020
}
2121

2222
public static function isScreamingSnakeCase(string $str): bool
2323
{
24-
return preg_match('/^[A-Z]+(_[A-Z]+)*$/', $str) === 1;
24+
return preg_match('/^[A-Z\d]+(_[A-Z\d]+)*$/', $str) === 1;
2525
}
2626

2727
public static function toSnakeCase(string $str): string

0 commit comments

Comments
 (0)