Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/remarkablemark/rector-template
🐘 Rector template
https://github.com/remarkablemark/rector-template
codemod composer php rector refactoring template
Last synced: 11 days 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 (11 months ago)
- Default Branch: master
- Last Pushed: 2024-04-24T14:04:22.000Z (7 months ago)
- Last Synced: 2024-05-01T21:25:45.266Z (6 months ago)
- Topics: codemod, composer, php, rector, refactoring, template
- Language: PHP
- Homepage: https://packagist.org/packages/remarkablemark/rector-template
- Size: 62.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# rector-template
[![packagist](https://img.shields.io/packagist/v/remarkablemark/rector-template)](https://packagist.org/packages/remarkablemark/rector-template)
[![test](https://github.com/remarkablemark/rector-template/actions/workflows/test.yml/badge.svg)](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 >=7.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)