8000 [VarDumper] inline exclude verbose casting · symfony/symfony@f004d68 · GitHub
[go: up one dir, main page]

Skip to content

Commit f004d68

Browse files
committed
[VarDumper] inline exclude verbose casting
1 parent 24b69b3 commit f004d68

File tree

1 file changed

+3
-21
lines changed

1 file changed

+3
-21
lines changed

src/Symfony/Component/VarDumper/Caster/IntlCaster.php

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -135,16 +135,7 @@ public static function castIntlCalendar(\IntlCalendar $c, array $a, Stub $stub,
135135
Caster::PREFIX_VIRTUAL.'type' => $c->getType(),
136136
Caster::PREFIX_VIRTUAL.'in_daylight_time' => $c->inDaylightTime(),
137137
Caster::PREFIX_VIRTUAL.'is_lenient' => $c->isLenient(),
138-
);
139-
140-
if ($filter & Caster::EXCLUDE_VERBOSE) {
141-
++$stub->cut;
142-
143-
return self::castError($c, $a);
144-
}
145-
146-
$a += array(
147-
Caster::PREFIX_VIRTUAL.'time_zone' => $c->getTimeZone(),
138+
Caster::PREFIX_VIRTUAL.'time_zone' => ($filter & Caster::EXCLUDE_VERBOSE) ? new CutStub($c->getTimeZone()) : $c->getTimeZone()
148139
);
149140

150141
return self::castError($c, $a);
@@ -159,17 +150,8 @@ public s A7A3 tatic function castIntlDateFormatter(\IntlDateFormatter $c, array $a, St
159150
Caster::PREFIX_VIRTUAL.'time_zone_id' => $c->getTimeZoneId(),
160151
Caster::PREFIX_VIRTUAL.'time_type' => $c->getTimeType(),
161152
Caster::PREFIX_VIRTUAL.'date_type' => $c->getDateType(),
162-
);
163-
164-
if ($filter & Caster::EXCLUDE_VERBOSE) {
165-
$stub->cut += 2;
166-
167-
return self::castError($c, $a);
168-
}
169-
170-
$a += array(
171-
Caster::PREFIX_VIRTUAL.'calendar_object' => $c->getCalendarObject(),
172-
Caster::PREFIX_VIRTUAL.'time_zone' => $c->getTimeZone(),
153+
Caster::PREFIX_VIRTUAL.'calendar_object' => ($filter & Caster::EXCLUDE_VERBOSE) ? new CutStub($c->getCalendarObject()) : $c->getCalendarObject(),
154+
Caster::PREFIX_VIRTUAL.'time_zone' => ($filter & Caster::EXCLUDE_VERBOSE) ? new CutStub($c->getTimeZone()) : $c->getTimeZone()
173155
);
174156

175157
return self::castError($c, $a);

0 commit comments

Comments
 (0)
0