Skip to content

Commit 3d50c41

Browse files
committed
release PHP 7.2 downgraded 0.21.0
1 parent ba22ffb commit 3d50c41

File tree

276 files changed

+702
-6272
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

276 files changed

+702
-6272
lines changed

.github/workflows/code_analysis.yaml

Lines changed: 0 additions & 18 deletions
This file was deleted.

.github/workflows/downgraded_release.yaml

Lines changed: 0 additions & 52 deletions
This file was deleted.

.github/workflows/tests.yaml

Lines changed: 0 additions & 28 deletions
This file was deleted.

build/composer-php-72.json

Lines changed: 0 additions & 19 deletions
This file was deleted.

build/rector-downgrade-php-72.php

Lines changed: 0 additions & 10 deletions
This file was deleted.

composer.json

Lines changed: 2 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -4,49 +4,16 @@
44
"license": "MIT",
55
"description": "Rector upgrades rules for Laravel Framework",
66
"require": {
7-
"php": ">=8.1",
8-
"rector/rector": "^0.15.12"
9-
},
10-
"require-dev": {
11-
"phpunit/phpunit": "^10.0",
12-
"phpstan/phpstan": "^1.8.2",
13-
"symplify/phpstan-rules": "^11.0",
14-
"symplify/phpstan-extensions": "^11.0",
15-
"symplify/easy-coding-standard": "^11.0",
16-
"symplify/rule-doc-generator": "^11.0",
17-
"rector/phpstan-rules": "^0.6",
18-
"phpstan/extension-installer": "^1.1",
19-
"phpstan/phpstan-webmozart-assert": "^1.1",
20-
"phpstan/phpstan-strict-rules": "^1.2",
21-
"symplify/vendor-patches": "^11.0",
22-
"rector/rector-debugging": "dev-main"
7+
"php": "^7.2 || ^8.0"
238
},
249
"autoload": {
2510
"psr-4": {
2611
"RectorLaravel\\": "src"
2712
}
2813
},
2914
"autoload-dev": {
30-
"psr-4": {
31-
"RectorLaravel\\Tests\\": "tests"
32-
},
3315
"classmap": ["stubs"]
3416
},
35-
"scripts": {
36-
"phpstan": "vendor/bin/phpstan analyse --ansi --error-format symplify",
37-
"check-cs": "vendor/bin/ecs check --ansi",
38-
"fix-cs": "vendor/bin/ecs check --fix --ansi",
39-
"docs": [
40-
"vendor/bin/rule-doc-generator generate src --output-file docs/rector_rules_overview.md --ansi"
41-
]
42-
},
4317
"minimum-stability": "dev",
44-
"prefer-stable": true,
45-
"config": {
46-
"allow-plugins": {
47-
"cweagans/composer-patches": true,
48-
"rector/extension-installer": true,
49-
"phpstan/extension-installer": true
50-
}
51-
}
18+
"prefer-stable": true
5219
}

config/sets/laravel-array-str-functions-to-static-call.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,9 @@
6363
new FuncCallToStaticCall('studly_case', 'Illuminate\Support\Str', 'studly'),
6464
new FuncCallToStaticCall('title_case', 'Illuminate\Support\Str', 'title'),
6565
],
66-
fn ($function) => ! in_array($function->getOldFuncName(), $internalFunctions, true)
66+
function ($function) use ($internalFunctions) {
67+
return ! in_array($function->getOldFuncName(), $internalFunctions, true);
68+
}
6769
)
6870
);
6971
};

config/sets/laravel90.php

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -40,34 +40,28 @@
4040

4141
// https://github.com/laravel/framework/commit/e095ac0e928b5620f33c9b60816fde5ece867d32
4242
$rectorConfig
43-
->ruleWithConfiguration(ArgumentAdderRector::class, [new ArgumentAdder(
44-
'Illuminate\Database\Eloquent\Model',
45-
'touch',
46-
0,
47-
'attribute',
48-
),
49-
]);
43+
->ruleWithConfiguration(
44+
ArgumentAdderRector::class,
45+
[new ArgumentAdder('Illuminate\Database\Eloquent\Model', 'touch', 0, 'attribute'),
46+
]
47+
);
5048

5149
// https://github.com/laravel/framework/commit/6daecf43dd931dc503e410645ff4a7d611e3371f
5250
$rectorConfig
53-
->ruleWithConfiguration(ArgumentAdderRector::class, [new ArgumentAdder(
54-
'Illuminate\Queue\Failed\FailedJobProviderInterface',
55-
'flush',
56-
0,
57-
'hours',
58-
),
59-
]);
51+
->ruleWithConfiguration(
52+
ArgumentAdderRector::class,
53+
[new ArgumentAdder('Illuminate\Queue\Failed\FailedJobProviderInterface', 'flush', 0, 'hours'),
54+
]
55+
);
6056

6157
// https://github.com/laravel/framework/commit/8b40e8b7cba2fbf8337dfc05e3c6a62ae457e889
6258
$rectorConfig
63-
->ruleWithConfiguration(ArgumentAdderRector::class, [new ArgumentAdder(
64-
'Illuminate\Foundation\Http\FormRequest',
65-
'validated',
66-
0,
67-
'key',
68-
),
59+
->ruleWithConfiguration(
60+
ArgumentAdderRector::class,
61+
[new ArgumentAdder('Illuminate\Foundation\Http\FormRequest', 'validated', 0, 'key'),
6962
new ArgumentAdder('Illuminate\Foundation\Http\FormRequest', 'validated', 1, 'default'),
70-
]);
63+
]
64+
);
7165

7266
// https://github.com/laravel/framework/commit/84c78b9f5f3dad58f92161069e6482f7267ffdb6
7367
$rectorConfig

easy-ci.php

Lines changed: 0 additions & 13 deletions
This file was deleted.

ecs.php

Lines changed: 0 additions & 19 deletions
This file was deleted.

phpstan.neon

Lines changed: 0 additions & 29 deletions
This file was deleted.

phpunit.xml

Lines changed: 0 additions & 15 deletions
This file was deleted.

src/NodeAnalyzer/LumenRouteRegisteringMethodAnalyzer.php

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,32 +4,48 @@
44

55
namespace RectorLaravel\NodeAnalyzer;
66

7-
use PhpParser\Node\Expr;
87
use PhpParser\Node\Expr\MethodCall;
9-
use PhpParser\Node\Identifier;
108
use PHPStan\Type\ObjectType;
119
use Rector\NodeNameResolver\NodeNameResolver;
1210
use Rector\NodeTypeResolver\NodeTypeResolver;
1311

1412
final class LumenRouteRegisteringMethodAnalyzer
1513
{
16-
public function __construct(
17-
private readonly NodeTypeResolver $nodeTypeResolver,
18-
private readonly NodeNameResolver $nodeNameResolver
19-
) {
14+
/**
15+
* @readonly
16+
* @var \Rector\NodeTypeResolver\NodeTypeResolver
17+
*/
18+
private $nodeTypeResolver;
19+
20+
/**
21+
* @readonly
22+
* @var \Rector\NodeNameResolver\NodeNameResolver
23+
*/
24+
private $nodeNameResolver;
25+
26+
public function __construct(NodeTypeResolver $nodeTypeResolver, NodeNameResolver $nodeNameResolver)
27+
{
28+
$this->nodeTypeResolver = $nodeTypeResolver;
29+
$this->nodeNameResolver = $nodeNameResolver;
2030
}
2131

2232
public function isLumenRoutingClass(MethodCall $methodCall): bool
2333
{
2434
return $this->nodeTypeResolver->isObjectType($methodCall->var, new ObjectType('Laravel\Lumen\Routing\Router'));
2535
}
2636

27-
public function isRoutesRegisterGroup(Identifier|Expr $name): bool
37+
/**
38+
* @param \PhpParser\Node\Identifier|\PhpParser\Node\Expr $name
39+
*/
40+
public function isRoutesRegisterGroup($name): bool
2841
{
2942
return $this->nodeNameResolver->isName($name, 'group');
3043
}
3144

32-
public function isRoutesRegisterRoute(Identifier|Expr $name): bool
45+
/**
46+
* @param \PhpParser\Node\Identifier|\PhpParser\Node\Expr $name
47+
*/
48+
public function isRoutesRegisterRoute($name): bool
3349
{
3450
return $this->nodeNameResolver->isNames($name, ['delete', 'get', 'options', 'patch', 'post', 'put']);
3551
}

0 commit comments

Comments
 (0)