This commit is contained in:
Refactorian
2024-03-02 10:31:44 +09:00
committed by GitHub
parent e72c72aedc
commit c9bcacdfb1
4 changed files with 197 additions and 7 deletions

View File

@@ -77,16 +77,22 @@
### Laravel Pint (Code Style Fixer | PHP-CS-Fixer) ### Laravel Pint (Code Style Fixer | PHP-CS-Fixer)
- Format all files - Format all files
- `./vendor/bin/pint` - `vendor/bin/pint`
- Format specific files or directories - Format specific files or directories
- `./vendor/bin/pint app/Models` - `vendor/bin/pint app/Models`
- `./vendor/bin/pint app/Models/User.php` - `vendor/bin/pint app/Models/User.php`
- Format all files with preview - Format all files with preview
- `./vendor/bin/pint -v` - `vendor/bin/pint -v`
- Format uncommitted changes according to Git - Format uncommitted changes according to Git
- `./vendor/bin/pint --dirty` - `vendor/bin/pint --dirty`
- Inspect all files - Inspect all files
- `./vendor/bin/pint --test` - `vendor/bin/pint --test`
### Rector
- Dry Run
- `vendor/bin/rector process --dry-run`
- Process
- `vendor/bin/rector process`
# TODO # TODO
- Improve environment - Improve environment

View File

@@ -12,12 +12,14 @@
"laravel/tinker": "^2.8" "laravel/tinker": "^2.8"
}, },
"require-dev": { "require-dev": {
"driftingly/rector-laravel": "^1.0",
"fakerphp/faker": "^1.9.1", "fakerphp/faker": "^1.9.1",
"laravel/pint": "^1.0", "laravel/pint": "^1.0",
"laravel/sail": "^1.18", "laravel/sail": "^1.18",
"mockery/mockery": "^1.4.4", "mockery/mockery": "^1.4.4",
"nunomaduro/collision": "^7.0", "nunomaduro/collision": "^7.0",
"phpunit/phpunit": "^10.1", "phpunit/phpunit": "^10.1",
"rector/rector": "^1.0",
"spatie/laravel-ignition": "^2.0" "spatie/laravel-ignition": "^2.0"
}, },
"autoload": { "autoload": {

155
composer.lock generated
View File

@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "9c491b8531eec05ba41a11d9276a5749", "content-hash": "ad9efdb95ea4d8598d8c9316d679417d",
"packages": [ "packages": [
{ {
"name": "brick/math", "name": "brick/math",
@@ -5686,6 +5686,41 @@
} }
], ],
"packages-dev": [ "packages-dev": [
{
"name": "driftingly/rector-laravel",
"version": "1.0.0",
"source": {
"type": "git",
"url": "https://github.com/driftingly/rector-laravel.git",
"reference": "b5a43f683d2c32850c050fda1983828ff97b8470"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/driftingly/rector-laravel/zipball/b5a43f683d2c32850c050fda1983828ff97b8470",
"reference": "b5a43f683d2c32850c050fda1983828ff97b8470",
"shasum": ""
},
"require": {
"php": "^7.2 || ^8.0",
"rector/rector": "^1.0"
},
"type": "rector-extension",
"autoload": {
"psr-4": {
"RectorLaravel\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"description": "Rector upgrades rules for Laravel Framework",
"support": {
"issues": "https://github.com/driftingly/rector-laravel/issues",
"source": "https://github.com/driftingly/rector-laravel/tree/1.0.0"
},
"time": "2024-02-07T18:42:55+00:00"
},
{ {
"name": "fakerphp/faker", "name": "fakerphp/faker",
"version": "v1.23.1", "version": "v1.23.1",
@@ -6348,6 +6383,68 @@
}, },
"time": "2022-02-21T01:04:05+00:00" "time": "2022-02-21T01:04:05+00:00"
}, },
{
"name": "phpstan/phpstan",
"version": "1.10.59",
"source": {
"type": "git",
"url": "https://github.com/phpstan/phpstan.git",
"reference": "e607609388d3a6d418a50a49f7940e8086798281"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/e607609388d3a6d418a50a49f7940e8086798281",
"reference": "e607609388d3a6d418a50a49f7940e8086798281",
"shasum": ""
},
"require": {
"php": "^7.2|^8.0"
},
"conflict": {
"phpstan/phpstan-shim": "*"
},
"bin": [
"phpstan",
"phpstan.phar"
],
"type": "library",
"autoload": {
"files": [
"bootstrap.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"description": "PHPStan - PHP Static Analysis Tool",
"keywords": [
"dev",
"static analysis"
],
"support": {
"docs": "https://phpstan.org/user-guide/getting-started",
"forum": "https://github.com/phpstan/phpstan/discussions",
"issues": "https://github.com/phpstan/phpstan/issues",
"security": "https://github.com/phpstan/phpstan/security/policy",
"source": "https://github.com/phpstan/phpstan-src"
},
"funding": [
{
"url": "https://github.com/ondrejmirtes",
"type": "github"
},
{
"url": "https://github.com/phpstan",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/phpstan/phpstan",
"type": "tidelift"
}
],
"time": "2024-02-20T13:59:13+00:00"
},
{ {
"name": "phpunit/php-code-coverage", "name": "phpunit/php-code-coverage",
"version": "10.1.11", "version": "10.1.11",
@@ -6770,6 +6867,62 @@
], ],
"time": "2024-02-25T14:05:00+00:00" "time": "2024-02-25T14:05:00+00:00"
}, },
{
"name": "rector/rector",
"version": "1.0.1",
"source": {
"type": "git",
"url": "https://github.com/rectorphp/rector.git",
"reference": "258b775511e62a7188f8ce114d44acaf244d9a7d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/rectorphp/rector/zipball/258b775511e62a7188f8ce114d44acaf244d9a7d",
"reference": "258b775511e62a7188f8ce114d44acaf244d9a7d",
"shasum": ""
},
"require": {
"php": "^7.2|^8.0",
"phpstan/phpstan": "^1.10.57"
},
"conflict": {
"rector/rector-doctrine": "*",
"rector/rector-downgrade-php": "*",
"rector/rector-phpunit": "*",
"rector/rector-symfony": "*"
},
"bin": [
"bin/rector"
],
"type": "library",
"autoload": {
"files": [
"bootstrap.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"description": "Instant Upgrade and Automated Refactoring of any PHP code",
"keywords": [
"automation",
"dev",
"migration",
"refactoring"
],
"support": {
"issues": "https://github.com/rectorphp/rector/issues",
"source": "https://github.com/rectorphp/rector/tree/1.0.1"
},
"funding": [
{
"url": "https://github.com/tomasvotruba",
"type": "github"
}
],
"time": "2024-02-16T07:53:23+00:00"
},
{ {
"name": "sebastian/cli-parser", "name": "sebastian/cli-parser",
"version": "2.0.0", "version": "2.0.0",

29
rector.php Normal file
View File

@@ -0,0 +1,29 @@
<?php
declare(strict_types=1);
use Rector\Config\RectorConfig;
use Rector\Set\ValueObject\LevelSetList;
use Rector\Set\ValueObject\SetList;
use Rector\TypeDeclaration\Rector\ClassMethod\AddVoidReturnTypeWhereNoReturnRector;
use RectorLaravel\Set\LaravelSetList;
return RectorConfig::configure()
->withPaths([
__DIR__.'/app',
// __DIR__.'/bootstrap',
// __DIR__.'/config',
// __DIR__.'/lang',
// __DIR__.'/public',
// __DIR__.'/resources',
// __DIR__.'/routes',
// __DIR__.'/tests',
])
->withSets([
SetList::DEAD_CODE,
LevelSetList::UP_TO_PHP_82,
LaravelSetList::LARAVEL_100,
])
->withRules([
AddVoidReturnTypeWhereNoReturnRector::class,
]);