Skip to content

Commit 5c4bd33

Browse files
committed
feat: add additional methods to laravel-arrayaccess-to-method-call
This also adds the Cache contract to the list and cleans up the implementations---they are not needed since the contracts ar listed and they all implement the contracts.
1 parent 9a68b2a commit 5c4bd33

File tree

2 files changed

+12
-16
lines changed

2 files changed

+12
-16
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"description": "Rector upgrades rules for Laravel Framework",
66
"require": {
77
"php": ">=8.3",
8-
"rector/rector": "^2.0.0",
8+
"rector/rector": "^2.1.3",
99
"webmozart/assert": "^1.11",
1010
"symplify/rule-doc-generator-contracts": "^11.2"
1111
},

config/sets/laravel-arrayaccess-to-method-call.php

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,29 +13,25 @@
1313
->ruleWithConfiguration(
1414
ArrayDimFetchToMethodCallRector::class,
1515
[
16-
new ArrayDimFetchToMethodCall(
17-
new ObjectType('Illuminate\Foundation\Application'),
18-
'make',
19-
),
20-
new ArrayDimFetchToMethodCall(
21-
new ObjectType('Illuminate\Contracts\Foundation\Application'),
22-
'make',
23-
),
24-
new ArrayDimFetchToMethodCall(
25-
new ObjectType('Illuminate\Config\Repository'),
26-
'get',
27-
),
2816
new ArrayDimFetchToMethodCall(
2917
new ObjectType('Illuminate\Contracts\Config\Repository'),
30-
'make',
18+
'get',
19+
'set',
20+
'has',
21+
'set', // intentional
3122
),
3223
new ArrayDimFetchToMethodCall(
33-
new ObjectType('Illuminate\Contracts\Container\Container\Application'),
34-
'make',
24+
new ObjectType('Illuminate\Contracts\Cache\Repository'),
25+
'get',
26+
'set',
27+
'has',
28+
'forget',
3529
),
3630
new ArrayDimFetchToMethodCall(
3731
new ObjectType('Illuminate\Contracts\Container\Container'),
3832
'make',
33+
'bind',
34+
'bound',
3935
),
4036
],
4137
);

0 commit comments

Comments
 (0)