useDaylightTime example

/** * @return array */
    public static function castIntlTimeZone(\IntlTimeZone $c, array $a, Stub $stub, bool $isNested)
    {
        $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 += [
                Caster::PREFIX_VIRTUAL.'dst_savings' => $c->getDSTSavings(),
            ];
        }

        return self::castError($c$a);
    }

    /** * @return array */
    
$expectedLocale = $var->getLocale();
        $expectedPattern = $var->getPattern();
        $expectedCalendar = $var->getCalendar();
        $expectedTimeZoneId = $var->getTimeZoneId();
        $expectedTimeType = $var->getTimeType();
        $expectedDateType = $var->getDateType();

        $expectedTimeZone = $var->getTimeZone();
        $expectedTimeZoneDisplayName = $expectedTimeZone->getDisplayName();
        $expectedTimeZoneID = $expectedTimeZone->getID();
        $expectedTimeZoneRawOffset = $expectedTimeZone->getRawOffset();
        $expectedTimeZoneDSTSavings = $expectedTimeZone->useDaylightTime() ? "\n dst_savings: ".$expectedTimeZone->getDSTSavings() : '';

        $expectedCalendarObject = $var->getCalendarObject();
        $expectedCalendarObjectType = $expectedCalendarObject->getType();
        $expectedCalendarObjectFirstDayOfWeek = $expectedCalendarObject->getFirstDayOfWeek();
        $expectedCalendarObjectMinimalDaysInFirstWeek = $expectedCalendarObject->getMinimalDaysInFirstWeek();
        $expectedCalendarObjectRepeatedWallTimeOption = $expectedCalendarObject->getRepeatedWallTimeOption();
        $expectedCalendarObjectSkippedWallTimeOption = $expectedCalendarObject->getSkippedWallTimeOption();
        $expectedCalendarObjectTime = $expectedCalendarObject->getTime().'.0';
        $expectedCalendarObjectInDaylightTime = $expectedCalendarObject->inDaylightTime() ? 'true' : 'false';
        $expectedCalendarObjectIsLenient = $expectedCalendarObject->isLenient() ? 'true' : 'false';

        
/** * @return array */
    public static function castIntlTimeZone(\IntlTimeZone $c, array $a, Stub $stub, bool $isNested)
    {
        $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 += [
                Caster::PREFIX_VIRTUAL.'dst_savings' => $c->getDSTSavings(),
            ];
        }

        return self::castError($c$a);
    }

    /** * @return array */
    
Home | Imprint | This part of the site doesn't use cookies.