Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Reduce visibility #714

Merged
merged 2 commits into from
Sep 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions roave-bc-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,11 @@ parameters:
- '#\[BC\] REMOVED: Class Faker\\Extension\\NotInContainerException has been deleted#'
- '#\[BC\] REMOVED: Method Faker\\Container\\Container\#getDefinitions\(\) was removed#'
- '#\[BC\] REMOVED: Method Faker\\Container\\ContainerInterface\#getDefinitions\(\) was removed#'
- '#\[BC\] REMOVED: Method Faker\\Core\\DateTime\#getDefaultTimezone\(\) was removed#'
- '#\[BC\] REMOVED: Method Faker\\Core\\DateTime\#getTimestamp\(\) was removed#'
- '#\[BC\] REMOVED: Method Faker\\Core\\DateTime\#getTimestampDateTime\(\) was removed#'
- '#\[BC\] REMOVED: Method Faker\\Core\\DateTime\#resolveTimezone\(\) was removed#'
- '#\[BC\] REMOVED: Method Faker\\Core\\DateTime\#setDefaultTimezone\(\) was removed#'
- '#\[BC\] REMOVED: Method Faker\\Core\\DateTime\#setTimezone\(\) was removed#'
- '#\[BC\] REMOVED: Method Faker\\Generator\#uuid3\(\) was removed#'
- '#\[BC\] REMOVED: Method Faker\\Generator\#uuid\(\) was removed#'
18 changes: 4 additions & 14 deletions src/Faker/Core/DateTime.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ final class DateTime implements DateTimeExtension, GeneratorAwareExtension
*
* @return false|int
*/
protected function getTimestamp($until = 'now')
private function getTimestamp($until = 'now')
{
if (is_numeric($until)) {
return (int) $until;
Expand All @@ -51,22 +51,12 @@ protected function getTimestamp($until = 'now')
*
* @param int $timestamp the UNIX / POSIX-compatible timestamp
*/
protected function getTimestampDateTime(int $timestamp): \DateTime
private function getTimestampDateTime(int $timestamp): \DateTime
{
return new \DateTime('@' . $timestamp);
}

protected function setDefaultTimezone(string $timezone = null): void
{
$this->defaultTimezone = $timezone;
}

protected function getDefaultTimezone(): ?string
{
return $this->defaultTimezone;
}

protected function resolveTimezone(?string $timezone): string
private function resolveTimezone(?string $timezone): string
{
if ($timezone !== null) {
return $timezone;
Expand All @@ -78,7 +68,7 @@ protected function resolveTimezone(?string $timezone): string
/**
* Internal method to set the timezone on a DateTime object.
*/
protected function setTimezone(\DateTime $dateTime, ?string $timezone): \DateTime
private function setTimezone(\DateTime $dateTime, ?string $timezone): \DateTime
{
$timezone = $this->resolveTimezone($timezone);

Expand Down
Loading