Skip to content

Commit

Permalink
Constructor with only one promoted property should still be on its ow…
Browse files Browse the repository at this point in the history
…n line.
  • Loading branch information
gnutix committed Mar 24, 2024
1 parent 1c22628 commit 4910a69
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
5 changes: 3 additions & 2 deletions src/Clock/FixedClock.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ final class FixedClock implements Clock
/**
* @param Instant $instant The time to set the clock at.
*/
public function __construct(private Instant $instant)
{
public function __construct(
private Instant $instant
) {
}

public function getTime(): Instant
Expand Down
5 changes: 3 additions & 2 deletions src/TimeZoneOffset.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ final class TimeZoneOffset extends TimeZone
*
* @param int $totalSeconds The total offset in seconds, validated from -64800 to +64800.
*/
private function __construct(private readonly int $totalSeconds)
{
private function __construct(
private readonly int $totalSeconds
) {
}

/**
Expand Down
5 changes: 3 additions & 2 deletions src/TimeZoneRegion.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ final class TimeZoneRegion extends TimeZone
/**
* Private constructor. Use a factory method to obtain an instance.
*/
private function __construct(private readonly DateTimeZone $zone)
{
private function __construct(
private readonly DateTimeZone $zone
) {
}

/**
Expand Down
5 changes: 3 additions & 2 deletions src/Year.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ final class Year implements JsonSerializable, Stringable
/**
* @param int $year The year, validated.
*/
private function __construct(private readonly int $year)
{
private function __construct(
private readonly int $year
) {
}

/**
Expand Down

0 comments on commit 4910a69

Please sign in to comment.