updated-packages
This commit is contained in:
49
vendor/symfony/var-dumper/Caster/IntlCaster.php
vendored
49
vendor/symfony/var-dumper/Caster/IntlCaster.php
vendored
@@ -16,25 +16,27 @@ use Symfony\Component\VarDumper\Cloner\Stub;
|
||||
/**
|
||||
* @author Nicolas Grekas <p@tchwork.com>
|
||||
* @author Jan Schädlich <jan.schaedlich@sensiolabs.de>
|
||||
*
|
||||
* @final since Symfony 4.4
|
||||
*/
|
||||
class IntlCaster
|
||||
{
|
||||
public static function castMessageFormatter(\MessageFormatter $c, array $a, Stub $stub, $isNested)
|
||||
{
|
||||
$a += array(
|
||||
$a += [
|
||||
Caster::PREFIX_VIRTUAL.'locale' => $c->getLocale(),
|
||||
Caster::PREFIX_VIRTUAL.'pattern' => $c->getPattern(),
|
||||
);
|
||||
];
|
||||
|
||||
return self::castError($c, $a);
|
||||
}
|
||||
|
||||
public static function castNumberFormatter(\NumberFormatter $c, array $a, Stub $stub, $isNested, $filter = 0)
|
||||
{
|
||||
$a += array(
|
||||
$a += [
|
||||
Caster::PREFIX_VIRTUAL.'locale' => $c->getLocale(),
|
||||
Caster::PREFIX_VIRTUAL.'pattern' => $c->getPattern(),
|
||||
);
|
||||
];
|
||||
|
||||
if ($filter & Caster::EXCLUDE_VERBOSE) {
|
||||
$stub->cut += 3;
|
||||
@@ -42,9 +44,9 @@ class IntlCaster
|
||||
return self::castError($c, $a);
|
||||
}
|
||||
|
||||
$a += array(
|
||||
$a += [
|
||||
Caster::PREFIX_VIRTUAL.'attributes' => new EnumStub(
|
||||
array(
|
||||
[
|
||||
'PARSE_INT_ONLY' => $c->getAttribute(\NumberFormatter::PARSE_INT_ONLY),
|
||||
'GROUPING_USED' => $c->getAttribute(\NumberFormatter::GROUPING_USED),
|
||||
'DECIMAL_ALWAYS_SHOWN' => $c->getAttribute(\NumberFormatter::DECIMAL_ALWAYS_SHOWN),
|
||||
@@ -65,10 +67,10 @@ class IntlCaster
|
||||
'MIN_SIGNIFICANT_DIGITS' => $c->getAttribute(\NumberFormatter::MIN_SIGNIFICANT_DIGITS),
|
||||
'MAX_SIGNIFICANT_DIGITS' => $c->getAttribute(\NumberFormatter::MAX_SIGNIFICANT_DIGITS),
|
||||
'LENIENT_PARSE' => $c->getAttribute(\NumberFormatter::LENIENT_PARSE),
|
||||
)
|
||||
]
|
||||
),
|
||||
Caster::PREFIX_VIRTUAL.'text_attributes' => new EnumStub(
|
||||
array(
|
||||
[
|
||||
'POSITIVE_PREFIX' => $c->getTextAttribute(\NumberFormatter::POSITIVE_PREFIX),
|
||||
'POSITIVE_SUFFIX' => $c->getTextAttribute(\NumberFormatter::POSITIVE_SUFFIX),
|
||||
'NEGATIVE_PREFIX' => $c->getTextAttribute(\NumberFormatter::NEGATIVE_PREFIX),
|
||||
@@ -77,10 +79,10 @@ class IntlCaster
|
||||
'CURRENCY_CODE' => $c->getTextAttribute(\NumberFormatter::CURRENCY_CODE),
|
||||
'DEFAULT_RULESET' => $c->getTextAttribute(\NumberFormatter::DEFAULT_RULESET),
|
||||
'PUBLIC_RULESETS' => $c->getTextAttribute(\NumberFormatter::PUBLIC_RULESETS),
|
||||
)
|
||||
]
|
||||
),
|
||||
Caster::PREFIX_VIRTUAL.'symbols' => new EnumStub(
|
||||
array(
|
||||
[
|
||||
'DECIMAL_SEPARATOR_SYMBOL' => $c->getSymbol(\NumberFormatter::DECIMAL_SEPARATOR_SYMBOL),
|
||||
'GROUPING_SEPARATOR_SYMBOL' => $c->getSymbol(\NumberFormatter::GROUPING_SEPARATOR_SYMBOL),
|
||||
'PATTERN_SEPARATOR_SYMBOL' => $c->getSymbol(\NumberFormatter::PATTERN_SEPARATOR_SYMBOL),
|
||||
@@ -99,25 +101,25 @@ class IntlCaster
|
||||
'NAN_SYMBOL' => $c->getSymbol(\NumberFormatter::NAN_SYMBOL),
|
||||
'SIGNIFICANT_DIGIT_SYMBOL' => $c->getSymbol(\NumberFormatter::SIGNIFICANT_DIGIT_SYMBOL),
|
||||
'MONETARY_GROUPING_SEPARATOR_SYMBOL' => $c->getSymbol(\NumberFormatter::MONETARY_GROUPING_SEPARATOR_SYMBOL),
|
||||
)
|
||||
),
|
||||
);
|
||||
]
|
||||
),
|
||||
];
|
||||
|
||||
return self::castError($c, $a);
|
||||
}
|
||||
|
||||
public static function castIntlTimeZone(\IntlTimeZone $c, array $a, Stub $stub, $isNested)
|
||||
{
|
||||
$a += array(
|
||||
$a += [
|
||||
Caster::PREFIX_VIRTUAL.'display_name' => $c->getDisplayName(),
|
||||
Caster::PREFIX_VIRTUAL.'id' => $c->getID(),
|
||||
Caster::PREFIX_VIRTUAL.'raw_offset' => $c->getRawOffset(),
|
||||
);
|
||||
];
|
||||
|
||||
if ($c->useDaylightTime()) {
|
||||
$a += array(
|
||||
$a += [
|
||||
Caster::PREFIX_VIRTUAL.'dst_savings' => $c->getDSTSavings(),
|
||||
);
|
||||
];
|
||||
}
|
||||
|
||||
return self::castError($c, $a);
|
||||
@@ -125,25 +127,24 @@ class IntlCaster
|
||||
|
||||
public static function castIntlCalendar(\IntlCalendar $c, array $a, Stub $stub, $isNested, $filter = 0)
|
||||
{
|
||||
$a += array(
|
||||
$a += [
|
||||
Caster::PREFIX_VIRTUAL.'type' => $c->getType(),
|
||||
Caster::PREFIX_VIRTUAL.'first_day_of_week' => $c->getFirstDayOfWeek(),
|
||||
Caster::PREFIX_VIRTUAL.'minimal_days_in_first_week' => $c->getMinimalDaysInFirstWeek(),
|
||||
Caster::PREFIX_VIRTUAL.'repeated_wall_time_option' => $c->getRepeatedWallTimeOption(),
|
||||
Caster::PREFIX_VIRTUAL.'skipped_wall_time_option' => $c->getSkippedWallTimeOption(),
|
||||
Caster::PREFIX_VIRTUAL.'time' => $c->getTime(),
|
||||
Caster::PREFIX_VIRTUAL.'type' => $c->getType(),
|
||||
Caster::PREFIX_VIRTUAL.'in_daylight_time' => $c->inDaylightTime(),
|
||||
Caster::PREFIX_VIRTUAL.'is_lenient' => $c->isLenient(),
|
||||
Caster::PREFIX_VIRTUAL.'time_zone' => ($filter & Caster::EXCLUDE_VERBOSE) ? new CutStub($c->getTimeZone()) : $c->getTimeZone(),
|
||||
);
|
||||
];
|
||||
|
||||
return self::castError($c, $a);
|
||||
}
|
||||
|
||||
public static function castIntlDateFormatter(\IntlDateFormatter $c, array $a, Stub $stub, $isNested, $filter = 0)
|
||||
{
|
||||
$a += array(
|
||||
$a += [
|
||||
Caster::PREFIX_VIRTUAL.'locale' => $c->getLocale(),
|
||||
Caster::PREFIX_VIRTUAL.'pattern' => $c->getPattern(),
|
||||
Caster::PREFIX_VIRTUAL.'calendar' => $c->getCalendar(),
|
||||
@@ -152,7 +153,7 @@ class IntlCaster
|
||||
Caster::PREFIX_VIRTUAL.'date_type' => $c->getDateType(),
|
||||
Caster::PREFIX_VIRTUAL.'calendar_object' => ($filter & Caster::EXCLUDE_VERBOSE) ? new CutStub($c->getCalendarObject()) : $c->getCalendarObject(),
|
||||
Caster::PREFIX_VIRTUAL.'time_zone' => ($filter & Caster::EXCLUDE_VERBOSE) ? new CutStub($c->getTimeZone()) : $c->getTimeZone(),
|
||||
);
|
||||
];
|
||||
|
||||
return self::castError($c, $a);
|
||||
}
|
||||
@@ -160,10 +161,10 @@ class IntlCaster
|
||||
private static function castError($c, array $a): array
|
||||
{
|
||||
if ($errorCode = $c->getErrorCode()) {
|
||||
$a += array(
|
||||
$a += [
|
||||
Caster::PREFIX_VIRTUAL.'error_code' => $errorCode,
|
||||
Caster::PREFIX_VIRTUAL.'error_message' => $c->getErrorMessage(),
|
||||
);
|
||||
];
|
||||
}
|
||||
|
||||
return $a;
|
||||
|
Reference in New Issue
Block a user