PHPackages                             fig-r/psr2r-fixer - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. fig-r/psr2r-fixer

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

fig-r/psr2r-fixer
=================

286PHP

Since Feb 5Pushed 9y ago1 watchersCompare

[ Source](https://github.com/php-fig-rectified/psr2r-fixer)[ Packagist](https://packagist.org/packages/fig-r/psr2r-fixer)[ RSS](/packages/fig-r-psr2r-fixer/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

PSR-2-R Fixer
=============

[](#psr-2-r-fixer)

[![Build Status](https://camo.githubusercontent.com/d7a3598fa353fcdeff8bee0b57a5bf45fcc0ec840e6abcd5c476fac5001c7967/68747470733a2f2f6170692e7472617669732d63692e6f72672f7068702d6669672d7265637469666965642f70737232722d66697865722e737667)](https://travis-ci.org/php-fig-rectified/psr2r-fixer)[![Minimum PHP Version](https://camo.githubusercontent.com/b8feeff753e7c6ff51ffd26c612be3c4f292513e413cd0c8884e665ff51dd798/687474703a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344253230352e342d3838393242462e737667)](https://php.net/)[![License](https://camo.githubusercontent.com/efe71c30ab32343cb03a2f6f82af05e11a5d7377b1f722c51b9b791508227859/68747470733a2f2f706f7365722e707567782e6f72672f6669672d722f70737232722d66697865722f6c6963656e73652e737667)](https://packagist.org/packages/fig-r/psr2r-fixer)[![Total Downloads](https://camo.githubusercontent.com/e979e23ff8fe8765e34c49ac924f37ea502a854bcf7a7f52b61129a5509b3994/68747470733a2f2f706f7365722e707567782e6f72672f6669672d722f70737232722d66697865722f642f746f74616c2e737667)](https://packagist.org/packages/fig-r/psr2r-fixer)[![Coding Standards](https://camo.githubusercontent.com/dbabe22710e675cb88cd0b12196f1477e2376dea497332775692cf1359a75918/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f63732d5053522d2d322d2d522d79656c6c6f772e737667)](https://github.com/php-fig-rectified/fig-rectified-standards)

For details on PSR-2-R see [fig-rectified-standards](https://github.com/php-fig-rectified/fig-rectified-standards).

Full documentation @ [/docs/](docs).

Deprecated
----------

[](#deprecated)

This tool is not used/maintained anymore. Please use the [sniffer](https://github.com/php-fig-rectified/psr2r-sniffer) which can both detect and fix cs issues as well as tokenize PHP files.

PHP-CS-FIXER Fixers
-------------------

[](#php-cs-fixer-fixers)

This uses [FriendsOfPHP/PHP-CS-Fixer](https://github.com/FriendsOfPHP/PHP-CS-Fixer). It can detect and fix some issues automatically and is ideal for integration into the IDE.

### Configuration

[](#configuration)

You can use PSR-2-R by default. Create your own `.phpcs` configuration in the root directory of your project. You can copy-and-paste this one and adjust the path to the psr2r standard definition:

```
$finder = Symfony\CS\Finder\DefaultFinder::create()
	->in(__DIR__)
	->exclude('bin')
	->exclude('vendor') // add anything you want to omit
;

return require_once('vendor/fig-r/psr2r-fixer/.php_cs_psr2r');
```

In case you want to further modify it assign it to a variable and then you can continue to work on the returned object, before finally returning it.

### Usage

[](#usage)

You can now run it from your root directory as

```
vendor/bin/php-cs-fixer fix

```

It will automatically pull your config (confirm that by looking for that info in the first line when starting the fixer).

Of course you can also use any of the custom fixers in this repo in your config, or extend/modify them as you like.

```
...
->finder($finder)
->addCustomFixer(new \Psr2rFixer\Fixer\NoSpacesCastFixer())
...
```

License
-------

[](#license)

MIT

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/0643e6255da841fe65260ec6e263d8908a40a84b884c32e9fc6be6a15e252fa8?d=identicon)[burzum](/maintainers/burzum)

![](https://avatars.githubusercontent.com/u/39854?v=4)[Mark Scherer](/maintainers/dereuromark)[@dereuromark](https://github.com/dereuromark)

---

Top Contributors

[![dereuromark](https://avatars.githubusercontent.com/u/39854?v=4)](https://github.com/dereuromark "dereuromark (2 commits)")

### Embed Badge

![Health badge](/badges/fig-r-psr2r-fixer/health.svg)

```
[![Health](https://phpackages.com/badges/fig-r-psr2r-fixer/health.svg)](https://phpackages.com/packages/fig-r-psr2r-fixer)
```

###  Alternatives

[abhi1693/yii2-sms

Send Free Sms for Yii2

171.9k](/packages/abhi1693-yii2-sms)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
