Skip to content

Commit 8f71e9a

Browse files
Merge branch '3.6'
2 parents 763e8e5 + 5c8934c commit 8f71e9a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Loader/Parser.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Dotenv\Loader;
44

55
use Dotenv\Exception\InvalidFileException;
6+
use Dotenv\Regex\Regex;
67
use Dotenv\Result\Error;
78
use Dotenv\Result\Success;
89
use RuntimeException;
@@ -91,7 +92,7 @@ private static function parseName($name)
9192
*/
9293
private static function isValidName($name)
9394
{
94-
return preg_match('~\A[a-zA-Z0-9_.]+\z~', $name) === 1;
95+
return Regex::match('~\A[a-zA-Z0-9_.]+\z~', $name)->success()->getOrElse(0) === 1;
9596
}
9697

9798
/**

0 commit comments

Comments
 (0)