Skip to content

Commit ca49278

Browse files
author
DKravtsov
committed
Updated packages, added Rector.
1 parent 6916278 commit ca49278

File tree

13 files changed

+1188
-441
lines changed

13 files changed

+1188
-441
lines changed

composer.json

+6-1
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,12 @@
145145
"PHPStan\\Rules\\PHPUnit\\": "tools/02_phpstan/vendor/phpstan/phpstan-phpunit/src/Rules/PHPUnit",
146146
"PHPStan\\Symfony\\": "tools/02_phpstan/vendor/phpstan/phpstan-symfony/src/Symfony",
147147
"PHPStan\\Type\\PHPUnit\\": "tools/02_phpstan/vendor/phpstan/phpstan-phpunit/src/Type/PHPUnit",
148-
"PHPStan\\Type\\Symfony\\": "tools/02_phpstan/vendor/phpstan/phpstan-symfony/src/Type/Symfony"
148+
"PHPStan\\Type\\Symfony\\": "tools/02_phpstan/vendor/phpstan/phpstan-symfony/src/Type/Symfony",
149+
"Rector\\Core\\": "tools/08_rector/vendor/rector/rector/src",
150+
"Rector\\Php74\\": "tools/08_rector/vendor/rector/rector/rules/Php74",
151+
"Rector\\Php80\\": "tools/08_rector/vendor/rector/rector/rules/Php80",
152+
"Rector\\Php81\\": "tools/08_rector/vendor/rector/rector/rules/Php81",
153+
"Rector\\Set\\": "tools/08_rector/vendor/rector/rector/packages/Set"
149154
}
150155
},
151156
"prefer-stable": true,

composer.lock

+210-199
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/development.md

+30-3
Original file line numberDiff line numberDiff line change
@@ -117,13 +117,40 @@ make phpstan
117117
```
118118

119119
## Phpinsights PHP quality checks
120-
PHP Insights was carefully crafted to simplify the analysis of your code directly from your terminal, and is the perfect starting point to analyze the code quality of your PHP projects.
120+
PHP Insights was carefully crafted to simplify the analysis of your code directly from your terminal, and is the perfect starting point to analyze the code quality of your PHP projects.
121121

122122
Phpinsights is available for dev/test environment using next local shell command:
123123
```bash
124124
make phpinsights
125125
```
126126

127+
## Metrics
128+
This environment contains [PhpMetrics](https://github.com/phpmetrics/phpmetrics) to make some code analysis.
129+
Use next local shell command in order to run it:
130+
```bash
131+
make phpmetrics
132+
```
133+
Note: You need run tests before this local shell command.
134+
135+
After execution above local shell command please open `reports/phpmetrics/index.html` with your browser.
136+
137+
## Rector
138+
Rector instantly upgrades and refactors the PHP code of your application. It can help you in 2 major areas:
139+
- Instant upgrades
140+
- Automated refactoring
141+
142+
Rector now supports upgrades of your code from PHP 5.3 to 8.1 or upgrades your code for new framework version. This tool supports major open-source projects like Symfony, PHPUnit, Nette, Laravel, CakePHP and Doctrine.
143+
You can find live demo [here](https://symfonycasts.com/screencast/symfony6-upgrade/rector) or more info [here](https://packagist.org/packages/rector/rector).
144+
145+
Rector is available for test/dev environment. If you need to run this tool, please use next local shell command in order to enter inside php container shell and then run rector:
146+
```bash
147+
make ssh
148+
```
149+
```bash
150+
vendor/bin/rector process src/your_folder_with_code_for_refactoring
151+
```
152+
Note: You can process rector without specifying folder, in such case it will process src and tests folder.
153+
127154

128155
## Database changes
129156
Doctrine migrations it is functionality for versioning your database schema and easily deploying changes to it.
@@ -143,6 +170,6 @@ Please use next workflow for migrations:
143170

144171
Above commands you can run in symfony container shell using next: `./bin/console doctrine:migrations:<command>`.
145172

146-
Using above workflow allow you make database changes on your application.
147-
Also you do not need to make any migrations files by hand (Doctrine will handle it).
173+
Using above workflow allow you make database changes on your application.
174+
Also you do not need to make any migrations files by hand (Doctrine will handle it).
148175
Please always check generated migration files to make sure that those doesn't contain anything that you really don't want.

readme.md

+1
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,7 @@ Notes: Please see more commands in Makefile
250250
* [phpmd](https://packagist.org/packages/phpmd/phpmd)
251251
* [phpstan](https://packagist.org/packages/phpstan/phpstan)
252252
* [phpinsights](https://packagist.org/packages/nunomaduro/phpinsights)
253+
* [rector](https://packagist.org/packages/rector/rector)
253254

254255
## Guidelines
255256
* [Commands](docs/commands.md)

tools/01_phpunit/composer.lock

+28-24
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)