Skip to content

Commit

Permalink
Merge pull request #35 from laravel-shift/l10-compatibility
Browse files Browse the repository at this point in the history
Laravel 10.x Compatibility
  • Loading branch information
Dartui authored Jun 12, 2023
2 parents b0af084 + ad0ee7c commit 3b8f502
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ jobs:
strategy:
matrix:
php-version:
- "8.0"
- "8.1"
- "8.2"
operating-system:
- ubuntu-latest
- windows-latest
Expand Down
20 changes: 10 additions & 10 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@
}
],
"require": {
"php": "^8.0.3",
"illuminate/database": "^9.0",
"illuminate/support": "^9.0",
"jgrossi/corcel": "^6.0",
"nesbot/carbon": "^2.53.1"
"php": "^8.1",
"illuminate/database": "^10.0",
"illuminate/support": "^10.0",
"jgrossi/corcel": "^7.0",
"nesbot/carbon": "^2.66"
},
"require-dev": {
"orchestra/testbench": "^7.0",
"phpstan/phpstan": "^1.0",
"phpunit/phpunit": "^9.4",
"nunomaduro/larastan": "^2.0",
"laravel/pint": "^0.2.0"
"orchestra/testbench": "^8.0",
"phpstan/phpstan": "^1.9",
"phpunit/phpunit": "^9.5.10",
"nunomaduro/larastan": "^2.4",
"laravel/pint": "^1.4"
},
"autoload": {
"psr-4": {
Expand Down
5 changes: 1 addition & 4 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,4 @@ parameters:
ignoreErrors:
-
message: '#Access to an undefined property Faker\\Generator::\$[a-zA-Z]+?\.#'
path: tests/*
-
message: '#Call to private method whereIn\(\) of parent class Illuminate\\Database\\Eloquent\\Builder<Illuminate\\Database\\Eloquent\\Model>.#'
path: src/Model/Product.php
path: tests/*
2 changes: 2 additions & 0 deletions src/Model/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@ protected function getCrosssellsAttribute(): Collection
return static::newCollection();
}

/** @var Collection<int, Product> */
return static::query()->whereIn('ID', $crosssells)->get();
}

Expand All @@ -346,6 +347,7 @@ public function getUpsellsAttribute(): Collection
return static::newCollection();
}

/** @var Collection<int, Product> */
return static::query()->whereIn('ID', $upsells)->get();
}

Expand Down
8 changes: 4 additions & 4 deletions tests/Unit/Model/OrderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public function testDateCompletedProperty(): void
$order->createMeta('_date_completed', 1577836800); // '2020-01-01 00:00:00'

$this->assertInstanceOf(Carbon::class, $order->date_completed);
$this->assertSame('2020-01-01 00:00:00', $order->date_completed->format('Y-m-d H:i:s')); // @phpstan-ignore-line
$this->assertSame('2020-01-01 00:00:00', $order->date_completed->format('Y-m-d H:i:s'));
}

public function testDatePaidProperty(): void
Expand All @@ -79,7 +79,7 @@ public function testDatePaidProperty(): void
$order->createMeta('_date_paid', 1577840400); // '2020-01-01 01:00:00'

$this->assertInstanceOf(Carbon::class, $order->date_paid);
$this->assertSame('2020-01-01 01:00:00', $order->date_paid->format('Y-m-d H:i:s')); // @phpstan-ignore-line
$this->assertSame('2020-01-01 01:00:00', $order->date_paid->format('Y-m-d H:i:s'));
}

public function testDeprecatedDateFormats(): void
Expand All @@ -89,10 +89,10 @@ public function testDeprecatedDateFormats(): void
$order->createMeta('_paid_date', '2020-01-01 01:00:00');

$this->assertInstanceOf(Carbon::class, $order->date_completed);
$this->assertSame('2020-01-01 00:00:00', $order->date_completed->format('Y-m-d H:i:s')); // @phpstan-ignore-line
$this->assertSame('2020-01-01 00:00:00', $order->date_completed->format('Y-m-d H:i:s'));

$this->assertInstanceOf(Carbon::class, $order->date_paid);
$this->assertSame('2020-01-01 01:00:00', $order->date_paid->format('Y-m-d H:i:s')); // @phpstan-ignore-line
$this->assertSame('2020-01-01 01:00:00', $order->date_paid->format('Y-m-d H:i:s'));
}

public function testPaymentProperty(): void
Expand Down

0 comments on commit 3b8f502

Please sign in to comment.