Skip to content

Commit

Permalink
release PHP 7.2 downgraded 0.26.2
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Oct 11, 2023
1 parent 3054e6e commit cf6d0a7
Show file tree
Hide file tree
Showing 344 changed files with 927 additions and 7,634 deletions.
18 changes: 0 additions & 18 deletions .github/workflows/code_analysis.yaml

This file was deleted.

52 changes: 0 additions & 52 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.

37 changes: 2 additions & 35 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,49 +4,16 @@
"license": "MIT",
"description": "Rector upgrades rules for Laravel Framework",
"require": {
"php": ">=8.1",
"rector/rector": "^0.18.0"
},
"require-dev": {
"phpunit/phpunit": "^10.0",
"phpstan/phpstan": "^1.8.2",
"symplify/phpstan-rules": "^11.0",
"symplify/phpstan-extensions": "^11.0",
"symplify/easy-coding-standard": "^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",
"symplify/vendor-patches": "^11.0",
"rector/rector-debugging": "dev-main"
"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/ecs check --ansi",
"fix-cs": "vendor/bin/ecs check --fix --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": {
"cweagans/composer-patches": true,
"rector/extension-installer": true,
"phpstan/extension-installer": true
}
}
"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 @@ -63,7 +63,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);
}
)
);
};
24 changes: 10 additions & 14 deletions config/sets/laravel90.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,23 +41,19 @@

// 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
$rectorConfig
Expand Down
13 changes: 0 additions & 13 deletions easy-ci.php

This file was deleted.

19 changes: 0 additions & 19 deletions ecs.php

This file was deleted.

29 changes: 0 additions & 29 deletions phpstan.neon

This file was deleted.

15 changes: 0 additions & 15 deletions phpunit.xml

This file was deleted.

32 changes: 24 additions & 8 deletions src/NodeAnalyzer/LumenRouteRegisteringMethodAnalyzer.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,48 @@

namespace RectorLaravel\NodeAnalyzer;

use PhpParser\Node\Expr;
use PhpParser\Node\Expr\MethodCall;
use PhpParser\Node\Identifier;
use PHPStan\Type\ObjectType;
use Rector\NodeNameResolver\NodeNameResolver;
use Rector\NodeTypeResolver\NodeTypeResolver;

final class LumenRouteRegisteringMethodAnalyzer
{
public function __construct(
private readonly NodeTypeResolver $nodeTypeResolver,
private readonly 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
12 changes: 9 additions & 3 deletions src/NodeAnalyzer/StaticCallAnalyzer.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,15 @@

final class StaticCallAnalyzer
{
public function __construct(
private readonly 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
Loading

0 comments on commit cf6d0a7

Please sign in to comment.