Skip to content

Commit

Permalink
chore: use laravel_version_compare()
Browse files Browse the repository at this point in the history
  • Loading branch information
calebdw committed Feb 6, 2025
1 parent 48b8faf commit 2702c3f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/Type/GeneralTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

use PHPStan\Testing\TypeInferenceTestCase;

use function version_compare;
use function Orchestra\Testbench\laravel_version_compare;

class GeneralTypeTest extends TypeInferenceTestCase
{
Expand Down Expand Up @@ -76,16 +76,16 @@ public static function dataFileAsserts(): iterable
yield from self::gatherAssertTypes(__DIR__ . '/data/view.php');
yield from self::gatherAssertTypes(__DIR__ . '/data/where-relation.php');

if (version_compare(LARAVEL_VERSION, '11.28.0', '>=')) {
if (laravel_version_compare('11.28.0', '>=')) {
yield from self::gatherAssertTypes(__DIR__ . '/data/model-collections-l11-28.php');
}

// 11.100 is an artificial constraint until 12.0.0 is released
if (version_compare(LARAVEL_VERSION, '11.0.0', '>=') && version_compare(LARAVEL_VERSION, '11.100.0', '<')) {
if (laravel_version_compare('11.0.0', '>=') && laravel_version_compare('11.100.0', '<')) {
yield from self::gatherAssertTypes(__DIR__ . '/data/collection-generic-static-methods-l11.php');
}

if (version_compare(LARAVEL_VERSION, '12.0.0', '>=') || LARAVEL_VERSION === '12.x-dev') {
if (laravel_version_compare('12.0.0', '>=') || LARAVEL_VERSION === '12.x-dev') {
yield from self::gatherAssertTypes(__DIR__ . '/data/collection-generic-static-methods-l12.php');
}

Expand Down

0 comments on commit 2702c3f

Please sign in to comment.