composer update

This commit is contained in:
2020-12-06 10:28:55 +00:00
parent 69d92960d9
commit 09413522bb
1596 changed files with 60456 additions and 39587 deletions

View File

@@ -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": {

View File

@@ -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;
}
/**

View File

@@ -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';
}
}
}