https://github.com/remarkablemark/rector-template
🐘 Rector template
https://github.com/remarkablemark/rector-template
codemod composer php rector refactoring template
Last synced: about 2 months ago
JSON representation
🐘 Rector template
- Host: GitHub
- URL: https://github.com/remarkablemark/rector-template
- Owner: remarkablemark
- License: mit
- Created: 2023-12-10T05:10:08.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2026-01-26T14:56:43.000Z (5 months ago)
- Last Synced: 2026-01-27T03:42:17.457Z (5 months ago)
- Topics: codemod, composer, php, rector, refactoring, template
- Language: PHP
- Homepage: https://packagist.org/packages/remarkablemark/rector-template
- Size: 190 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# rector-template
[](https://packagist.org/packages/remarkablemark/rector-template)
[](https://github.com/remarkablemark/rector-template/actions/workflows/test.yml)
[Rector](https://github.com/rectorphp/rector) template. Example from Rector [custom rule](https://getrector.com/documentation/custom-rule).
## Requirements
PHP >=8.2
## Install
Install with [Composer](http://getcomposer.org/):
```sh
composer require --dev rector/rector remarkablemark/rector-template
```
## Usage
Register rule in `rector.php`:
```php
paths([
__DIR__,
]);
$rectorConfig->rule(ExampleRector::class);
};
```
See the diff:
```php
vendor/bin/rector process --dry-run
```
Apply the rule:
```php
vendor/bin/rector process
```
Clear the cache and apply the rule:
```php
vendor/bin/rector process --clear-cache
```
## Rule
### Before
```php
$user->setPassword('123456');
```
### After
```php
$user->changePassword('123456');
```
## License
[MIT](LICENSE)