Skip to content

Commit 5acdfca

Browse files
authored
Merge pull request #891 from bavix/driftingly-rector-laravel
[11.x] returned driftingly/rector-laravel
2 parents 16da9c8 + 347b8ee commit 5acdfca

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,12 @@
3333
},
3434
"require-dev": {
3535
"brianium/paratest": "^7.4",
36+
"driftingly/rector-laravel": "^1.0",
3637
"ergebnis/phpstan-rules": "^2.1",
3738
"infection/infection": "~0.27",
39+
"larastan/larastan": "^2.8",
3840
"laravel/cashier": "^15.0",
3941
"nunomaduro/collision": "^8.0",
40-
"larastan/larastan": "^2.8",
4142
"orchestra/testbench": "^9.0",
4243
"phpstan/phpstan": "^1.10",
4344
"phpunit/phpunit": "^10.5",

rector.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use Rector\Config\RectorConfig;
66
use Rector\PHPUnit\Set\PHPUnitSetList;
77
use Rector\Set\ValueObject\SetList;
8+
use RectorLaravel\Set\LaravelLevelSetList;
89

910
return static function (RectorConfig $config): void {
1011
$config->parallel();
@@ -15,6 +16,7 @@
1516

1617
// Define what rule sets will be applied
1718
$config->import(PHPUnitSetList::ANNOTATIONS_TO_ATTRIBUTES);
19+
$config->import(LaravelLevelSetList::UP_TO_LARAVEL_110);
1820
$config->import(PHPUnitSetList::PHPUNIT_100);
1921
$config->import(SetList::STRICT_BOOLEANS);
2022
$config->import(SetList::PRIVATIZATION);

tests/Infra/Models/ItemMultiPrice.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,6 @@ final class ItemMultiPrice extends Model implements ProductLimitedInterface
2929
*/
3030
protected $fillable = ['name', 'quantity', 'price', 'prices'];
3131

32-
protected $casts = [
33-
'prices' => 'array',
34-
];
35-
3632
public function getTable(): string
3733
{
3834
return 'items';
@@ -65,4 +61,11 @@ public function getMetaProduct(): ?array
6561
{
6662
return null;
6763
}
64+
65+
protected function casts(): array
66+
{
67+
return [
68+
'prices' => 'array',
69+
];
70+
}
6871
}

0 commit comments

Comments
 (0)