From 2735f604accf1a15c7588f59ebf5c5bf7d2fb63c Mon Sep 17 00:00:00 2001 From: Shift Date: Sat, 21 Feb 2026 03:39:03 +0000 Subject: [PATCH 1/3] Bump dependencies for Laravel 13 --- composer.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 1e9fc08..bfd865e 100755 --- a/composer.json +++ b/composer.json @@ -19,12 +19,12 @@ ], "require": { "php": "^8.0", - "illuminate/support": "^8.0|^9.0|^10.0|^11.0|^12.0", - "illuminate/validation": "^8.0|^9.0|^10.0|^11.0|^12.0", + "illuminate/support": "^8.0|^9.0|^10.0|^11.0|^12.0|^13.0", + "illuminate/validation": "^8.0|^9.0|^10.0|^11.0|^12.0|^13.0", "hekmatinasser/jalali": "^8.2.3" }, "require-dev": { - "orchestra/testbench": "^6.23|^7.0|^8.0" + "orchestra/testbench": "^6.23|^7.0|^8.0|^11.0" }, "autoload": { "psr-4": { From 30cd50e119256821fae70f0d5feb9ede3335dd14 Mon Sep 17 00:00:00 2001 From: Shift Date: Sat, 21 Feb 2026 03:39:03 +0000 Subject: [PATCH 2/3] Update GitHub Actions for Laravel 13 --- .github/workflows/run-tests.yml | 72 +++++++++++++++++++-------------- 1 file changed, 42 insertions(+), 30 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index b44dc00..88083b1 100755 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -1,49 +1,61 @@ name: run-tests -on: [push, pull_request] +on: + - push + - pull_request jobs: test: runs-on: ${{ matrix.os }} + strategy: fail-fast: true matrix: os: [ubuntu-latest] - php: [8.2, 8.1, 8.0] - laravel: [8.*,9.*,10.*] + php: [8.0, 8.1, 8.2, '8.3', '8.4', '8.5'] + laravel: ['8.*', '9.*', '10.*', '13.*'] dependency-version: [prefer-lowest, prefer-stable] include: - - laravel: 8.* - testbench: ^6.23 - - laravel: 9.* - testbench: 7.* - - laravel: 10.* - testbench: 8.* - + - laravel: 8.* + testbench: ^6.23 + - laravel: 9.* + testbench: 7.* + - laravel: 10.* + testbench: 8.* + - laravel: 13.* + testbench: ^11.0 exclude: - - laravel: 10.* - php: 8.0 + - laravel: 10.* + php: 8.0 + - laravel: 13.* + php: 8.0 + - laravel: 13.* + php: 8.1 + - laravel: 13.* + php: 8.2 name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} - ${{ matrix.os }} steps: - - name: Checkout code - uses: actions/checkout@v2 + - name: Checkout code + uses: actions/checkout@v2 - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick - coverage: none + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick + coverage: none - - name: Setup problem matchers - run: | - echo "::add-matcher::${{ runner.tool_cache }}/php.json" - echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" - - name: Install dependencies - run: | - composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update - composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction - - name: Execute tests - run: vendor/bin/phpunit + - name: Setup problem matchers + run: | + echo "::add-matcher::${{ runner.tool_cache }}/php.json" + echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" + + - name: Install dependencies + run: | + composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update + composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction + + - name: Execute tests + run: vendor/bin/phpunit From 78c22ec8f64e0a58d0ed81e3627e559ee66387d3 Mon Sep 17 00:00:00 2001 From: laravel-shift Date: Sat, 21 Feb 2026 03:39:18 +0000 Subject: [PATCH 3/3] Fix styling --- src/Laravel/JalaliValidator.php | 29 +++++++++++++++-------------- tests/ComparisonTest.php | 2 +- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/src/Laravel/JalaliValidator.php b/src/Laravel/JalaliValidator.php index 92ed578..50f5df9 100644 --- a/src/Laravel/JalaliValidator.php +++ b/src/Laravel/JalaliValidator.php @@ -16,7 +16,7 @@ class JalaliValidator */ public function validateDate($attribute, $value, $parameters) { - if (!is_string($value)) { + if (! is_string($value)) { return false; } $format = count($parameters) ? $parameters[0] : 'Y/m/d'; @@ -44,6 +44,7 @@ class JalaliValidator return true; } } + return false; } @@ -57,7 +58,7 @@ class JalaliValidator */ public function validateDateEqual($attribute, $value, $parameters) { - if (!is_string($value)) { + if (! is_string($value)) { return false; } $format = count($parameters) > 1 ? $parameters[1] : 'Y/m/d'; @@ -81,7 +82,7 @@ class JalaliValidator */ public function validateDateNotEqual($attribute, $value, $parameters) { - if (!is_string($value)) { + if (! is_string($value)) { return false; } $format = count($parameters) > 1 ? $parameters[1] : 'Y/m/d'; @@ -104,7 +105,7 @@ class JalaliValidator */ public function validateDateTime($attribute, $value, $parameters) { - if (!is_string($value)) { + if (! is_string($value)) { return false; } @@ -129,7 +130,7 @@ class JalaliValidator */ public function validateDateTimeEqual($attribute, $value, $parameters) { - if (!is_string($value)) { + if (! is_string($value)) { return false; } $format = count($parameters) > 1 ? $parameters[1] : 'Y/m/d H:i:s'; @@ -153,7 +154,7 @@ class JalaliValidator */ public function validateDateTimeNotEqual($attribute, $value, $parameters) { - if (!is_string($value)) { + if (! is_string($value)) { return false; } $format = count($parameters) > 1 ? $parameters[1] : 'Y/m/d H:i:s'; @@ -177,7 +178,7 @@ class JalaliValidator */ public function validateDateAfter($attribute, $value, $parameters) { - if (!is_string($value)) { + if (! is_string($value)) { return false; } $format = count($parameters) > 1 ? $parameters[1] : 'Y/m/d'; @@ -201,7 +202,7 @@ class JalaliValidator */ public function validateDateAfterEqual($attribute, $value, $parameters) { - if (!is_string($value)) { + if (! is_string($value)) { return false; } $format = count($parameters) > 1 ? $parameters[1] : 'Y/m/d'; @@ -225,7 +226,7 @@ class JalaliValidator */ public function validateDateTimeAfter($attribute, $value, $parameters) { - if (!is_string($value)) { + if (! is_string($value)) { return false; } $format = count($parameters) > 1 ? $parameters[1] : 'Y/m/d H:i:s'; @@ -249,7 +250,7 @@ class JalaliValidator */ public function validateDateTimeAfterEqual($attribute, $value, $parameters) { - if (!is_string($value)) { + if (! is_string($value)) { return false; } $format = count($parameters) > 1 ? $parameters[1] : 'Y/m/d H:i:s'; @@ -273,7 +274,7 @@ class JalaliValidator */ public function validateDateBefore($attribute, $value, $parameters) { - if (!is_string($value)) { + if (! is_string($value)) { return false; } $format = count($parameters) > 1 ? $parameters[1] : 'Y/m/d'; @@ -297,7 +298,7 @@ class JalaliValidator */ public function validateDateBeforeEqual($attribute, $value, $parameters) { - if (!is_string($value)) { + if (! is_string($value)) { return false; } $format = count($parameters) > 1 ? $parameters[1] : 'Y/m/d'; @@ -321,7 +322,7 @@ class JalaliValidator */ public function validateDateTimeBefore($attribute, $value, $parameters) { - if (!is_string($value)) { + if (! is_string($value)) { return false; } $format = count($parameters) > 1 ? $parameters[1] : 'Y/m/d H:i:s'; @@ -345,7 +346,7 @@ class JalaliValidator */ public function validateDateTimeBeforeEqual($attribute, $value, $parameters) { - if (!is_string($value)) { + if (! is_string($value)) { return false; } $format = count($parameters) > 1 ? $parameters[1] : 'Y/m/d H:i:s'; diff --git a/tests/ComparisonTest.php b/tests/ComparisonTest.php index 8c028aa..6064adf 100644 --- a/tests/ComparisonTest.php +++ b/tests/ComparisonTest.php @@ -272,7 +272,7 @@ class ComparisonTest extends TestCase $datetime = Jalali::parse('1397-10-10 21:30:50'); $target = Jalali::parse('1398-10-10 21:30:01'); -// Jalali::setTestNow('1397-10-10 21:30:50'); + // Jalali::setTestNow('1397-10-10 21:30:50'); $this->assertTrue($datetime->isWeekday()); $this->assertFalse($datetime->isWeekend());