Skip to content

Commit

Permalink
feat: Introduce DateIntervalInterface
Browse files Browse the repository at this point in the history
  • Loading branch information
pauci committed Jan 18, 2023
1 parent fe4c0ef commit 8c0f802
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/DateInterval.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Pauci\DateTime;

class DateInterval extends \DateInterval implements \JsonSerializable, \Stringable
class DateInterval extends \DateInterval implements DateIntervalInterface
{
/**
* @throws \Exception
Expand Down
10 changes: 10 additions & 0 deletions src/DateIntervalInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

declare(strict_types=1);

namespace Pauci\DateTime;

interface DateIntervalInterface extends \Stringable, \JsonSerializable
{
public function toString(): string;
}
2 changes: 0 additions & 2 deletions src/DateTimeInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

interface DateTimeInterface extends \DateTimeInterface, \Stringable, \JsonSerializable
{
public function diff(\DateTimeInterface $targetObject, bool $absolute = false): DateInterval;

public function equals(self $dateTime): bool;

public function inDefaultTimezone(): static;
Expand Down

0 comments on commit 8c0f802

Please sign in to comment.