Поменял структуру проекта для расширения задачи с приемом

This commit is contained in:
2024-10-10 08:38:24 +03:00
parent 2be45826c1
commit 984f6bda0a
1716 changed files with 444 additions and 139201 deletions

View File

@ -16,7 +16,7 @@
}
],
"require": {
"php": ">=7.1"
"php": ">=7.2"
},
"provide": {
"ext-ctype": "*"

View File

@ -353,11 +353,18 @@ class Inline
++$i;
// [foo, bar, ...]
$lastToken = null;
while ($i < $len) {
if (']' === $sequence[$i]) {
return $output;
}
if (',' === $sequence[$i] || ' ' === $sequence[$i]) {
if (',' === $sequence[$i] && (null === $lastToken || 'separator' === $lastToken)) {
$output[] = null;
} elseif (',' === $sequence[$i]) {
$lastToken = 'separator';
}
++$i;
continue;
@ -401,6 +408,7 @@ class Inline
$output[] = $value;
$lastToken = 'value';
++$i;
}
@ -716,8 +724,13 @@ class Inline
case Parser::preg_match('/^(-|\+)?[0-9][0-9_]*(\.[0-9_]+)?$/', $scalar):
return (float) str_replace('_', '', $scalar);
case Parser::preg_match(self::getTimestampRegex(), $scalar):
// When no timezone is provided in the parsed date, YAML spec says we must assume UTC.
$time = new \DateTimeImmutable($scalar, new \DateTimeZone('UTC'));
try {
// When no timezone is provided in the parsed date, YAML spec says we must assume UTC.
$time = new \DateTimeImmutable($scalar, new \DateTimeZone('UTC'));
} catch (\Exception $e) {
// Some dates accepted by the regex are not valid dates.
throw new ParseException(\sprintf('The date "%s" could not be parsed as it is an invalid date.', $scalar), self::$parsedLineNumber + 1, $scalar, self::$parsedFilename, $e);
}
if (Yaml::PARSE_DATETIME & $flags) {
return $time;