Skip to content

Commit

Permalink
release PHP 7.2 downgraded 1.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed May 3, 2024
1 parent 415aa9a commit ac4831a
Show file tree
Hide file tree
Showing 465 changed files with 1,027 additions and 10,195 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.

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

38 changes: 2 additions & 36 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,51 +4,17 @@
"license": "MIT",
"description": "Rector upgrades rules for Laravel Framework",
"require": {
"php": ">=8.2",
"php": "^7.2 || ^8.0",
"rector/rector": "^1.0"
},
"require-dev": {
"nikic/php-parser": "^4.18",
"phpstan/extension-installer": "^1.3",
"phpstan/phpstan": "^1.10",
"phpstan/phpstan-strict-rules": "^1.5",
"phpstan/phpstan-webmozart-assert": "^1.2",
"phpunit/phpunit": "^10.5",
"symplify/phpstan-extensions": "^11.4",
"symplify/phpstan-rules": "^12.4",
"symplify/rule-doc-generator": "^12.1",
"tightenco/duster": "^2.7"
},
"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);
}
)
);
};
10 changes: 4 additions & 6 deletions config/sets/laravel-container-string-to-fully-qualified-name.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,15 @@
'command.tinker' => 'Laravel\Tinker\Console\TinkerCommand',
];

$ruleConfig = array_map(
fn (string $service, string $interface) => new ReplaceServiceContainerCallArg(
$ruleConfig = array_map(function (string $service, string $interface) {
return new ReplaceServiceContainerCallArg(
$service,
new ClassConstFetch(
new FullyQualified($interface),
'class'
)
),
array_keys($servicesMap),
$servicesMap,
);
);
}, array_keys($servicesMap), $servicesMap);

$rectorConfig->ruleWithConfiguration(
ReplaceServiceContainerCallArgRector::class,
Expand Down
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
31 changes: 0 additions & 31 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
Loading

0 comments on commit ac4831a

Please sign in to comment.