https://github.com/ergebnis/rector-rules
👓 Provides a composer package with rules for rector/rector.
https://github.com/ergebnis/rector-rules
rector rules
Last synced: about 1 year ago
JSON representation
👓 Provides a composer package with rules for rector/rector.
- Host: GitHub
- URL: https://github.com/ergebnis/rector-rules
- Owner: ergebnis
- License: mit
- Created: 2023-09-30T07:02:49.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-05-27T23:44:46.000Z (about 2 years ago)
- Last Synced: 2024-05-28T08:56:10.438Z (about 2 years ago)
- Topics: rector, rules
- Language: PHP
- Size: 662 KB
- Stars: 6
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE.md
- Codeowners: .github/CODEOWNERS
- Security: .github/SECURITY.md
Awesome Lists containing this project
README
# rector-rules
[](https://github.com/ergebnis/rector-rules/actions)
[](https://github.com/ergebnis/rector-rules/actions)
[](https://github.com/ergebnis/rector-rules/actions)
[](https://github.com/ergebnis/rector-rules/actions)
[](https://codecov.io/gh/ergebnis/rector-rules)
[](https://packagist.org/packages/ergebnis/rector-rules)
[](https://packagist.org/packages/ergebnis/rector-rules)
[](https://packagist.org/packages/ergebnis/rector-rules)
This project provides a [`composer`](https://getcomposer.org) package with rules for [`rector/rector`](https://github.com/rectorphp/rector).
## Installation
Run
```sh
composer require --dev ergebnis/rector-rules
```
## Usage
### Rules
This project provides the following rules for [`rector/rector`](https://github.com/rectorphp/rector):
- [`Ergebnis\Rector\Rules\Arrays\SortAssociativeArrayByKeyRector`](https://github.com/ergebnis/rector-rules#arrayssortassociativearraybykeyrector)
#### `Arrays\SortAssociativeArrayByKeyRector`
This rule sorts associative arrays in ascending order by key unless they are declared in classes extending `PHPUnit\Framework\TestCase`.
```diff
[
+ 'quux' => 'quuz',
+ 'quz' => 'qux',
+ ],
'foo' => [
'foo',
'bar',
'baz',
],
- 'bar' => [
- 'quz' => 'qux',
- 'quux' => 'quuz',
- ],
];
```
## Changelog
The maintainers of this project record notable changes to this project in a [changelog](CHANGELOG.md).
## Contributing
The maintainers of this project suggest following the [contribution guide](.github/CONTRIBUTING.md).
## Code of Conduct
The maintainers of this project ask contributors to follow the [code of conduct](https://github.com/ergebnis/.github/blob/main/CODE_OF_CONDUCT.md).
## General Support Policy
The maintainers of this project provide limited support.
You can support the maintenance of this project by [sponsoring @localheinz](https://github.com/sponsors/localheinz) or [requesting an invoice for services related to this project](mailto:am@localheinz.com?subject=ergebnis/rector-rules:%20Requesting%20invoice%20for%20services).
## PHP Version Support Policy
This project supports PHP versions with [active and security support](https://www.php.net/supported-versions.php).
The maintainers of this project add support for a PHP version following its initial release and drop support for a PHP version when it has reached the end of security support.
## Security Policy
This project has a [security policy](.github/SECURITY.md).
## License
This project uses the [MIT license](LICENSE.md).
## Social
Follow [@localheinz](https://twitter.com/intent/follow?screen_name=localheinz) and [@ergebnis](https://twitter.com/intent/follow?screen_name=ergebnis) on Twitter.