PHPackages                             gordinskiy/line-length-checker - 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. [Validation &amp; Sanitization](/categories/validation)
4. /
5. gordinskiy/line-length-checker

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

gordinskiy/line-length-checker
==============================

 PHP-CS-Fixer rule to check line length

v0.0.2(2y ago)439.2k↓31%11MITPHPPHP ^7.4 || ^8.0

Since Nov 27Pushed 2y ago1 watchersCompare

[ Source](https://github.com/gordinskiy/Line-Length-Checker)[ Packagist](https://packagist.org/packages/gordinskiy/line-length-checker)[ RSS](/packages/gordinskiy-line-length-checker/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (1)Versions (3)Used By (1)

PHP Line Length Checker
=======================

[](#php-line-length-checker)

Custom rule for [PHP-CS-Fixer](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer).
Checks that the length of lines does not exceed 120 characters.
Doesn't fix anything.

### How it works

[](#how-it-works)

Searches for the line that exceed max length limit and mark it by adding comment:
` # Line too long`

To see which lines violates the rule you should run the command with the`--diff` flag.

DIff example:

 [![Diff Example](./diff-example.png "Diff Example")](./diff-example.png)

Works only for `check` command and `fix` command with `--dry-run` flag. Does nothing in other cases.

### Installation

[](#installation)

Install package:

```
composer require --dev gordinskiy/line-length-checker
```

Register rule in PHP-CS-Fixer config file:

```
