Skip to content

Commit

Permalink
release PHP 7.2 downgraded 0.27.0
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Jan 3, 2024
1 parent 29ba121 commit 2a73790
Show file tree
Hide file tree
Showing 368 changed files with 846 additions and 8,324 deletions.
48 changes: 0 additions & 48 deletions .github/workflows/code_analysis.yaml

This file was deleted.

51 changes: 0 additions & 51 deletions .github/workflows/downgraded_release.yaml

This file was deleted.

28 changes: 0 additions & 28 deletions .github/workflows/tests.yaml

This file was deleted.

19 changes: 0 additions & 19 deletions build/composer-php-72.json

This file was deleted.

10 changes: 0 additions & 10 deletions build/rector-downgrade-php-72.php

This file was deleted.

39 changes: 2 additions & 37 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,51 +4,16 @@
"license": "MIT",
"description": "Rector upgrades rules for Laravel Framework",
"require": {
"php": ">=8.1",
"rector/rector": "^0.18.5"
},
"require-dev": {
"phpunit/phpunit": "^10.0",
"phpstan/phpstan": "^1.8.2",
"symplify/phpstan-rules": "^11.0",
"symplify/phpstan-extensions": "^11.0",
"symplify/rule-doc-generator": "^11.0",
"rector/phpstan-rules": "^0.6",
"phpstan/extension-installer": "^1.1",
"phpstan/phpstan-webmozart-assert": "^1.1",
"phpstan/phpstan-strict-rules": "^1.2",
"tightenco/duster": "^2.7"
"php": "^7.2 || ^8.0"
},
"autoload": {
"psr-4": {
"RectorLaravel\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"RectorLaravel\\Tests\\": "tests"
},
"classmap": ["stubs"]
},
"scripts": {
"phpstan": "vendor/bin/phpstan analyse --ansi --error-format symplify",
"check-cs": "vendor/bin/duster lint",
"fix-cs": "vendor/bin/duster fix",
"lint": "vendor/bin/duster lint",
"fix": "vendor/bin/duster fix",
"rector-dry-run": "vendor/bin/rector process --dry-run --ansi",
"rector": "vendor/bin/rector process --ansi",
"docs": [
"vendor/bin/rule-doc-generator generate src --output-file docs/rector_rules_overview.md --ansi"
]
},
"minimum-stability": "dev",
"prefer-stable": true,
"config": {
"allow-plugins": {
"rector/extension-installer": true,
"phpstan/extension-installer": true,
"cweagans/composer-patches": false
}
}
"prefer-stable": true
}
4 changes: 3 additions & 1 deletion config/sets/laravel-array-str-functions-to-static-call.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@
new FuncCallToStaticCall('studly_case', 'Illuminate\Support\Str', 'studly'),
new FuncCallToStaticCall('title_case', 'Illuminate\Support\Str', 'title'),
],
fn ($function) => ! in_array($function->getOldFuncName(), $internalFunctions, true)
function ($function) use ($internalFunctions) {
return ! in_array($function->getOldFuncName(), $internalFunctions, true);
}
)
);
};
14 changes: 2 additions & 12 deletions config/sets/laravel90.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,22 +41,12 @@

// https://github.com/laravel/framework/commit/e095ac0e928b5620f33c9b60816fde5ece867d32
$rectorConfig
->ruleWithConfiguration(ArgumentAdderRector::class, [new ArgumentAdder(
'Illuminate\Database\Eloquent\Model',
'touch',
0,
'attribute',
),
->ruleWithConfiguration(ArgumentAdderRector::class, [new ArgumentAdder('Illuminate\Database\Eloquent\Model', 'touch', 0, 'attribute'),
]);

// https://github.com/laravel/framework/commit/6daecf43dd931dc503e410645ff4a7d611e3371f
$rectorConfig
->ruleWithConfiguration(ArgumentAdderRector::class, [new ArgumentAdder(
'Illuminate\Queue\Failed\FailedJobProviderInterface',
'flush',
0,
'hours',
),
->ruleWithConfiguration(ArgumentAdderRector::class, [new ArgumentAdder('Illuminate\Queue\Failed\FailedJobProviderInterface', 'flush', 0, 'hours'),
]);

// https://github.com/laravel/framework/commit/84c78b9f5f3dad58f92161069e6482f7267ffdb6
Expand Down
29 changes: 0 additions & 29 deletions phpstan.neon

This file was deleted.

15 changes: 0 additions & 15 deletions phpunit.xml

This file was deleted.

30 changes: 23 additions & 7 deletions src/NodeAnalyzer/LumenRouteRegisteringMethodAnalyzer.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,41 @@
use Rector\NodeNameResolver\NodeNameResolver;
use Rector\NodeTypeResolver\NodeTypeResolver;

final readonly class LumenRouteRegisteringMethodAnalyzer
final class LumenRouteRegisteringMethodAnalyzer
{
public function __construct(
private NodeTypeResolver $nodeTypeResolver,
private NodeNameResolver $nodeNameResolver
) {
/**
* @readonly
* @var \Rector\NodeTypeResolver\NodeTypeResolver
*/
private $nodeTypeResolver;
/**
* @readonly
* @var \Rector\NodeNameResolver\NodeNameResolver
*/
private $nodeNameResolver;
public function __construct(NodeTypeResolver $nodeTypeResolver, NodeNameResolver $nodeNameResolver)
{
$this->nodeTypeResolver = $nodeTypeResolver;
$this->nodeNameResolver = $nodeNameResolver;
}

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

public function isRoutesRegisterGroup(Identifier|Expr $name): bool
/**
* @param \PhpParser\Node\Identifier|\PhpParser\Node\Expr $name
*/
public function isRoutesRegisterGroup($name): bool
{
return $this->nodeNameResolver->isName($name, 'group');
}

public function isRoutesRegisterRoute(Identifier|Expr $name): bool
/**
* @param \PhpParser\Node\Identifier|\PhpParser\Node\Expr $name
*/
public function isRoutesRegisterRoute($name): bool
{
return $this->nodeNameResolver->isNames($name, ['delete', 'get', 'options', 'patch', 'post', 'put']);
}
Expand Down
13 changes: 9 additions & 4 deletions src/NodeAnalyzer/StaticCallAnalyzer.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,16 @@
use PhpParser\Node\Expr\StaticCall;
use Rector\NodeNameResolver\NodeNameResolver;

final readonly class StaticCallAnalyzer
final class StaticCallAnalyzer
{
public function __construct(
private NodeNameResolver $nodeNameResolver
) {
/**
* @readonly
* @var \Rector\NodeNameResolver\NodeNameResolver
*/
private $nodeNameResolver;
public function __construct(NodeNameResolver $nodeNameResolver)
{
$this->nodeNameResolver = $nodeNameResolver;
}

public function isParentCallNamed(Node $node, string $desiredMethodName): bool
Expand Down
13 changes: 9 additions & 4 deletions src/NodeFactory/AppAssignFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,16 @@
use Rector\BetterPhpDocParser\ValueObject\Type\FullyQualifiedIdentifierTypeNode;
use RectorLaravel\ValueObject\ServiceNameTypeAndVariableName;

final readonly class AppAssignFactory
final class AppAssignFactory
{
public function __construct(
private PhpDocInfoFactory $phpDocInfoFactory
) {
/**
* @readonly
* @var \Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfoFactory
*/
private $phpDocInfoFactory;
public function __construct(PhpDocInfoFactory $phpDocInfoFactory)
{
$this->phpDocInfoFactory = $phpDocInfoFactory;
}

public function createAssignExpression(
Expand Down
Loading

0 comments on commit 2a73790

Please sign in to comment.