Skip to content

Conversation

@xiCO2k
Copy link

@xiCO2k xiCO2k commented Mar 2, 2023

This PR adds the capability to change the generalTimezones.

Before

$timezones = new Timezonelist();
$reflected = new \ReflectionClass($timezones);

// @phpstan-ignore-next-line
$property = tap($reflected->getProperty('generalTimezones'))
    ->setAccessible(true)
    ->setValue($timezones, ['UTC']);

return $reflected->getMethod('toArray')->invoke($timezones, false);

After

return Timezonelist::setGeneralTimezones(['UTC'])->toArray(false);

PS: Also found a typo on the facade docblock statis instead of static.

Cheers.

@xiCO2k
Copy link
Author

xiCO2k commented Mar 6, 2023

@JackieDo any chance to check this PR?

Thanks.

@xiCO2k xiCO2k closed this Apr 12, 2023
@xiCO2k xiCO2k reopened this Apr 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant