Skip to content

Commit

Permalink
Merge branch 'release/v0.2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
betterthanclay committed Sep 6, 2024
2 parents d61547b + 62445a0 commit 44fdb0e
Show file tree
Hide file tree
Showing 8 changed files with 254 additions and 73 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## v0.2.0 (2024-09-06)
* Switched DateTime to DateTimeInterface in Time extension
* Added @phpstan-require-implements constraints
* Added extension analysis tests
* Updated Veneer dependency and Stub

## v0.1.5 (2024-07-17)
* Updated Veneer dependency
* Fixed PHPStan issues
Expand Down
9 changes: 7 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

"decodelabs/exceptional": "^0.4.3",
"decodelabs/glitch-support": "^0.4.3",
"decodelabs/veneer": "^0.11.1"
"decodelabs/veneer": "^0.11.6"
},
"require-dev": {
"decodelabs/phpstan-decodelabs": "^0.6.5"
Expand All @@ -29,7 +29,12 @@
},
"extra": {
"branch-alias": {
"dev-develop": "0.1.x-dev"
"dev-develop": "0.2.x-dev"
}
},
"config": {
"allow-plugins": {
"phpstan/extension-installer": true
}
}
}
1 change: 1 addition & 0 deletions src/Extension/NumberTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

/**
* @template TReturn
* @phpstan-require-implements Number
*/
trait NumberTrait
{
Expand Down
60 changes: 30 additions & 30 deletions src/Extension/Time.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
namespace DecodeLabs\Cosmos\Extension;

use DateInterval;
use DateTime;
use DateTimeInterface;
use DateTimeZone;
use DecodeLabs\Cosmos\Locale;
use Stringable;
Expand All @@ -26,7 +26,7 @@ interface Time
* @return ($date is null ? null : TReturn)
*/
public function format(
DateTime|DateInterval|string|Stringable|int|null $date,
DateTimeInterface|DateInterval|string|Stringable|int|null $date,
string $format,
DateTimeZone|string|Stringable|bool|null $timezone = true
): mixed;
Expand All @@ -37,7 +37,7 @@ public function format(
* @return ($date is null ? null : TReturn)
*/
public function formatDate(
DateTime|DateInterval|string|Stringable|int|null $date,
DateTimeInterface|DateInterval|string|Stringable|int|null $date,
string $format
): mixed;

Expand All @@ -47,7 +47,7 @@ public function formatDate(
* @return ($date is null ? null : TReturn)
*/
public function pattern(
DateTime|DateInterval|string|Stringable|int|null $date,
DateTimeInterface|DateInterval|string|Stringable|int|null $date,
string $pattern,
DateTimeZone|string|Stringable|bool|null $timezone = true,
string|Locale|null $locale = null
Expand All @@ -59,7 +59,7 @@ public function pattern(
* @return ($date is null ? null : TReturn)
*/
public function locale(
DateTime|DateInterval|string|Stringable|int|null $date,
DateTimeInterface|DateInterval|string|Stringable|int|null $date,
string|int|bool|null $dateSize = true,
string|int|bool|null $timeSize = true,
DateTimeZone|string|Stringable|bool|null $timezone = true,
Expand All @@ -72,7 +72,7 @@ public function locale(
* @return ($date is null ? null : TReturn)
*/
public function fullDateTime(
DateTime|DateInterval|string|Stringable|int|null $date,
DateTimeInterface|DateInterval|string|Stringable|int|null $date,
DateTimeZone|string|Stringable|bool|null $timezone = true,
string|Locale|null $locale = null
): mixed;
Expand All @@ -83,7 +83,7 @@ public function fullDateTime(
* @return ($date is null ? null : TReturn)
*/
public function fullDate(
DateTime|DateInterval|string|Stringable|int|null $date,
DateTimeInterface|DateInterval|string|Stringable|int|null $date,
DateTimeZone|string|Stringable|bool|null $timezone = true,
string|Locale|null $locale = null
): mixed;
Expand All @@ -94,7 +94,7 @@ public function fullDate(
* @return ($date is null ? null : TReturn)
*/
public function fullTime(
DateTime|DateInterval|string|Stringable|int|null $date,
DateTimeInterface|DateInterval|string|Stringable|int|null $date,
DateTimeZone|string|Stringable|bool|null $timezone = true,
string|Locale|null $locale = null
): mixed;
Expand All @@ -106,7 +106,7 @@ public function fullTime(
* @return ($date is null ? null : TReturn)
*/
public function longDateTime(
DateTime|DateInterval|string|Stringable|int|null $date,
DateTimeInterface|DateInterval|string|Stringable|int|null $date,
DateTimeZone|string|Stringable|bool|null $timezone = true,
string|Locale|null $locale = null
): mixed;
Expand All @@ -117,7 +117,7 @@ public function longDateTime(
* @return ($date is null ? null : TReturn)
*/
public function longDate(
DateTime|DateInterval|string|Stringable|int|null $date,
DateTimeInterface|DateInterval|string|Stringable|int|null $date,
DateTimeZone|string|Stringable|bool|null $timezone = true,
string|Locale|null $locale = null
): mixed;
Expand All @@ -128,7 +128,7 @@ public function longDate(
* @return ($date is null ? null : TReturn)
*/
public function longTime(
DateTime|DateInterval|string|Stringable|int|null $date,
DateTimeInterface|DateInterval|string|Stringable|int|null $date,
DateTimeZone|string|Stringable|bool|null $timezone = true,
string|Locale|null $locale = null
): mixed;
Expand All @@ -140,7 +140,7 @@ public function longTime(
* @return ($date is null ? null : TReturn)
*/
public function mediumDateTime(
DateTime|DateInterval|string|Stringable|int|null $date,
DateTimeInterface|DateInterval|string|Stringable|int|null $date,
DateTimeZone|string|Stringable|bool|null $timezone = true,
string|Locale|null $locale = null
): mixed;
Expand All @@ -151,7 +151,7 @@ public function mediumDateTime(
* @return ($date is null ? null : TReturn)
*/
public function mediumDate(
DateTime|DateInterval|string|Stringable|int|null $date,
DateTimeInterface|DateInterval|string|Stringable|int|null $date,
DateTimeZone|string|Stringable|bool|null $timezone = true,
string|Locale|null $locale = null
): mixed;
Expand All @@ -162,7 +162,7 @@ public function mediumDate(
* @return ($date is null ? null : TReturn)
*/
public function mediumTime(
DateTime|DateInterval|string|Stringable|int|null $date,
DateTimeInterface|DateInterval|string|Stringable|int|null $date,
DateTimeZone|string|Stringable|bool|null $timezone = true,
string|Locale|null $locale = null
): mixed;
Expand All @@ -174,7 +174,7 @@ public function mediumTime(
* @return ($date is null ? null : TReturn)
*/
public function shortDateTime(
DateTime|DateInterval|string|Stringable|int|null $date,
DateTimeInterface|DateInterval|string|Stringable|int|null $date,
DateTimeZone|string|Stringable|bool|null $timezone = true,
string|Locale|null $locale = null
): mixed;
Expand All @@ -185,7 +185,7 @@ public function shortDateTime(
* @return ($date is null ? null : TReturn)
*/
public function shortDate(
DateTime|DateInterval|string|Stringable|int|null $date,
DateTimeInterface|DateInterval|string|Stringable|int|null $date,
DateTimeZone|string|Stringable|bool|null $timezone = true,
string|Locale|null $locale = null
): mixed;
Expand All @@ -196,7 +196,7 @@ public function shortDate(
* @return ($date is null ? null : TReturn)
*/
public function shortTime(
DateTime|DateInterval|string|Stringable|int|null $date,
DateTimeInterface|DateInterval|string|Stringable|int|null $date,
DateTimeZone|string|Stringable|bool|null $timezone = true,
string|Locale|null $locale = null
): mixed;
Expand All @@ -210,7 +210,7 @@ public function shortTime(
* @return ($date is null ? null : TReturn)
*/
public function dateTime(
DateTime|DateInterval|string|Stringable|int|null $date,
DateTimeInterface|DateInterval|string|Stringable|int|null $date,
DateTimeZone|string|Stringable|bool|null $timezone = true,
string|Locale|null $locale = null
): mixed;
Expand All @@ -221,7 +221,7 @@ public function dateTime(
* @return ($date is null ? null : TReturn)
*/
public function date(
DateTime|DateInterval|string|Stringable|int|null $date,
DateTimeInterface|DateInterval|string|Stringable|int|null $date,
DateTimeZone|string|Stringable|bool|null $timezone = true,
string|Locale|null $locale = null
): mixed;
Expand All @@ -232,7 +232,7 @@ public function date(
* @return ($date is null ? null : TReturn)
*/
public function time(
DateTime|DateInterval|string|Stringable|int|null $date,
DateTimeInterface|DateInterval|string|Stringable|int|null $date,
DateTimeZone|string|Stringable|bool|null $timezone = true,
string|Locale|null $locale = null
): mixed;
Expand All @@ -246,7 +246,7 @@ public function time(
* @return ($date is null ? null : TReturn)
*/
public function since(
DateTime|DateInterval|string|Stringable|int|null $date,
DateTimeInterface|DateInterval|string|Stringable|int|null $date,
?bool $positive = null,
?int $parts = 1,
string|Locale|null $locale = null
Expand All @@ -258,7 +258,7 @@ public function since(
* @return ($date is null ? null : TReturn)
*/
public function sinceAbs(
DateTime|DateInterval|string|Stringable|int|null $date,
DateTimeInterface|DateInterval|string|Stringable|int|null $date,
?bool $positive = null,
?int $parts = 1,
string|Locale|null $locale = null
Expand All @@ -270,7 +270,7 @@ public function sinceAbs(
* @return ($date is null ? null : TReturn)
*/
public function sinceAbbr(
DateTime|DateInterval|string|Stringable|int|null $date,
DateTimeInterface|DateInterval|string|Stringable|int|null $date,
?bool $positive = null,
?int $parts = 1,
string|Locale|null $locale = null
Expand All @@ -282,7 +282,7 @@ public function sinceAbbr(
* @return ($date is null ? null : TReturn)
*/
public function until(
DateTime|DateInterval|string|Stringable|int|null $date,
DateTimeInterface|DateInterval|string|Stringable|int|null $date,
?bool $positive = null,
?int $parts = 1,
string|Locale|null $locale = null
Expand All @@ -294,7 +294,7 @@ public function until(
* @return ($date is null ? null : TReturn)
*/
public function untilAbs(
DateTime|DateInterval|string|Stringable|int|null $date,
DateTimeInterface|DateInterval|string|Stringable|int|null $date,
?bool $positive = null,
?int $parts = 1,
string|Locale|null $locale = null
Expand All @@ -306,7 +306,7 @@ public function untilAbs(
* @return ($date is null ? null : TReturn)
*/
public function untilAbbr(
DateTime|DateInterval|string|Stringable|int|null $date,
DateTimeInterface|DateInterval|string|Stringable|int|null $date,
?bool $positive = null,
?int $parts = 1,
string|Locale|null $locale = null
Expand All @@ -319,8 +319,8 @@ public function untilAbbr(
* @return ($date1 is null ? null : ($date2 is null ? null : TReturn))
*/
public function between(
DateTime|DateInterval|string|Stringable|int|null $date1,
DateTime|DateInterval|string|Stringable|int|null $date2,
DateTimeInterface|DateInterval|string|Stringable|int|null $date1,
DateTimeInterface|DateInterval|string|Stringable|int|null $date2,
?int $parts = 1,
string|Locale|null $locale = null
): mixed;
Expand All @@ -331,8 +331,8 @@ public function between(
* @return ($date1 is null ? null : ($date2 is null ? null : TReturn))
*/
public function betweenAbbr(
DateTime|DateInterval|string|Stringable|int|null $date1,
DateTime|DateInterval|string|Stringable|int|null $date2,
DateTimeInterface|DateInterval|string|Stringable|int|null $date1,
DateTimeInterface|DateInterval|string|Stringable|int|null $date2,
?int $parts = 1,
string|Locale|null $locale = null
): mixed;
Expand Down
Loading

0 comments on commit 44fdb0e

Please sign in to comment.