Skip to content

Commit

Permalink
Fix: Reduce visibility (#714)
Browse files Browse the repository at this point in the history
* Fix: Reduce visibility

* Fix: Remove unused methods
  • Loading branch information
localheinz committed Sep 4, 2023
1 parent 404d06b commit e0623f6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
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 @@ -30,7 +30,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 @@ -48,22 +48,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 @@ -75,7 +65,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

0 comments on commit e0623f6

Please sign in to comment.