diff --git a/.claude/settings.local.json b/.claude/settings.local.json new file mode 100644 index 0000000..be92fd4 --- /dev/null +++ b/.claude/settings.local.json @@ -0,0 +1,11 @@ +{ + "permissions": { + "allow": [ + "Bash(./vendor/bin/phpunit --migrate-configuration)", + "Bash(composer update:*)", + "Bash(./vendor/bin/phpunit)", + "Bash(./vendor/bin/phpunit --display-all-issues)" + ] + }, + "enableAllProjectMcpServers": false +} \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c4a98d3..4ba6467 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,8 +2,6 @@ name: Run tests on: push: - schedule: - - cron: '0 0 * * *' jobs: test: @@ -12,12 +10,14 @@ jobs: strategy: fail-fast: false matrix: - php: [8.1, 8.2, 8.3] - laravel: [10.*, 11.*] + php: [8.1, 8.2, 8.3, 8.4] + laravel: [10.*, 11.*, 12.*] dependency-version: [prefer-lowest, prefer-stable] exclude: - php: 8.1 laravel: 11.* + - php: 8.1 + laravel: 12.* name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} diff --git a/.gitignore b/.gitignore index 506b9d0..feffafe 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,5 @@ composer.phar composer.lock vendor .php_cs.cache -.phpunit.result.cache \ No newline at end of file +.phpunit.result.cache +.phpunit.cache \ No newline at end of file diff --git a/composer.json b/composer.json index c3d10f2..741947e 100644 --- a/composer.json +++ b/composer.json @@ -8,11 +8,11 @@ }, "require": { "php": "^8.1", - "illuminate/support": "^10.0|^11.0", - "nesbot/carbon": "^2.0" + "illuminate/support": "^10.0|^11.0|^12.0", + "nesbot/carbon": "^2.0|^3.0" }, "require-dev": { - "phpunit/phpunit": "^9.5" + "phpunit/phpunit": "^10.5|^11.0" }, "config": { "optimize-autoloader": true, diff --git a/phpunit.xml b/phpunit.xml index 8a5d0ec..a851a39 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,24 +1,16 @@ - - - - ./tests/ - - - - - src/ - - - - - + + + + ./tests/ + + + + + + + + src/ + + diff --git a/src/Duration/Duration.php b/src/Duration/Duration.php index 4492deb..4619f1c 100644 --- a/src/Duration/Duration.php +++ b/src/Duration/Duration.php @@ -37,7 +37,7 @@ class Duration implements Arrayable, JsonSerializable /** * Duration constructor. * - * @param $seconds + * @param $seconds */ public function __construct($seconds = 0) { @@ -77,7 +77,7 @@ public function getSeconds() } /** - * @param $format + * @param $format * @return $this */ public function setFormat($format) @@ -124,7 +124,7 @@ public static function fromArray($exported) /** * @return array */ - public function jsonSerialize() + public function jsonSerialize(): mixed { return $this->toArray(); } diff --git a/src/Duration/DurationFormatter.php b/src/Duration/DurationFormatter.php index b707fd4..61d3cec 100644 --- a/src/Duration/DurationFormatter.php +++ b/src/Duration/DurationFormatter.php @@ -32,7 +32,7 @@ public function __construct(Duration $duration) } /** - * @param $format + * @param $format * @return mixed */ public function get($format) @@ -66,7 +66,7 @@ public function get($format) /** * @param Collection $units - * @param $format + * @param $format * @return mixed */ protected function applyFormat(Collection $units, $format) diff --git a/src/Duration/DurationOperations.php b/src/Duration/DurationOperations.php index bc3bd68..30f2482 100644 --- a/src/Duration/DurationOperations.php +++ b/src/Duration/DurationOperations.php @@ -25,7 +25,7 @@ public function subtract(Duration $duration) /** * Retrieve the sum of an array. * - * @param $items + * @param $items * @param null $callback * @return Duration * diff --git a/src/Period/Period.php b/src/Period/Period.php index 27bab07..1ea3598 100644 --- a/src/Period/Period.php +++ b/src/Period/Period.php @@ -24,8 +24,8 @@ class Period implements Arrayable, JsonSerializable /** * TimeSpan constructor. * - * @param $start - * @param $end + * @param $start + * @param $end */ public function __construct($start = null, $end = null) { @@ -51,7 +51,7 @@ public static function fromArray(array $exported) /** * @return array */ - public function jsonSerialize() + public function jsonSerialize(): mixed { return $this->toArray(); } @@ -114,7 +114,7 @@ public function latest(Carbon $time) // _________________________________________________________________________________________________________________ /** - * @param $time + * @param $time * @return Carbon|null */ protected function normalizeInput($time) @@ -130,7 +130,7 @@ protected function normalizeInput($time) } /** - * @param $time + * @param $time * @return Carbon|null */ protected function normalizeOutput($time) diff --git a/src/Shared/RetrievesValues.php b/src/Shared/RetrievesValues.php index 50d214c..6c80b69 100644 --- a/src/Shared/RetrievesValues.php +++ b/src/Shared/RetrievesValues.php @@ -7,7 +7,7 @@ trait RetrievesValues /** * Returns a closure function to retrieve a value from an $item parameter. * - * @param $callback + * @param $callback * @return \Closure */ private static function valueRetriever($callback) diff --git a/src/Shared/ValidatesArrays.php b/src/Shared/ValidatesArrays.php index 96acfad..8a2be4b 100644 --- a/src/Shared/ValidatesArrays.php +++ b/src/Shared/ValidatesArrays.php @@ -5,8 +5,8 @@ trait ValidatesArrays { /** - * @param $keys - * @param $array + * @param $keys + * @param $array * * @throws MissingPropertiesException */ diff --git a/src/Whitelist/Whitelist.php b/src/Whitelist/Whitelist.php index 77e69e4..920f9ed 100644 --- a/src/Whitelist/Whitelist.php +++ b/src/Whitelist/Whitelist.php @@ -17,14 +17,14 @@ abstract class Whitelist protected $value; /** - * @param $value + * @param $value */ public function __construct($value) { if (! static::isValid($value)) { throw new static::$exceptionClass('Invalid value '.$value); } - $this->status = $value; + $this->value = $value; } /** @@ -40,11 +40,11 @@ public function __toString() */ public function get() { - return $this->status; + return $this->value; } /** - * @param $value + * @param $value * @return bool */ public static function isValid($value)