composer update
This commit is contained in:
9
vendor/vlucas/phpdotenv/composer.json
vendored
9
vendor/vlucas/phpdotenv/composer.json
vendored
@@ -17,13 +17,13 @@
|
||||
],
|
||||
"require": {
|
||||
"php": "^5.4 || ^7.0 || ^8.0",
|
||||
"phpoption/phpoption": "^1.5",
|
||||
"symfony/polyfill-ctype": "^1.9"
|
||||
"phpoption/phpoption": "^1.5.2",
|
||||
"symfony/polyfill-ctype": "^1.17"
|
||||
},
|
||||
"require-dev": {
|
||||
"ext-filter": "*",
|
||||
"ext-pcre": "*",
|
||||
"phpunit/phpunit": "^4.8.35 || ^5.0 || ^6.0 || ^7.0"
|
||||
"phpunit/phpunit": "^4.8.35 || ^5.7.27 || ^6.5.6 || ^7.0"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
@@ -35,8 +35,7 @@
|
||||
"ext-pcre": "Required to use most of the library."
|
||||
},
|
||||
"config": {
|
||||
"preferred-install": "dist",
|
||||
"platform-check": false
|
||||
"preferred-install": "dist"
|
||||
},
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
|
||||
3
vendor/vlucas/phpdotenv/src/Parser.php
vendored
3
vendor/vlucas/phpdotenv/src/Parser.php
vendored
@@ -3,6 +3,7 @@
|
||||
namespace Dotenv;
|
||||
|
||||
use Dotenv\Exception\InvalidFileException;
|
||||
use Dotenv\Regex\Regex;
|
||||
|
||||
class Parser
|
||||
{
|
||||
@@ -87,7 +88,7 @@ class Parser
|
||||
*/
|
||||
private static function isValidName($name)
|
||||
{
|
||||
return preg_match('~\A[a-zA-Z0-9_.]+\z~', $name) === 1;
|
||||
return Regex::match('~\A[a-zA-Z0-9_.]+\z~', $name)->success()->getOrElse(0) === 1;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
35
vendor/vlucas/phpdotenv/src/Regex/Regex.php
vendored
35
vendor/vlucas/phpdotenv/src/Regex/Regex.php
vendored
@@ -2,8 +2,6 @@
|
||||
|
||||
namespace Dotenv\Regex;
|
||||
|
||||
use PhpOption\Option;
|
||||
|
||||
class Regex
|
||||
{
|
||||
/**
|
||||
@@ -81,20 +79,23 @@ class Regex
|
||||
*/
|
||||
private static function lookupError($code)
|
||||
{
|
||||
return Option::fromValue(get_defined_constants(true))
|
||||
->filter(function (array $consts) {
|
||||
return isset($consts['pcre']) && defined('ARRAY_FILTER_USE_KEY');
|
||||
})
|
||||
->map(function (array $consts) {
|
||||
return array_filter($consts['pcre'], function ($msg) {
|
||||
return substr($msg, -6) === '_ERROR';
|
||||
}, ARRAY_FILTER_USE_KEY);
|
||||
})
|
||||
->flatMap(function (array $errors) use ($code) {
|
||||
return Option::fromValue(
|
||||
array_search($code, $errors, true)
|
||||
);
|
||||
})
|
||||
->getOrElse('PREG_ERROR');
|
||||
if (defined('PREG_JIT_STACKLIMIT_ERROR') && $code === PREG_JIT_STACKLIMIT_ERROR) {
|
||||
return 'JIT stack limit exhausted';
|
||||
}
|
||||
|
||||
switch ($code) {
|
||||
case PREG_INTERNAL_ERROR:
|
||||
return 'Internal error';
|
||||
case PREG_BAD_UTF8_ERROR:
|
||||
return 'Malformed UTF-8 characters, possibly incorrectly encoded';
|
||||
case PREG_BAD_UTF8_OFFSET_ERROR:
|
||||
return 'The offset did not correspond to the beginning of a valid UTF-8 code point';
|
||||
case PREG_BACKTRACK_LIMIT_ERROR:
|
||||
return 'Backtrack limit exhausted';
|
||||
case PREG_RECURSION_LIMIT_ERROR:
|
||||
return 'Recursion limit exhausted';
|
||||
default:
|
||||
return 'Unknown error';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user