Skip to content

Commit

Permalink
Fix: Reduce visibility
Browse files Browse the repository at this point in the history
  • Loading branch information
localheinz committed Sep 4, 2023
1 parent c77a91b commit e3469dc
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 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,22 @@ 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
private function setDefaultTimezone(string $timezone = null): void

Check failure on line 59 in src/Faker/Core/DateTime.php

View workflow job for this annotation

GitHub Actions / PHPStan (7.4)

Method Faker\Core\DateTime::setDefaultTimezone() is unused.
{
$this->defaultTimezone = $timezone;
}

protected function getDefaultTimezone(): ?string
private function getDefaultTimezone(): ?string

Check failure on line 64 in src/Faker/Core/DateTime.php

View workflow job for this annotation

GitHub Actions / PHPStan (7.4)

Method Faker\Core\DateTime::getDefaultTimezone() is unused.

Check failure on line 64 in src/Faker/Core/DateTime.php

View workflow job for this annotation

GitHub Actions / PHPStan (7.4)

Method Faker\Core\DateTime::getDefaultTimezone() never returns null so it can be removed from the return type.
{
return $this->defaultTimezone;
}

protected function resolveTimezone(?string $timezone): string
private function resolveTimezone(?string $timezone): string
{
if ($timezone !== null) {
return $timezone;
Expand All @@ -78,7 +78,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 e3469dc

Please sign in to comment.