diff --git a/composer.json b/composer.json index 20b00d68..0b90656d 100644 --- a/composer.json +++ b/composer.json @@ -41,6 +41,7 @@ "maglnet/composer-require-checker": "^3.0 || ^4.0", "mikey179/vfsstream": "^1.6", "phpunit/phpunit": "^9", + "rector/rector": "^1.0", "squizlabs/php_codesniffer": "^3.6" }, "suggest": { diff --git a/composer.lock b/composer.lock index 7caea27b..14da0923 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "b1f586d61b3a6c89e4f349f8dd90d343", + "content-hash": "af7164b4c8ffa27d2fef9bfa9be494cc", "packages": [ { "name": "brick/math", @@ -2010,6 +2010,64 @@ }, "time": "2022-02-21T01:04:05+00:00" }, + { + "name": "phpstan/phpstan", + "version": "1.10.67", + "source": { + "type": "git", + "url": "https://github.com/phpstan/phpstan.git", + "reference": "16ddbe776f10da6a95ebd25de7c1dbed397dc493" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/16ddbe776f10da6a95ebd25de7c1dbed397dc493", + "reference": "16ddbe776f10da6a95ebd25de7c1dbed397dc493", + "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" + } + ], + "time": "2024-04-16T07:22:02+00:00" + }, { "name": "phpunit/php-code-coverage", "version": "9.2.30", @@ -2485,6 +2543,65 @@ }, "time": "2021-11-05T16:47:00+00:00" }, + { + "name": "rector/rector", + "version": "1.0.4", + "source": { + "type": "git", + "url": "https://github.com/rectorphp/rector.git", + "reference": "6e04d0eb087aef707fa0c5686d33d6ff61f4a555" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/rectorphp/rector/zipball/6e04d0eb087aef707fa0c5686d33d6ff61f4a555", + "reference": "6e04d0eb087aef707fa0c5686d33d6ff61f4a555", + "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": "*" + }, + "suggest": { + "ext-dom": "To manipulate phpunit.xml via the custom-rule command" + }, + "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.4" + }, + "funding": [ + { + "url": "https://github.com/tomasvotruba", + "type": "github" + } + ], + "time": "2024-04-05T09:01:07+00:00" + }, { "name": "sebastian/cli-parser", "version": "1.0.1", @@ -4281,5 +4398,5 @@ "platform-dev": { "ext-apcu": "*" }, - "plugin-api-version": "2.6.0" + "plugin-api-version": "2.3.0" } diff --git a/rector.php b/rector.php new file mode 100644 index 00000000..659bdfdf --- /dev/null +++ b/rector.php @@ -0,0 +1,32 @@ +withPaths([ __DIR__ . '/' ]) + ->withSkip([ + __DIR__ . '/.github', + __DIR__ . '/vendor', + __DIR__ . '/docs', + 'rector.php', + '.gitignore', + '.git', + 'CHANGELOG.md', + 'composer.json', + 'composer.lock', + 'phpunit.xml', + 'README.md', + 'CONTRIBUTING.md', + 'dev.yml', + 'LICENSE', + 'RELEASING.md', + 'run_test_resource_test.sh', + 'composer-require-checker.json' + ]) + ->withRules([ + ReadOnlyPropertyRector::class, + TypedPropertyFromStrictConstructorRector::class, + NullToStrictStringFuncCallArgRector::class + ]); \ No newline at end of file